grenlayk / deep-text-edit

Our implementation of Text Style Brush architecture.
MIT License
123 stars 29 forks source link

prepare_dataset.py not work #35

Open Loganavter opened 1 year ago

Loganavter commented 1 year ago

Traceback (most recent call last): File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/types.py", line 608, in convert st = os.stat(rv) FileNotFoundError: [Errno 2] No such file or directory: 'dataset_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "prepare_dataset.py", line 90, in main() # pylint: disable=no-value-for-parameter File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(*args, kwargs) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 781, in main with self.make_context(prog_name, args, extra) as ctx: File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 700, in make_context self.parse_args(ctx, args) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1048, in parse_args value, args = param.handle_parse_result(ctx, opts, args) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1623, in handle_parse_result value = self.full_process_value(ctx, value) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1965, in full_process_value return Parameter.full_process_value(self, ctx, value) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1592, in full_process_value value = self.get_default(ctx) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1917, in get_default return Parameter.get_default(self, ctx) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1534, in get_default return self.type_cast_value(ctx, rv) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1568, in type_cast_value return _convert(value, (self.nargs != 1) + bool(self.multiple)) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1565, in _convert return self.type(value, self, ctx) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/types.py", line 46, in call return self.convert(value, param, ctx) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/types.py", line 614, in convert self.path_type, filename_to_ui(value) File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/_compat.py", line 474, in filename_to_ui value = value.encode("utf-8", "surrogateescape").decode("utf-8", "replace") AttributeError: 'PosixPath' object has no attribute 'encode' (venv) [jorj@jorj-systemproductname text-deep-fake-main]$ cd /home/jorj/Загрузки/text-deep-fake-main/IMGUR5K-Handwriting-Dataset-main/ (venv) [jorj@jorj-systemproductname IMGUR5K-Handwriting-Dataset-main]$ python prepare_dataset.py 0it [00:00, ?it/s] 2023-07-07 18:57:47.034 | ERROR | main:main:84 - An error has been caught in function 'main', process 'MainProcess' (252331), thread 'MainThread' (140470161389376): Traceback (most recent call last):

File "prepare_dataset.py", line 90, in main() # pylint: disable=no-value-for-parameter └

File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) │ │ │ └ {} │ │ └ () │ └ <function BaseCommand.main at 0x7fc1c157a8c0> └ File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) │ │ └ <click.core.Context object at 0x7fc1baaf79d0> │ └ <function Command.invoke at 0x7fc1c150ab90> └ File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) │ │ │ │ │ └ {'annotations_path': PosixPath('dataset_info'), 'save_path': PosixPath('cropped'), 'no_split': False, 'reduce': None} │ │ │ │ └ <click.core.Context object at 0x7fc1baaf79d0> │ │ │ └ <function main at 0x7fc1ba7d9e60> │ │ └ │ └ <function Context.invoke at 0x7fc1c150b050> └ <click.core.Context object at 0x7fc1baaf79d0> File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(args, **kwargs) │ │ └ {'annotations_path': PosixPath('dataset_info'), 'save_path': PosixPath('cropped'), 'no_split': False, 'reduce': None} │ └ () └ <function main at 0x7fc1ba7d9e60>

File "prepare_dataset.py", line 84, in main img_cropped = crop_minAreaRect(img, *info['bounding_box']) │ │ └ {'word': 'SIRIÜS', 'bounding_box': '[97.0, 1011.5, 103.0, 36.0, 4.5]'} │ └ array([[[165, 210, 224], │ [163, 210, 224], │ [163, 210, 224], │ ..., │ [148, 200, 213], │ [150... └ <function crop_minAreaRect at 0x7fc1c156ecb0>

TypeError: crop_minAreaRect() takes 6 positional arguments but 33 were given 0it [00:00, ?it/s] 2023-07-07 18:57:47.039 | ERROR | click.core:invoke:610 - An error has been caught in function 'invoke', process 'MainProcess' (252331), thread 'MainThread' (140470161389376): Traceback (most recent call last):

File "prepare_dataset.py", line 90, in main() # pylint: disable=no-value-for-parameter └

File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(*args, kwargs) │ │ │ └ {} │ │ └ () │ └ <function BaseCommand.main at 0x7fc1c157a8c0> └ File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) │ │ └ <click.core.Context object at 0x7fc1baaf79d0> │ └ <function Command.invoke at 0x7fc1c150ab90> └ File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) │ │ │ │ │ └ {'annotations_path': PosixPath('dataset_info'), 'save_path': PosixPath('cropped'), 'no_split': False, 'reduce': None} │ │ │ │ └ <click.core.Context object at 0x7fc1baaf79d0> │ │ │ └ <function main at 0x7fc1ba7d9e60> │ │ └ │ └ <function Context.invoke at 0x7fc1c150b050> └ <click.core.Context object at 0x7fc1baaf79d0>

File "/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) │ │ └ {'annotations_path': PosixPath('dataset_info'), 'save_path': PosixPath('cropped'), 'no_split': False, 'reduce': None} │ └ () └ <function main at 0x7fc1ba7d9e60>

File "prepare_dataset.py", line 85, in main cv2.imwrite(str(output_path / f'{ann_id}.png'), img_cropped) │ │ │ └ None │ │ └ PosixPath('cropped/train') │ └ └ <module 'cv2.cv2' from '/home/jorj/Загрузки/text-deep-fake-main/venv/lib/python3.7/site-packages/cv2/cv2.cpython-37m-x86_64-l...

cv2.error: OpenCV(4.1.2) /io/opencv/modules/imgcodecs/src/loadsave.cpp:715: error: (-215:Assertion failed) !_img.empty() in function 'imwrite'