BMW-InnovationLab / BMW-YOLOv4-Inference-API-GPU

This is a repository for an nocode object detection inference API using the Yolov3 and Yolov4 Darknet framework.
BSD 3-Clause "New" or "Revised" License
281 stars 71 forks source link

Load Yolov3 Model #1

Closed naman-mehta closed 4 years ago

naman-mehta commented 4 years ago

Couln't find a way to load models, In the tutorial, it is shown that model path is name like dummy_5000, which directory it is going to search for dummy_5000. I also trained yolov3 using sample dataset to get all 5 files needed, but have no idea how to load them into inference.

naman-mehta commented 4 years ago

All 5 files needed I copied them inside test_model folder inside the models folder. I got this error while giving the model name as test_model in GET models/{modelname}/load. TypeError: Failed to fetch. What could be the issue. Thanks in advance.

AntoinenCharbel commented 4 years ago

First you should add your model folder(containing all 5 files) to the models folder. To make sure that you placed your model in the right place, try the GET /models endpoint that should return your folder name in the response. You can now try the GET /models/{model_name}/load endpoint by replacing {model_name} by your model folder name. If the error persists, try to enable CORS from the src/main/start.py script by uncommenting lines 26 to 32 (You should rebuild the docker image before you test again).

naman-mehta commented 4 years ago

Thankyou AntoinenCharbel for your clear explanation and quick reply. I got this error this directory is inside obj.data. I got this error. Couldn't open file: /training/custom_training/test1_20191218_10:33:43/config/obj.names So i provided the absolute directory starting with /home/..../trainings/ . Still i got the same kind of error Couldn't open file: /home/..../BMW-YOLOv3-Training-Automation/trainings/test1_20191218_10:33:43/config/obj.names Thanks in advance. I will surely try to enable CORS and let you know whether it works or not

AntoinenCharbel commented 4 years ago

To run the docker container, you are using "-v $(pwd)/models:/models". This command is mounting the models folder to the docker container, and inside the container, the models folder is located at /models. obj.data file should contain the following: classes= names=/models/{your_model_name}/obj.names

naman-mehta commented 4 years ago

Thankyou once again Antoinen for the complete understandable explanation. I am able to load the model now. I tried with one of the image in the sample Screenshot from 2019-12-20 14-02-43

So I decreased the NMS to 0.25 from 0.45. And it worked fine. Screenshot from 2019-12-20 14-32-29

I am closing this issue. Thanks for your time.