You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scipy has changed several specifications in the new version. In those modifications, the 'imread' function has been removed and then the same name function in matplotlib should be used as replacement.
Also, scipy has removed the 'toimage'. So, the 'Image.fromarray' function of PILLOW library should be used.
Please replace the corresponding descriptions in accordance with the changes of scipy as follows:
Thank you for your aggressive work.
Scipy has changed several specifications in the new version. In those modifications, the 'imread' function has been removed and then the same name function in matplotlib should be used as replacement.
Also, scipy has removed the 'toimage'. So, the 'Image.fromarray' function of PILLOW library should be used.
Please replace the corresponding descriptions in accordance with the changes of scipy as follows:
kitti_to_cityscapes.py:
line 34-35
old:
semantic_img = sp.imread(join(semantic_dir,f))
instance_img = sp.imread(join(instance_dir,f))
new:
semantic_img = plt.imread(join(semantic_dir, f))
instance_img = plt.imread(join(instance_dir, f))
line 57-58
old:
sp.toimage(semantic_img, mode='L').save(out_semantic_filename)
sp.toimage(instance_img, high=np.max(instance_img), low=np.min( instance_img), mode='I').save(out_instance_filename)
new:
Image.fromarray(semantic_img, mode='L').save(out_semantic_filename)
Image.fromarray(instance_img, mode='I').save(out_instance_filename)
The following import command must be added previously.
from PIL import Image
vkitti2_to_cityscapes.py:
perhaps line 71-72:
old:
semantic_img = sp.imread(join(semantic_dir, f.replace('rgb', 'classgt').replace('jpg', 'png')))
instance_img = sp.imread(join(instance_dir, f.replace('rgb', 'instancegt').replace('jpg', 'png')), mode='L')
new:
semantic_img = plt.imread(join(semantic_dir, f.replace('rgb', 'classgt').replace('jpg', 'png')))
instance_img = rgb2gray(plt.imread(join(instance_dir, f.replace('rgb', 'instancegt').replace('jpg', 'png'))))
perhaps line 78-79:
old:
sp.toimage(semantic_rst, mode='L').save(out_semantic_filename)
sp.toimage(instance_rst, high=np.max(instance_rst), low=np.min(instance_rst), mode='I').save(out_instance_filename)
new:
Image.fromarray(semantic_rst, mode='L').save(out_semantic_filename)
Image.fromarray(instance_rst, mode='I').save(out_instance_filename)
The following function must be defined previously. The definition of the function is original in the following web page.
https://stackoverflow.com/questions/12201577/how-can-i-convert-an-rgb-image-into-grayscale-in-python
def rgb2gray(rgb):
r, g, b = rgb[:,:,0], rgb[:,:,1], rgb[:,:,2]
gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
return gray
Sincerely,
The text was updated successfully, but these errors were encountered: