Philipp Siedler
Philipp Siedler

Reputation: 87

tensorflowjs object detection coco ssd config file max_total_detections explanation

can someone quickly explain or confirm my guess on what i.e.:

max_detections_per_class: 100
max_total_detections: 100

in my case ssdlite_mobilenet_v2_coco.config

at line 134 and 135.

From the raw output of predictions, my guess is that the predictions always "tries" to detect 100 objects in the image, despite the actual number of objects in the image. Let's say there is only one cat, there still will be 100 objects detected in my returning raw prediction data. If the model is trained right, of course there should be only one prediction with a high score.

Is that correct? Thank you!

Upvotes: 0

Views: 744

Answers (1)

Dinis Rodrigues
Dinis Rodrigues

Reputation: 605

Yes you are correct. It will try to detect 100 objects.

Those 100 detections will be then classified, where only one should be correctly identified as a cat. But it also depends on your Non Max Supression config. If NMS has a low score threshold and a high IoU, it can show multiple detections for the cat (overlapped detections I mean).

You can mess with those values, but from the published papers, the number max detections per image should always be more ~3x more than the actual objects in the image.

In my experience I obtain better results leaving it as is, even if in my data I has less objects in the image (eg 1 per image).

Upvotes: 1

Related Questions