SynthText_Chinese_version
SynthText_Chinese_version copied to clipboard
how can i solve this problem
File "gen.py", line 142, in main img_resize=img.resize(db['depth'][imname].shape) File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 1745, in resize return self._new(self.im.resize(size, resample, box)) TypeError: argument 1 must be sequence of length 2, not 3
It's stated in your log, Image resize function only accept tuple-2, it won't be happy to take tuple-3 (if you print the shape, you will see db['depth'][imname] is depth * width * height, rather than width * height).
I attempted to use .shape[1:] to sort this out, however, it was not happy about it whatsoever. So what I did to tackle this problem was converting img to numpy format, and utilised opencv cv2.resize function to resize the raw image.
Hope it gives some help. I had other headache trying to make it opencv3.3 friendly, and still working on it.
Good luck. Hanyi Hu
#2 here is the solution
img_resize=img.resize(db['depth'][imname].shape[1:3])