Giter Club home page Giter Club logo

detectron2_on_kitti's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

detectron2_on_kitti's Issues

Please cope with the new version of scipy

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,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.