Search code examples
tensorflowobject-detection-api

Tensorflow: Does object detection API returns detected object id


I am using the tensorflow object detection api on windows system and it has been working fine. I am using the pre-trained model as of now which is ssd_mobilenet_v1_coco_11_06_2017. It is easily detecting all the objects in a given input video. I wanted to record time of each object so lets say, if in a video a car enters at 00:05 and leaves at 00:15 which means that it was in for 10secs.

To achieve this, I was looking if there is anything like id of each detected object which the API returns so that I can start a timer from the code to calculate the time of an object. Is there any already built functionality for this in the API.?


Solution

  • Tensorflow Object detection does not provide such functionality, but you can user KFC algorithm(easily available using Open CV) to track the object.

    https://www.docs.opencv.org/3.4.1/d2/dff/classcv_1_1TrackerKCF.html

    or You can implement SORT above object detection API which uses Kalman Filter but easy to integrate.

    https://github.com/abewley/sort/blob/master/sort.py