BlazeFace
MediaPipe BlazeFace for realtime face detection in Unity Engine with NatML.
Installing BlazeFace
Add the following items to your Unity project's Packages/manifest.json
:
{
"scopedRegistries": [
{
"name": "NatML",
"url": "https://registry.npmjs.com",
"scopes": ["ai.natml"]
}
],
"dependencies": {
"ai.natml.vision.blazeface": "1.0.7"
}
}
Detecting Faces in an Image
First, create the BlazeFace predictor:
var predictor = await BlazeFacePredictor.Create();
Then detect faces in the image:
Texture2D image = ...;
Rect[] faces = predictor.Predict(image);
Requirements
Quick Tips
Thank you very much!