Coder Social home page Coder Social logo

look4face's Introduction

Look4Face

Demo of Face Recognition web service.


One face

Briefly

  • The web wrapper is implemented using Django 2.2.
  • LFW is used as a main dataset.
  • PyTorch for working with neural networks.
  • Faiss for ANN search + vector quantization.
  • ResNet50 pretrained on MS1M-Arcface.
  • For Linux and Mac OS.

Multiple faces


Easy using with Docker

  1. Build image from Dockerfile
$ docker build -t l4fimage .
  1. Run container as daemon and expose 8000 port
$ docker run -d --name look4face -p 8000:8000 l4fimage

Installation

If you have CUDA installed, all calculations will be performed on the GPU, otherwise - on the CPU.

  1. Install Git-LFS

  2. Clone this repository and load LFS objects:

$ git init .
$ git clone https://github.com/sankovalev/Look4Face.git
$ git lfs install
$ git lfs pull
  1. Create virtualenv and activate it:
$ virtualenv -p python3 Look4Face
$ cd Look4Face
$ source bin/activate
  1. Make sure that you are using python3 & pip3 from virtual environment:
$ which python3
$ which pip3
  1. Install all requirements:
$ pip3 install -r requirements.txt
  1. Start web server
$ cd Look4Face
$ python3 manage.py runserver
  1. Open 127.0.0.1:8000 with browser.

Installation issues

If you receive an error related to Faiss, please visit this link and install additional packages.

Useful links

Repo Link
face.evoLVe.PyTorch https://github.com/ZhaoJ9014/face.evoLVe.PyTorch
facenet_pytorch https://github.com/liorshk/facenet_pytorch
arcface-pytorch https://github.com/ronghuaiyang/arcface-pytorch
insightface https://github.com/deepinsight/insightface
sudo docker build -t l4fimage .

How to use with other data

I strongly recommend to use the face.evoLVe.PyTorch repository for train your own models.

  1. Put your dataset to Look4Face/datasets with structure:
  Look4Face/datasets/your_db/
                      -> id1/
                          -> 1.jpg
                          -> ...
                      -> id2/
                          -> 1.jpg
                          -> ...
                      -> ...
                          -> ...
                          -> ...

and set variable in Look4Face/Look4Face/settings.py:

DATASET_FOLDER = 'your_db'
  1. Similarly, put your Faiss index and meta information for labels (dict with pairs id:PersonName) to the same folder, set variables:
DATASET_INDEX = 'your_index.bin'
DATASET_LABELS = 'your_labels.pkl'
  1. Update Backbone.pth if you need:
  Look4Face/backbone/
                     -> your_backbone.pth

and set variable in Look4Face/Look4Face/settings.py:

BACKBONE_FILE = 'your_backbone.pth'

Todos

  • Write notification if there are no faces on photo.
  • Write tutorial about using own dataset.

License

MIT

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.