Commit
·
c29c2ec
1
Parent(s):
2e7f9cc
Add Small and Nano sizes of YOLO models version 8 and above
Browse files- Models/yolo11n.onnx +3 -0
- Models/yolo11s.onnx +3 -0
- Models/yolo12n.onnx +3 -0
- Models/yolo12s.onnx +3 -0
- Models/yolov8s.onnx +3 -0
- Models/yolov9s.onnx +3 -0
- Models/yolov9t.onnx +3 -0
- README.md +6 -5
- RunYOLO8n.cs → RunYOLO.cs +5 -5
- info.json +9 -2
Models/yolo11n.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0690c675a942f4dc4f463b3e4e89520117aeea3fd767784df2934705c91ed11b
|
| 3 |
+
size 5384988
|
Models/yolo11s.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58744f876fbfe4c5beb52c2421b29028da824f8eb93932440cdd2ccbba2bdac2
|
| 3 |
+
size 19040166
|
Models/yolo12n.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e317f39e7bc492e3ebd1217120c394f338b3504d2867c157eaf7ba0cdaf241be
|
| 3 |
+
size 5389057
|
Models/yolo12s.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c574540176cf1310a171fd3b0af3c844acc9e4f64f45a59482e5238bb47e76fc
|
| 3 |
+
size 18731306
|
Models/yolov8s.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77e21642dcbb60907a2ef5c54fba53114bc4110be8dc0aadc5f638dd5c274935
|
| 3 |
+
size 22445269
|
Models/yolov9s.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b88918c915573583869c664f4bc5510e61ffe3c9abfc46fff373af3db826c745
|
| 3 |
+
size 14638367
|
Models/yolov9t.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f204063b506f17c33c6806932618de0b228e90e0c4ae3152e6e480da8a25692d
|
| 3 |
+
size 4429860
|
README.md
CHANGED
|
@@ -2,16 +2,17 @@
|
|
| 2 |
library_name: unity-sentis
|
| 3 |
pipeline_tag: object-detection
|
| 4 |
---
|
| 5 |
-
#
|
| 6 |
|
| 7 |
-
[
|
|
|
|
| 8 |
|
| 9 |
## How to Use
|
| 10 |
|
| 11 |
-
* Create a new scene in Unity
|
| 12 |
* Install `com.unity.sentis` version `2.1.2` from the package manager;
|
| 13 |
-
* Add the `
|
| 14 |
-
* Drag the `Models
|
| 15 |
* Drag the `classes.txt` file into the `Classes Asset` field;
|
| 16 |
* Create a `GameObject > UI > Raw Image` object in the scene, set its width and height to 640, and link it as the `Display Image` field;
|
| 17 |
* Drag the `Border Texture.png` file into the `Border Texture` field;
|
|
|
|
| 2 |
library_name: unity-sentis
|
| 3 |
pipeline_tag: object-detection
|
| 4 |
---
|
| 5 |
+
# YOLOv8, YOLOv9, YOLO11, YOLO12 validated for Sentis 2.1.2 in Unity 6
|
| 6 |
|
| 7 |
+
[YOLO](https://docs.ultralytics.com/models/) is a real-time multi-object recognition model.
|
| 8 |
+
Small and Nano model sizes are included for YOLO version 8 and above (except version 10 which uses NMS-free approach).
|
| 9 |
|
| 10 |
## How to Use
|
| 11 |
|
| 12 |
+
* Create a new scene in Unity 6;
|
| 13 |
* Install `com.unity.sentis` version `2.1.2` from the package manager;
|
| 14 |
+
* Add the `RunYOLO.cs` script to the Main Camera;
|
| 15 |
+
* Drag an appropriate `.onnx` file from the `Models` folder into the `Model Asset` field;
|
| 16 |
* Drag the `classes.txt` file into the `Classes Asset` field;
|
| 17 |
* Create a `GameObject > UI > Raw Image` object in the scene, set its width and height to 640, and link it as the `Display Image` field;
|
| 18 |
* Drag the `Border Texture.png` file into the `Border Texture` field;
|
RunYOLO8n.cs → RunYOLO.cs
RENAMED
|
@@ -7,14 +7,14 @@ using System.IO;
|
|
| 7 |
using FF = Unity.Sentis.Functional;
|
| 8 |
|
| 9 |
/*
|
| 10 |
-
*
|
| 11 |
* ========================
|
| 12 |
*
|
| 13 |
* Place this script on the Main Camera and set the script parameters according to the tooltips.
|
| 14 |
*
|
| 15 |
*/
|
| 16 |
|
| 17 |
-
public class
|
| 18 |
{
|
| 19 |
[Tooltip("Drag a YOLO model .onnx file here")]
|
| 20 |
public ModelAsset modelAsset;
|
|
@@ -46,14 +46,14 @@ public class RunYOLO8n : MonoBehaviour
|
|
| 46 |
private const int imageWidth = 640;
|
| 47 |
private const int imageHeight = 640;
|
| 48 |
|
| 49 |
-
//The number of classes in the model
|
| 50 |
-
private const int numClasses = 80;
|
| 51 |
-
|
| 52 |
private VideoPlayer video;
|
| 53 |
|
| 54 |
List<GameObject> boxPool = new();
|
| 55 |
|
|
|
|
| 56 |
[SerializeField, Range(0, 1)] float iouThreshold = 0.5f;
|
|
|
|
|
|
|
| 57 |
[SerializeField, Range(0, 1)] float scoreThreshold = 0.5f;
|
| 58 |
|
| 59 |
Tensor<float> centersToCorners;
|
|
|
|
| 7 |
using FF = Unity.Sentis.Functional;
|
| 8 |
|
| 9 |
/*
|
| 10 |
+
* YOLO Inference Script
|
| 11 |
* ========================
|
| 12 |
*
|
| 13 |
* Place this script on the Main Camera and set the script parameters according to the tooltips.
|
| 14 |
*
|
| 15 |
*/
|
| 16 |
|
| 17 |
+
public class RunYOLO : MonoBehaviour
|
| 18 |
{
|
| 19 |
[Tooltip("Drag a YOLO model .onnx file here")]
|
| 20 |
public ModelAsset modelAsset;
|
|
|
|
| 46 |
private const int imageWidth = 640;
|
| 47 |
private const int imageHeight = 640;
|
| 48 |
|
|
|
|
|
|
|
|
|
|
| 49 |
private VideoPlayer video;
|
| 50 |
|
| 51 |
List<GameObject> boxPool = new();
|
| 52 |
|
| 53 |
+
[Tooltip("Intersection over union threshold used for non-maximum suppression")]
|
| 54 |
[SerializeField, Range(0, 1)] float iouThreshold = 0.5f;
|
| 55 |
+
|
| 56 |
+
[Tooltip("Confidence score threshold used for non-maximum suppression")]
|
| 57 |
[SerializeField, Range(0, 1)] float scoreThreshold = 0.5f;
|
| 58 |
|
| 59 |
Tensor<float> centersToCorners;
|
info.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
| 1 |
{
|
| 2 |
"code": [
|
| 3 |
-
"
|
| 4 |
],
|
| 5 |
"models": [
|
| 6 |
-
"yolov8n.onnx"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
],
|
| 8 |
"data": [
|
| 9 |
"classes.txt"
|
|
|
|
| 1 |
{
|
| 2 |
"code": [
|
| 3 |
+
"RunYOLO.cs"
|
| 4 |
],
|
| 5 |
"models": [
|
| 6 |
+
"yolov8n.onnx",
|
| 7 |
+
"yolov8s.onnx",
|
| 8 |
+
"yolov9t.onnx",
|
| 9 |
+
"yolov9s.onnx",
|
| 10 |
+
"yolo11n.onnx",
|
| 11 |
+
"yolo11s.onnx",
|
| 12 |
+
"yolo12n.onnx",
|
| 13 |
+
"yolo12s.onnx"
|
| 14 |
],
|
| 15 |
"data": [
|
| 16 |
"classes.txt"
|