https://github.com/enoxsoftware/yolov5withopencvforunityexample
An example of using OpenCV dnn module with YOLOv5. (ObjectDetection, Segmentation, Classification)
https://github.com/enoxsoftware/yolov5withopencvforunityexample
dnn object-detection opencv unity unity3d-plugin yolo yolov5
Last synced: about 1 year ago
JSON representation
An example of using OpenCV dnn module with YOLOv5. (ObjectDetection, Segmentation, Classification)
- Host: GitHub
- URL: https://github.com/enoxsoftware/yolov5withopencvforunityexample
- Owner: EnoxSoftware
- License: agpl-3.0
- Created: 2023-01-31T13:11:15.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-09T19:50:14.000Z (over 2 years ago)
- Last Synced: 2024-03-15T04:51:57.517Z (over 2 years ago)
- Topics: dnn, object-detection, opencv, unity, unity3d-plugin, yolo, yolov5
- Language: Jupyter Notebook
- Homepage:
- Size: 258 MB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YOLOv5 With OpenCVForUnity Example
- An example of using OpenCV dnn module with YOLOv5. [https://github.com/ultralytics/yolov5](https://github.com/ultralytics/yolov5)
- This example can also work for [YOLOv6](https://github.com/meituan/YOLOv6), [YOLOv7](https://github.com/WongKinYiu/yolov7) models, which has the same input/output shapes as the YOLOv5 model.

## Environment
- Windows / Mac / Linux / WebGL / Android / iOS
- Unity >= 2021.3.35f1+
- Scripting backend MONO / IL2CPP
- [OpenCV for Unity](https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088?aid=1011l4ehR) 2.6.5+
## Setup
1. Download the latest release unitypackage. [YOLOv5WithOpenCVForUnityExample.unitypackage](https://github.com/EnoxSoftware/YOLOv5WithOpenCVForUnityExample/releases)
1. Create a new project. (YOLOv5WithOpenCVForUnityExample)
1. Import OpenCVForUnity.
1. Import the YOLOv5WithOpenCVForUnityExample.unitypackage.
1. Add the "Assets/YOLOv5WithOpenCVForUnityExample/*.unity" files to the "Scenes In Build" list in the "Build Settings" window.
1. Build and Deploy.
## Export YOLOv5 model to ONNX
1. [YOLOv5_export_to_OpenCVDNN_ONNX.ipynb](https://github.com/EnoxSoftware/YOLOv5WithOpenCVForUnityExample/tree/master/models/YOLOv5/YOLOv5_export_to_OpenCVDNN_ONNX.ipynb)
1. [YOLOv5_segment_export_to_OpenCVDNN_ONNX.ipynb](https://github.com/EnoxSoftware/YOLOv5WithOpenCVForUnityExample/tree/master/models/YOLOv5_segment/YOLOv5_segment_export_to_OpenCVDNN_ONNX.ipynb)
1. [YOLOv5_classify_export_to_OpenCVDNN_ONNX.ipynb](https://github.com/EnoxSoftware/YOLOv5WithOpenCVForUnityExample/tree/master/models/YOLOv5_classify/YOLOv5_classify_export_to_OpenCVDNN_ONNX.ipynb)
## Works with Multi-Object Tracking (MOT)
1. [MultiObjectTrackingExample](https://github.com/EnoxSoftware/OpenCVForUnity/tree/master/Assets/OpenCVForUnity/Examples/Advanced/MultiObjectTrackingExample)
## ScreenShot



## Tutorials
1. [How to Train YOLO v5 on a Custom Dataset](https://www.youtube.com/watch?v=MdF6x6ZmLAY)
2. [Example of custom training for dice roll detection](https://qiita.com/DiNOV-Tokyo/items/1333ff4a6d9b4b5b79c0)