Git Product home page Git Product logo

faceidlight's Introduction

FaceIDLight

Code style: black Contributors Last Commit License Downloads CI testing

๐Ÿ“˜ Description

A lightweight face-recognition toolbox and pipeline based on tensorflow-lite with MTCNN-Face-Detection and ArcFace-Face-Recognition. No need to install complete tensorflow, tflite-runtime is enough. All tools are using CPU only.

Pull request are welcome!

โšก๏ธ Features

  • Online Face-Recognition
  • Running completely on CPU
  • Multi Faces
  • ~4 FPS on a MacBookPro2015
  • Tools for Face-Detection, -Verification and Identification

โœ… ToDos

  • GPU support
  • Resolution-dependent model-selection
  • Multithreading for multiple faces
  • Fix bug installing with setup.py (not finding external url for tflite-runtime)
  • OpenCV Window freezes on MacOS when quitting (seemed to be fixed)

๐Ÿฅฃ Requirements

โš™๏ธ How to install the FaceIDLight as a package

Simply install the package via pip from git:

pip3 install git+https://github.com/martlgap/FaceIDLight

or if you do not have git installed on your system, install it directly from the wheel:

pip3 install https://github.com/Martlgap/FaceIDLight/releases/download/v.0.1/FaceIDLight-0.1-py3-none-any.whl

โš™๏ธ How to use the FaceIDLight as Repo

Clone the repository, init a virtual environment and install the requirements:

git clone https://github.com/Martlgap/FaceIDLight.git
cd FaceIDLight
python3.8 -m venv venv
pip3 install -r requirements.txt

โš™๏ธ How to install tflite-runtime

If you have troubles to install tflite-runtime:

You can easily install tflite-runtime from https://google-coral.github.io/py-repo/ with the following line:

pip3 install tflite-runtime==2.5.0.post1 --find-links https://google-coral.github.io/py-repo/tflite-runtime

๐Ÿš€ Run Demo:

Run Python 3.8 and type in:

from FaceIDLight.demo import Demonstrator
Demonstrator().run()

You can select your own directory for gallery-images (*.png and *.jpg images are supported) by simply add a keyword argument to the Demonstrator Class: Demonstrator(gal_dir=<full-path-to-your-gallery>)

You might change the webcam address ID. Do so via selecting a certain number for stream id: Demonstrator(stream_id=<-1, 0, 1, 2, ...>)

Test the face-identification by simply holding a foto into camera. The provided sample_gallery includes images from: (Andrew_Caldecott, Anja_Paerson, Choi_Sung-hong, Elizabeth_Schumacher, Eva_Amurri, Jim_OBrien, Raul_Ibanez, Rubens_Barrichello, Takahiro_Mori)

Press "q" to close the Demo. (Window has to be selected)

๐Ÿ“บ Example

This image shows an example of the Demonstrator(): example_image

๐Ÿ™ Acknowledgement

๐Ÿ“š BibTex

If you use our trained models and want to cite our work feel free to use this: Image Resolution Susceptibility of Face Recognition Models

@inproceedings{Knoche2021ImageRS,
title={Image Resolution Susceptibility of Face Recognition Models},
author={Martin Knoche and Stefan Hormann and Gerhard Rigoll},
year={2021}
}

faceidlight's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar martlgap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

faceidlight's Issues

issue with customized gallery

Hi, when I was trying to run your demo with
from FaceIDLight.demo import Demonstrator
Demonstrator(gal_dir=).run()

this error would show up:
Python 3.8.18 (default, Sep 11 2023, 08:17:33)
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

from FaceIDLight.demo import Demonstrator
Demonstrator(gal_dir='./proj1_gallary').run()
Traceback (most recent call last):
File "", line 1, in
File "/opt/anaconda3/envs/ee4208_proj1/lib/python3.8/site-packages/FaceIDLight/demo.py", line 38, in init
self.FaceID = FaceID(gal_dir=gal_dir)
File "/opt/anaconda3/envs/ee4208_proj1/lib/python3.8/site-packages/FaceIDLight/tools.py", line 62, in init
self.update_gallery()
File "/opt/anaconda3/envs/ee4208_proj1/lib/python3.8/site-packages/FaceIDLight/tools.py", line 81, in update_gallery
self.gal_embs = self.recognizer.get_emb(np.asarray(self.gal_faces))[0]
File "/opt/anaconda3/envs/ee4208_proj1/lib/python3.8/site-packages/FaceIDLight/tools.py", line 144, in get_emb
return tflite_inference(self.face_recognizer, img)
File "/opt/anaconda3/envs/ee4208_proj1/lib/python3.8/site-packages/FaceIDLight/tools.py", line 120, in tflite_inference
model.allocate_tensors()
File "/opt/anaconda3/envs/ee4208_proj1/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 259, in allocate_tensors
return self._interpreter.AllocateTensors()
RuntimeError: external/org_tensorflow/tensorflow/lite/kernels/pad.cc:79 SizeOfDimension(op_context->paddings, 0) != op_context->dims (4 != 1)Node number 0 (PAD) failed to prepare.

Can I ask how to address this issue? I've checked the path to the galley folder is correct.

Acurracy is pretty low

face bounding detections are inaccurate and cannot able to extract features from some images, and why the models are downloading everytime

try to fix this

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.