Skip to content

Instantly share code, notes, and snippets.

@olokobayusuf
Created September 28, 2021 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olokobayusuf/68c7be7af3532a15e2aba0316c408481 to your computer and use it in GitHub Desktop.
Save olokobayusuf/68c7be7af3532a15e2aba0316c408481 to your computer and use it in GitHub Desktop.
// Fetch the MediaPipe BlazeFace model data from Hub
var modelData = await MLModelData.FromHub("@natsuite/blazeface");
// Deserialize the model
var model = modelData.Deserialize();
// Create a BlazeFace predictor
var predictor = new BlazeFacePredictor(model);
// Detect faces in an image
Texture2D image = ...;
Rect[] faces = predictor.Predict(image);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment