Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YOLOV5 OpenCV C++ node #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add YOLOV5 OpenCV C++ node #3

wants to merge 6 commits into from

Conversation

leungjch
Copy link

@leungjch leungjch commented Mar 20, 2023

Runs YOLOV5 inference using OpenCV and C++. This is preferable on the Deepracer since OpenCV is pre-installed and using YOLO with Python would require installing pytorch/numpy/etc, which can easily take up > 8gb, which is difficult to manage with the Deepracer's 32gb storage limit.

To obtain the models, generate the ONNX / OpenVINO models from the export.py script here, or download them attached below, and place them under /perception_models/.
yolov5s_onnx.zip
yolov5s_openvino_model.zip

Update the launch file object_detection_launch.py:

  • For OpenVINO you must specify the path to yolov5s.bin as model_path, and path to yolov5s.xml in the model_config_path.
  • For ONNX you must specify the path to yolov5s.onnx as the model_path and specify an empty string "" in the model_config_path.

Launch the node with ros2 launch object_detection object_detection_launch.py

I observe around ~0.5fps when running with OpenVINO compared to ~0.3fps on ONNX. Perhaps there is some extra optimization we can do?

@leungjch leungjch changed the title Add YOLOV5 opencv c++ node Add YOLOV5 OpenCV C++ node Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants