Giter Club home page Giter Club logo

insightface_align_in_deepface's Introduction

InsightFace_align_in_DeepFace

By looking into the align process of deepface, we found it using simple method so that sometimes it cannot handle complex face detection & alignment (E.g One-side face detection & alignment), thus we tried to use the alignment from InsightFace and apply it into DeepFace. It only requries minor change of DeepFace source code, and we need this repo to maintain the alignment and the source code.

The represent() function in DeepFace does not take alignment as parameter, thus the modified DeepFace.py was proposed in this repository. You can use your own faces for testing by setting the alignment argument to False in DeepFace and importing modified DeepFace.py.

Install requirements

  pip install -r requirements.txt

import face align and get aligned face

  import face_align
  face_aligned = face_align.get_face_align(img_file)

import modified deepface

  import DeepFace
  #Turning off align in deepface, also remember to turn off detector.
  #analyze face
  arcanalyze = DeepFace.analyze(face_aligned, actions = ['age', 'gender', 'race', 'emotion'],detector_backend='skip',align=False)
  #face embedding(512*1 dim)
  arcrep = DeepFace.represent(face_aligned, model_name = 'ArcFace', model = None, enforce_detection = True, detector_backend = 'skip', align = False, normalization = 'base')

In test_align.ipynb, I made an demo showing the difference between InsightFace and DeepFace in face alignment.

If you have more question, please raise an issue.

Mafffia

insightface_align_in_deepface's People

Contributors

luffyye avatar mafffia avatar

Watchers

 avatar  avatar

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.