Belval / TextRecognitionDataGenerator

A synthetic data generator for text recognition
MIT License
3.26k stars 970 forks source link

ValueError: height and width must be > 0 #358

Open worldofzeroandone opened 1 week ago

worldofzeroandone commented 1 week ago

Traceback (most recent call last): File "run.py", line 493, in main() File "run.py", line 438, in main for _ in tqdm( File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/site-packages/tqdm/std.py", line 1181, in iter for obj in iterable: File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/multiprocessing/pool.py", line 868, in next raise value ValueError: height and width must be > 0

I saw the solution is set the font dir,but I sepcify a font dir but it still has this problem,I want to generate 450000 images,I don't know if it's due to the size of images,but when I set the 45000 it still has the same problem

worldofzeroandone commented 1 week ago

Traceback (most recent call last): File "run.py", line 493, in main() File "run.py", line 438, in main for _ in tqdm( File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/site-packages/tqdm/std.py", line 1181, in iter for obj in iterable: File "/home/gxu3081/anaconda3/envs/mm/lib/python3.8/multiprocessing/pool.py", line 868, in next raise value ValueError: height and width must be > 0

I saw the solution is set the font dir,but I sepcify a font dir but it still has this problem,I want to generate 450000 images,I don't know if it's due to the size of images,but when I set the 45000 it still has the same problem

this is my error: multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, *kwds)) File "/home/gxu4090x2/桌面/chengang/TRDG/trdg/data_generator.py", line 22, in generate_from_tuple cls.generate(t) File "/home/gxu4090x2/桌面/chengang/TRDG/trdg/data_generator.py", line 133, in generate resized_img = distorted_img.resize( File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/site-packages/PIL/Image.py", line 2305, in resize im = im.resize(size, resample, box) File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/site-packages/PIL/Image.py", line 2328, in resize return self._new(self.im.resize(size, resample, box)) ValueError: height and width must be > 0 """

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

Traceback (most recent call last): File "run.py", line 493, in main() File "run.py", line 438, in main for _ in tqdm( File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/site-packages/tqdm/std.py", line 1178, in iter for obj in iterable: File "/home/gxu4090x2/.conda/envs/mm/lib/python3.8/multiprocessing/pool.py", line 868, in next raise value ValueError: height and width must be > 0 value of mean pixel is too similar. Ignore this image resized_img_st [40.482142857142854, 40.482142857142854, 40.482142857142854, 185.16071428571428] background_img_st [11.379375, 37.9578125, 70.65375] value of mean pixel is too similar. Ignore this image resized_img_st [39.689189189189186, 39.689189189189186, 39.689189189189186, 181.9189189189189] background_img_st [31.676875, 58.523125, 12.821875]