Giter VIP home page Giter VIP logo

insightface's Introduction

InsightFace for TFJS

TFJS port of InsightFace

Models

Repository contains pretrained TFJS graph models for the following InsightFace variations

  • human-faceres: included for reference, 6.7MB weights
  • human-mobilefacenet: included for reference, 5.0MB weights
  • insightface-mobilenet-emore: 6.7MB weights, 1.6ms avg
  • insightface-mobilenet-swish: 12MB weights, 3.0ms avg
  • insightface-ghostnet-strides1: 7.8MB weighs, 9.3ms avg
  • insightface-ghostnet-strides2: 7.7MB weights, 7.4ms avg
  • insightface-efficientnet-b0: 13MB weights, 9.8ms avg

Notes

  • Models have been quantized to F16 for size
  • All models take [1, 112, 112, 3] cropped and normalized [0..1] image of a face as input
    and produce as single float array as output which represents face embedding
  • Performance numbers are using RTX3060

Demo & Compare

Demo app in /src uses Human library to detect and crop faces from input images before running InsightFace models to calculate face descriptors (embeddings)

And yes, you can use any other face detection method

Sample Images

GitHub repository is void of sample images, beforing running demo place any number of images of any resolution containing one or more faces into /assets/samples/

Sample Screenshot

screenshot

Run

Use built-in dev server to compile sources and start a web server:

npm run dev

Credits

TBD

  • Optimize similarity in (%) from raw distance
  • Find best face.scale per model

insightface's People

Contributors

vladmandic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

insightface's Issues

I need some help with tensorflow.org/js object recognition

Here is a working sample code

https://github.com/mtrucc/react-ts-fpkqes

Here is the working model

https://github.com/mtrucc/react-ts-fpkqes/tree/main/public/mask_model

This is the model I trained myself and converted using the command, it doesn't work

https://github.com/mtrucc/react-ts-fpkqes/tree/main/public/mask_model2

You can switch models by modifying the path in the code

https://github.com/mtrucc/react-ts-fpkqes/blob/6cb2ce09f4c44673098749041244b0f998f8d8f4/src/components/mask.js#L35

Install tensorflowjs

!pip install tensorflowjs

Return

Successfully installed flatbuffers-1.12 gast-0.4.0 keras-2.9.0 packaging-20.9 protobuf-3.20.0 tensorboard-2.9.0 tensorflow-2.9.0 tensorflow-estimator-2.9.0 tensorflowjs-3.19.0

Here is my conversion command in colab

tensorflowjs_converter --input_format=tf_saved_model \
                        --output_format=tfjs_graph_model \
  /content/gdrive/MyDrive/customTF2/data/inference_graph/saved_model \
  /content/gdrive/MyDrive/customTF2/data/inference_graph/saved_model_js
I don't know where is the problem? If you need more details, I can add.

I don't know where is the problem? If you need more details, I can add.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.