zjc1013 / detectron2_on_kitti Goto Github PK
View Code? Open in Web Editor NEWDetectron2 Mask R-CNN Fine-tune on KITTI Semantics Dataset and Virtual KITTI 2 Dataset
License: MIT License
Detectron2 Mask R-CNN Fine-tune on KITTI Semantics Dataset and Virtual KITTI 2 Dataset
License: MIT License
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,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.