1.0.0 • Published 2 years ago

ai.natml.vision.dbface v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

DBFace

DBFace face detection.

Detecting Faces in an Image

First, create the DBFace predictor:

// Fetch the model data from NatML
var modelData = await MLModelData.FromHub("@natsuite/dbface");
// Deserialize the model
var model = modelData.Deserialize();
// Create the DBFace predictor
var predictor = new DBFacePredictor(model);

Then detect faces in the image:

// Create image feature
Texture2D image = ...;
var imageFeature = new MLImageFeature(image);
(imageFeature.mean, imageFeature.std) = modelData.normalization;
imageFeature.aspectMode = modelData.aspectMode;
// Detect faces
Rect[] faces = predictor.Predict(imageFeature);

Requirements

  • Unity 2021.2+

Quick Tips

Thank you very much!