Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ai.natml.vision.ultraface

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai.natml.vision.ultraface

Ultra-light fast generic face detector.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22
decreased by-91.13%
Maintainers
1
Weekly downloads
 
Created
Source

UltraFace

Ultra-light Fast Generic Face Detector for high performance face detection.

Installing UltraFace

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.ultraface": "1.0.0"
  }
}

Detecting Faces in an Image

First, create the UltraFace predictor:

// Fetch the model data from NatML Hub
var modelData = await MLModelData.FromHub("@natsuite/ultraface");
// Deserialize the model
var model = modelData.Deserialize();
// Create the UltraFace predictor
var predictor = new UltraFacePredictor(model);

Then detect faces in the image:

// Create image feature
Texture2D image = ...;
var imageFeature = new MLImageFeature(image); // This also accepts a `Color32[]` or `byte[]`
(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!

Keywords

FAQs

Package last updated on 04 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc