Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing modules for handwritten text generation. #316

Open
whiitees opened this issue Sep 5, 2023 · 1 comment
Open

Missing modules for handwritten text generation. #316

whiitees opened this issue Sep 5, 2023 · 1 comment

Comments

@whiitees
Copy link

whiitees commented Sep 5, 2023

When I use this command 'trdg -c 1000 -w 5 -f 64 -bl 4'

Ther is this error:
Missing modules for handwritten text generation.
0%| | 0/1000 [00:00<?, ?it/s]Missing modules for handwritten text generation.
0%| | 0/1000 [00:11<?, ?it/s]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\trdg\data_generator.py", line 22, in generate_from_tuple
cls.generate(*t)
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\trdg\data_generator.py", line 72, in generate
image, mask = computer_text_generator.generate(
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\trdg\computer_text_generator.py", line 36, in generate
return _generate_horizontal_text(
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\trdg\computer_text_generator.py", line 107, in _generate_horizontal_text
text_height = max([get_text_height(image_font, p) for p in splitted_text])
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\trdg\computer_text_generator.py", line 107, in
text_height = max([get_text_height(image_font, p) for p in splitted_text])
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\trdg\utils.py", line 122, in get_text_height
return image_font.getsize(text)[1]
AttributeError: 'FreeTypeFont' object has no attribute 'getsize'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\Scripts\trdg.exe_main
.py", line 7, in
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\trdg\run.py", line 438, in main
for _ in tqdm(
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\site-packages\tqdm\std.py", line 1182, in iter
for obj in iterable:
File "C:\Users\natan\AppData\Local\Programs\Python\Python39\lib\multiprocessing\pool.py", line 870, in next
raise value
AttributeError: 'FreeTypeFont' object has no attribute 'getsize'

I'am used a python 3.9.13

@pourmand1376
Copy link

Found the answer here.

pip install Pillow==9.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants