Skip to content

Instantly share code, notes, and snippets.

@keijiro
Last active February 9, 2021 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keijiro/d2cd634feab453846152ff8b10e8be37 to your computer and use it in GitHub Desktop.
Save keijiro/d2cd634feab453846152ff8b10e8be37 to your computer and use it in GitHub Desktop.

TinyYOLOv2Barracuda

gif gif

TinyYOLOv2Barracuda is a Unity sample project that shows how to run the YOLO object detection system on the Unity Barracuda neural network inference library.

This project uses a Tiny YOLOv2 model from ONNX Model Zoo. See the model description page for details.

System requirements

  • Unity 2020.2
  • Barracuda 1.3.0

How to run

This repository doesn't contain the ONNX model file to avoid hitting the storage quota. Download the model file from the ONNX Model Zoo page and put it in the Assets/ONNX directory.

Sample scenes

WebcamTestGpu

WebcamTestGpu runs all the object detection & visualization processes (preprocess, inference, post-process, overlap removal, and visualization) solely on GPU. It minimizes the CPU load and visualization latency, but you can't do anything more complicated than simple visualization like drawing rectangles or something on detected objects.

WebcamTestCpu

WebcamTestCpu runs the object detection on GPU and then reads the detection results back to the CPU side. After that, it visualizes them using the Unity UI system. Even though this method runs slower than the GPU-only method, you can do complex processes using C# scripting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment