theAIGuysCode / yolov3_deepsort

Object tracking implemented with YOLOv3, Deep Sort and Tensorflow.
GNU General Public License v3.0
337 stars 183 forks source link

How to Detect just 1 class? #13

Open its-charan-here opened 4 years ago

its-charan-here commented 4 years ago

I wanted to implement object tracker specifically for one class i.e 'Person'. Is there a way to restrict the number of classes to be detected? so that no extra computational power is used on detecting redundant objects in the input video. What changes should be made in object_detector.py file or detection.py file so that this is possible?

aafaqin commented 4 years ago

afaik I don't think there will be any reduction of computation power if you use the same weights! maybe you can retrain for only person. but still, in my opinion, it will not reduce the computational cost!

its-charan-here commented 4 years ago

@aafaqin okay! but instead of retraining can I just get the coordinates of objects of single class?

satyambharti171 commented 4 years ago

@its-charan-here Yeah you can do that, first train YoloV3 on person dataset, you may use Google Open Image Dataset or you may use COCO. Then keep the config and weights file then when using deepsort, modify coco.names file and keep only person here. Deep Sort is trained using person re-id dataset and it should work well on person. I want to implement this on custom objects like chair and all but I can't seem to get it, but for person it will work.

satyambharti171 commented 4 years ago

And yeah change the object tracker according to your class, change number of classes argument to 1, it should be 80 by default and you will be good to go.