MobileNet-SSD icon indicating copy to clipboard operation
MobileNet-SSD copied to clipboard

How to setup for object detection with only one class?

Open FSet89 opened this issue 5 years ago • 1 comments

I am trying to train a network from scratch on a database with just one class. My labelmap includes class 0 (none_of_the_above) and class 1 (my class). A couple of questions:

  • Should I specified 1 or 2 for num_classes, considering that I kept the 0?
  • Should I include images with only background? How to manage the xml annotation in this case?

FSet89 avatar Jul 24 '19 14:07 FSet89

you have to consider your actual classes + 1 for background. So, in your case, num_classes is 2. Background annotation is not needed in ssd as of negative samples do exist implicitly though. All region of your images that do not correspond to a bounding box is a "negative sample".

There are some exceptions to the above with different frameworks and implementations but here we are talking about caffe_ssd, so no background annotations are needed.

mentezar avatar Aug 19 '19 13:08 mentezar