Closed junho2000 closed 10 months ago
Which version of OpenCV (C++) do you use? I had several issues with Yolo C++ and ended up with a specific version of OpenCV: v4.7.0 (OpenCV v4.8+ did not work on my system: Jetson Orin AGX)
I am working on my laptop 4060 mobile ubuntu20.04, i installed OpenCV 4.8.0
Please send the model @eeuwevandijk
https://drive.google.com/file/d/13fV2zgIZAsq6ubgGY1CbQld6RmQIe3s_/view?usp=sharing this is my model(best.pt)
@eeuwevandijk OpenCV is not the issue here, I used version 4.8 and it worked fine for me with this model.
@junho2000
Your model does not have 12 classes like you mention, it has 9 classes:
That being said, my code does not read the classes automatically from the model. You need to manually specify them. You have two options.
1) Specify the classes using the --class-names
command line argument. So it would look like this: ./detect_object_image --model ./best.onnx --input ~/Desktop/sign.png --class-names crosswalk-sign highway-enterance-sign highway-exit-sign no-entry-road-sign one-way-road-sign parking-sign priority-sign round-about-sign stop-sign
2) Modify the class names in the code. You need to make the change here. Replace what's there with your 9 classes.
Once you make the change, the model works fine. Here is a sample output with your model:
@junho2000
Your model does not have 12 classes like you mention, it has 9 classes:
That being said, my code does not read the classes automatically from the model. You need to manually specify them. You have two options.
1) Specify the classes using the
--class-names
command line argument. So it would look like this:./detect_object_image --model ./best.onnx --input ~/Desktop/sign.png --class-names crosswalk-sign highway-enterance-sign highway-exit-sign no-entry-road-sign one-way-road-sign parking-sign priority-sign round-about-sign stop-sign
2) Modify the class names in the code. You need to make the change here. Replace what's there with your 9 classes.
Once you make the change, the model works fine. Here is a sample output with your model:
Thank you so much..!
Hi i tried both method (specify class name at CLI and revise yolov8.h class name) but still nothing detected, same happen
have you did extra thing to work fine?
What platform are you using? If you are running on a jetson, please check out the jetson branch.
i am using on my laptop with geforce 4060 mobile
Hi thank you for sharing your great work!
i am just curious that can i run executables with my custom trained model? my model has 12 class, not like coco dataset.
i export my best(yolov8n).pt model to onnx and then i run the detect_object_video then output is x,y, width, height are all 0 but only there is class name.
except for this everything works well!