8000 GitHub - xmyhhh/yolov5-unity: Unity Barracuda YOLOv5 Android app
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

xmyhhh/yolov5-unity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yolov5-unity

The C# project associated with the Unity project contains four files:

  1. Detector.cs

interface Detector with two provided methods, void Start(), a standard Unity method, IEnumerator Detect (Color32[] picture, int requestedWidth, SystemAction<IList> callback), which detects the objects from aa picture represented as an array of Color32.

class BoundingBoxDimensions with size and coordinates properties

class BoundingBox with the following properties: BoundingBoxDimensions Dimensions, string Label, float Confidence, Rect Rect

The reason of this file existence is that in future other kind of detector can be explored.

  1. GraphicsWorker.cs

Provides an only one static method IWorker GetWorker (Model model), which returns an instance of IWorker depending on a current platform and GPU availability

  1. PhoneCamera.cs

Contains class PhoneCamera: MonoBehaviour which gets all needed inputs from Unity, including box colors, background, detector, a prefab for box, a text field for FPS, and provides the following methods: void Start(), in which the texture from a camera is got and ratio for detecting frame is set, void Update(), where the input from camera is provided to the Detector, and the detection starts on each frame. Also, bounding boxes are redrawn here, and FPS is counted

  1. Yolov5Detector.cs

Contains class Yolov5Detector: MonoBehaviour, Detector, in which the detector’s parameters are handled, such as image size, number of classes, number of the model’s output rows, minimal confidence rate, limit of detectable objects, neural network model file and labels file.

It provides the following methods: void Start (), in which labels, a model and a worker are loaded, IEnumerator Detect (Color32[] picture, int requestedWidth, SystemAction<IList> callback), as described in the base Detect class

About

Unity Barracuda YOLOv5 Android app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

31E6
  • ShaderLab 73.4%
  • C# 13.8%
  • HLSL 12.8%
0