ai.natml.vision.dbface

1.0.0 • Public • Published

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!

Package Sidebar

Install

npm i ai.natml.vision.dbface

Weekly Downloads

402

Version

1.0.0

License

MIT

Unpacked Size

8.72 kB

Total Files

13

Last publish

Collaborators

  • olokobayusuf