SynthText_Chinese_version
SynthText_Chinese_version copied to clipboard
conversion from RGB to HSV not supported
Hello, I encounter the following problems when I run the program Traceback (most recent call last): File "/home/soulie/project/SynthText_Chinese_version/gen.py", line 151, in main hsv_img=np.array(rgb2hsv(img_resize)) File "/home/soulie/project/SynthText_Chinese_version/gen.py", line 100, in rgb2hsv return image.convert('HSV') File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 740, in convert im = im.convert(mode, dither) ValueError: conversion from RGB to HSV not supported could you help me,thanks!
Your PIL package is not properly installed.....Reinstall or try other version....
@JarveeLee thanks,I have fixed it,but I get another problem as follow Traceback (most recent call last): File "synthgen.py", line 620, in render_text regions = self.filter_for_placement(xyz,seg,regions) File "synthgen.py", line 393, in filter_for_placement res = get_text_placement_mask(xyz,seg==l,regions['coeff'][idx],pad=2) File "synthgen.py", line 259, in get_text_placement_mask place_mask = 255*np.ones((np.ceil(COL)+pad,np.ceil(ROW)+pad),'uint8') File "/usr/local/lib/python2.7/dist-packages/numpy/core/numeric.py", line 192, in ones return a TypeError: 'numpy.float64' object cannot be interpreted as an index my numpy version is 1.13.1 I have tried numpy-1.11,but it doesn't work,how can I do to fix it,thinks!
width and height of a matrix must be int....you define it with float64.....
@JarveeLee I know,but I don't have modify your program,so why it occur?and what can I do for it
I as well haven't changed anything from author about this part......Maybe something incompatible....just try int definition instead of float64 like np.ones((int(np.ceil(0.3)),int(np.ceil(0.1))))
@dq-soulie I met the same problem as you.
Problems: File "synthgen.py", line 259, in get_text_placement_mask place_mask = 255*np.ones((np.ceil(COL)+pad,np.ceil(ROW)+pad),'uint8') File "/usr/local/lib/python2.7/dist-packages/numpy/core/numeric.py", line 192, in ones return a TypeError: 'numpy.float64' object cannot be interpreted as an index
Slove: change the line of code : place_mask = 255 * np.ones((np.ceil(COL)+pad,np.ceil(ROW)+pad),'uint8') to place_mask = 255 * np.ones((int(np.ceil(COL))+pad, int(np.ceil(ROW))+pad), 'uint8')
This line of code is located in File "synthgen.py", line 259, in get_text_placement_mask Maybe you can try it.
... [ 2.0680037 5.5457587] [ 2.0680037 5.5474877] [ 2.0680037 5.577759 ]]
[[ 1.8009567 3.3199155] [ 1.8009567 3.3199134] [ 1.8009567 3.3199053] ... [ 2.0680037 5.545406 ] [ 2.0680037 5.546324 ] [ 2.0680037 5.577694 ]]] depth max min 81.71362 1.3432088 Traceback (most recent call last): File "gen.py", line 153, in main hsv_img=np.array(rgb2hsv(img_resize)) File "gen.py", line 102, in rgb2hsv return image.convert('HSV') File "/home/yangliu/anaconda2/envs/python27/lib/python2.7/site-packages/PIL/Image.py", line 702, in convert im = im.convert(mode, dither) ValueError: conversion from RGB to HSV not supported
@dq-soulie @JarveeLee I have met the same problem...Do you remember how you deal with it?Thanks a lot~