mpitropov / cadc_devkit

A devkit for the Canadian Adverse Driving Conditions (CADC) dataset.
http://cadcd.uwaterloo.ca/
Other
149 stars 36 forks source link

Any way to convert the 3D annotations to 2D annotations? #17

Open ZiadElmassik opened 3 years ago

ZiadElmassik commented 3 years ago

Hello Mathew, I'm trying to convert the 3D annotations in the 3D_ann.json files into 2D annotations for training and testing a 2D detection algorithm called Faster R-CNN. Is it possible you can provide this? If not, are there any frameworks for converting 3D annotations into 2D annotations?

mpitropov commented 3 years ago

A previous student has created a kitti to cadc conversion script located here https://github.com/mathild7/faster_rcnn_pytorch_multimodal/blob/master/tools/cadc_unpack_all_kitti.py I plan on bringing this script over to this repo eventually with the addition of lidar occlusion.

I think you should also look at the whole repo since it uses Faster R-CNN https://github.com/mathild7/faster_rcnn_pytorch_multimodal but the repository has since been deprecated.

ZiadElmassik commented 3 years ago

Hello Mathew, thank you for your response. You said the repository was deprecated but is the conversion script still valid? If not, can you please help me modify it to make it applicable to the current format for CADCD?

mpitropov commented 3 years ago

The script is still valid since there have been no changes in the format of CADC. If there are issues with the conversion then you can post them here.

ZiadElmassik commented 3 years ago

I found a few issues, yes. One being that the test/val split was only 2.8% of the the train split so I modified the code to split the data set 50/50 similar to the KITTI dataset. I noticed some of the folders in the directory weren't referenced correctly for example, 'processed' instead of 'labeled' which is quite minor. There was also no generation of 2D annotations from 3D annotations which was desired as the CADCD has no ground truth for 2D detection algorithms (only 3D).

mpitropov commented 3 years ago

I could be missing something but I think this line outputs the 2D bounding box:

f.write('{:.1f} {:.1f} {:.1f} {:.1f} '.format(x_min_set, y_min_set, x_max_set, y_max_set)) #pixel https://github.com/mathild7/faster_rcnn_pytorch_multimodal/blob/3145d91cba5ec38769b76af8f6e118748876c280/tools/cadc_unpack_all_kitti.py#L403

ZiadElmassik commented 3 years ago

I think you may be right. I'll try commenting the next few lines such that a 2D ground truth can be generated. Thank you kindly, Mathew.