Looking for a simple way to convert the yolov3 model to detect a subset of the 80 objects.
For example: if you only want to find people in the image, is there a way to convert the yolo model so that it only looks for people? Will that make the model smaller and faster?
I would make this question myself in the future...glad you did it! ...will follow this thread closely!
@ngek Hi, have you found some solution ? I'm facing same problem right now :/
Only workaround so far is to just ignore the other results which has no impact on size or thruput.
I found this https://stackoverflow.com/questions/44674517/yolo-darknet-detecting-only-specific-class-like-person-cat-dog-etc?fbclid=IwAR0sAVq86GOqgFyDcgPnA_5kCB82j1bFELpJzvFRB2E_XG0TN8pC3gyRPVA
And i`m going to test it next week
Hi @mat-sop ..... did you eventually try to detect only one class using the YOLO darknet? .... How did it go? ..... Regards!
Hi @Vic-TheGreat I eventually trained new model with smaller layers based on original Yolo. It worked well, but it was a private project so it wasn`t tested in a real environment.
@mat-sop thanks for the proper solution i will try this and will post after try result on this blog.
There are 3 options you could opt for. 2 of which are done using training custom dataset. You could use an open source dataset online for these(Coco, OpenImages, Pascal, etc.) which have annotations in some format which you could then get converted to the required formats(.txt). Follow the repos' steps.
yolov3.weights format and the repo uses opencv to test it on new data. Since opencv has not yet added support to use NVIDIA GPUs, this might be really slow for videos and live streams. However you could consider seeing how to build opencv with CUDA hereAnd the third being the most straightforward and the simplest of all, using 'tensornets' developed by TaehoonLee. It is a python library that helps you choose the model and select the number of classes you would want your model to detect(in your case 1) from the 80 classes of the Coco Dataset.
Cheers! (Y)
@JasonACDsouza In your 3rd url (3. https://github.com/taehoonlee/tensornets)
Can you please kindly point me where it talks about selecting a single class(or preferred classes) in the read me. I went through the doc but couldn't find any mention of it.
@mat-sop thanks for the proper solution i will try this and will post after try result on this blog.
Any progress?
Thank you.
You can just read the annotation file and eliminate all those classes other than what you want to detect,using a simple python problem .
Hi @Vic-TheGreat I eventually trained new model with smaller layers based on original Yolo. It worked well, but it was a private project so it wasn`t tested in a real environment.
I wonder if the weight model size could be smaller for only 1 class ? In your case ?
Most helpful comment
There are 3 options you could opt for. 2 of which are done using training custom dataset. You could use an open source dataset online for these(Coco, OpenImages, Pascal, etc.) which have annotations in some format which you could then get converted to the required formats(.txt). Follow the repos' steps.
This repo does realtime computing(depending on the GPU you use) as it uses Tensorflow in the backend. You might need to tweak a few parameters here and there in the config.py file to get the desired results.
This is a pretty good repo. There is detailed instructions on how to use the darknet model and use it for training on a single class. The only problem with this method is, the final weights are stored as
yolov3.weightsformat and the repo usesopencvto test it on new data. Sinceopencvhas not yet added support to use NVIDIA GPUs, this might be really slow for videos and live streams. However you could consider seeing how to buildopencvwith CUDA hereAnd the third being the most straightforward and the simplest of all, using 'tensornets' developed by TaehoonLee. It is a python library that helps you choose the model and select the number of classes you would want your model to detect(in your case 1) from the 80 classes of the Coco Dataset.
Cheers! (Y)