Skip to content

wanghsinche/name-pls.js

Repository files navigation

Name-PLS.JS

node TypeScript onnx InsightFace

A ONNX Runtime backed Face-Recognition implementation for Node.js. You can easily replace the pre-train ONNX format file with your SOTA model to inter other IMAGE machine learning problems, include but not limited to face verification, recognition and object detection.

Name-PLS.JS

An online demo can be found at name-pls.com

2022-01-18-14-10-14-name-pls

Using InsightFace, sklearn and ONNX to extract feature and classify.

Thanks for Next.js and daisyui's awasome UI Lib.

Getting Started

First, run the development server:

# install dependencies
yarn add

# run the dev server, make sure your free memory is enough
yarn dev

Open http://localhost:3000 with your browser to see the result.

Besides, you can directly call the api/recog to recognize your image. In fact, it doesn't require a preprocessing.

To use your customized pre-train model, you can easily convert it into ONNX format and put it in services/recog/model. Be cautioned, you should modify the preprocessing method to make your input match your model.

The bayesian classifier was trained with Japanese actress face. To add more actress in the feature db, you can try the notebooks in /notebook folder.

How does it work

workflow

TO DO

  • Face detect and align module relies on faceapi.js, which is built on Tensorflow.js and causes high memory usage. It'd be better to replace this module with onnx runtime module.
  • The Node Canvas module has external c++ libray dependecies, which is unfriendly to deploy them on cloud platform such as vercel or aws lambda. Replacing it with Jimp to process image would be more compatible.
  • The feature extraction pre-trained model is still low precision (about 70%).

Releases

No releases published

Packages

No packages published