Code Monkey home page Code Monkey logo

yolov5-unity's Introduction

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

yolov5-unity's People

Contributors

egor-ulianov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.