Table of Contents
The project integrates an ONNX-based Face Detection CNN Model into a Windows-based Unity application by using Emgu CV Dnn module for inference.
The purpose of the project is to mainly show how to integrate Emgu CV (latest version) into an Unity application for FREE in 3 steps without buying Emgu CV v4.x in Unity Asset Store and how to interact with image data from a PC webcam.
The inference implementation of the ONNX model using Emgu CV was actually done in my previous project Face Detection on UWP using ONNX.
Project is built with
- Emgu.CV v4.5.1.4349
- Emgu.CV.Bitmap v4.5.1.4349
- Emgu.CV.runtime.windows v4.5.1.4349
- Unity v2020.3.12f1
-
Clone the repository and open project folder in Unity (Just click
Ignore
when it shows error) -
Install NuGet Package Manager
- Download and install NuGet for Unity here
- Close and reopen your Unity project
- Install Emgu CV in Unity
- In the menu of Unity, select NuGet > Manage NuGet Packages
- Search for
emgu
, installEmgu.CV
,Emgu.CV.runtime.windows
, andEmgu.CV.Bitmap
by Emgu Corporation
- Install
cvextern.dll
- Download Emgu CV here. Make sure the version is matched with Emgu CV in the previous step.
- After installing, go to folder
libs\x64
, i.e.C:\Emgu\emgucv-windesktop 4.5.1.4349\libs\x64
, copy filecvextern.dll
to theAssets\Plugins
folder in your Unity project
- Open
Assets\Scenes\SampleScene
and play app in Unity
Contributions make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/FeatureName
) - Commit your Changes (
git commit -m 'Add some FeatureName'
) - Push to the Branch (
git push origin feature/FeatureName
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Tung Dao - LinkedIn
Project Link: https://github.com/dao-duc-tung/face-detection-unity-emgucv-onnx