How to Set Up YOLO Tiny v7 in Unity Sentis Format

Apr 10, 2024 | Educational

Welcome to your guide on using YOLO Tiny v7 within the Unity Sentis framework! If you’re looking to implement real-time multi-object recognition in Unity 2023, you’ve come to the right place. This article will walk you through the necessary steps to get everything up and running, along with some helpful troubleshooting tips.

Getting Started: Prerequisites

Before you dive into the setup process, make sure you have the following:

  • Unity 2023 installed on your system.
  • The package com.unity.sentis available in your package manager.
  • The Unity UI package.

Step-by-Step Setup

Now, let’s get our hands dirty with the setup process!

  1. Create a new scene in Unity 2023.
  2. Install the package com.unity.sentis version 1.4.0-pre.3 through the package manager.
  3. Add a C# script to the Main Camera.
  4. Create a Raw Image in the scene and link it as displayImage.
  5. Place the yolov7-tiny.sentis file in the Assets/StreamingAssets folder.
  6. Add a video file to the Assets/StreamingAssets folder and set the videoName in the script to the filename of your video.
  7. Drag the classes.txt file onto the labelAssets field.
  8. Set the fields for the bounding box texture sprite and the font.

Visual Validation

If everything is set up correctly, you should see an interface similar to this:

![preview](preview.png)

Understanding YOLO Tiny v7 with an Analogy

Think of the YOLO Tiny v7 model as a highly trained security guard at a bustling shopping mall. With a keen sense to recognize different types of shoppers (the objects) and their movements (the video feed), this guard is trained to identify the most critical aspects of the scene efficiently.

In this analogy, Unity acts as the mall environment, providing the space where our guard operates, while the components like bounding box textures and fonts are the uniform and communication tools our guard uses to relay important information about observed activities (like a robbery happening or a lost child wandering).

Troubleshooting Ideas

If you encounter any issues during the setup, consider the following ideas:

  • Ensure that you’ve installed the correct version of the Sentis package (1.4.0-pre.3) as the prior version (1.3.0) is incompatible.
  • Check the paths of your asset files (yolov7-tiny.sentis, video files) to ensure they are in the Assets/StreamingAssets folder as stated.
  • If the display doesn’t show as expected, verify that the link between the Raw Image and displayImage as well as the bounding box textures is established correctly.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Additional Information

This version of YOLO Tiny v7 includes extra layers that help select the most likely bounding boxes. If you prefer a version without these extra layers, check out the YOLOv8n model.

What is Unity Sentis?

Unity Sentis is the robust inference engine that runs seamlessly in Unity 3D. For more in-depth information, you can visit here.

License Information

It’s worth noting that the license for YOLO models is GPLv3, so be sure to adhere to the guidelines if you’re planning to use these models for your projects.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox