balancap / SSD-Tensorflow

Single Shot MultiBox Detector in TensorFlow
4.11k stars 1.89k forks source link

Labels #114

Open swetshaw opened 7 years ago

swetshaw commented 7 years ago

Can anyone please help me out where are the labels stored? ex1

Its says the objects belong to class 12 13 and 15. But how to know what classes these numbers denote to?

pierre-ecarlat commented 7 years ago

It depends on the dataset it has been trained on. Here, it is pascal VOC, so you can find the list of categories in the official documentation. And if you are lazy, here it is:

1 aeroplane 2 bicycle 3 bird 4 boat 5 bottle 6 bus 7 car 8 cat 9 chair 10 cow 11 diningtable 12 dog 13 horse 14 motorbike 15 person 16 pottedplant 17 sheep 18 sofa 19 train 20 tvmonitor

swetshaw commented 7 years ago

Thank you. @pierre-ecarlat

But what if we want to train it on our own dataset? How to create annotations like VOC?

pierre-ecarlat commented 7 years ago

For this framework, you have to use tfRecords data (the most common format used for tensorflow, you can find more info on them here). The simplest solution if you want to use your own dataset would be to create it in the exact same format as VOC, with images in the JPEGImages directory, and annotations in the Annotations directory (you also can download it to see how the xml are designed). Then, you will have to run this code, which is basically calling this one (feel free to check it to understand what it uses to create the tfRecords). The other (cleaner) solution, is to create your own datasets/youramazingdataset_to_tfrecords.py, and to make it read your annotations / images in the way they are. Good luck :)

swetshaw commented 7 years ago

Thank you so much for the explanation. It was helpful. :) @pierre-ecarlat

swetshaw commented 7 years ago

Everything was going well. I created my own dataset with the annotations file in exactly the same format as VOC2007.

Now my question is how to modify this code according to my dataset?