Giter VIP home page Giter VIP logo

facereg's Introduction

facereg

https://pepy.tech/badge/facereg

facereg is a module for face recognition with OpenCV and Deep Learning.

For now it can be used for just images. It is easy to use with a handy feature which downloads images from Google for you with given keywords to create dataset/s.

Uses two different technics CNN and HoG for recognition based on dlib's face recognition system with using face_recognition. facereg has totally three different layers and only recognizer has connection on encoder.

image_layers

Prerequisites

  • CMake
  • All dependencies are listed on requirements.txt and will be installed when you install with pip.

Installation

  • Install module using pip:

    $ pip install facereg
    
  • Download the latest facereg library from: https://github.com/verifid/facereg and install module using pip:

    $ pip install -e .
    
  • Extract the source distribution and run:

    $ python setup.py build
    $ python setup.py install
    

Usage

  • google_images:
import os
from facereg import google_images

output_directory = os.getcwd() + '/datasets' # directory path where you want to save photos
image_paths = google_images.download('michael jordan', limit=3)
  • face_encoder:
import os
from facereg import face_encoder

datasets_path = os.getcwd() + '/datasets'
encodings_path = os.path.dirname(os.path.realpath(__file__)) + '/encodings.pickle'
# these are default values for this method
face_encoder.encode_faces(datasets=datasets_path, encodings=encodings_path, detection_method='cnn')
  • recognize_faces:
from facereg import recognize_faces

image_path = 'DIRECTORY PATH OF YOUR_IMAGE'
names = recognize_faces.recognize(image_path)
# returns found names from your datasets

CLI Usage

  • Download images
# -d: keyword, -l: limit
$ python -m facereg -d 'michael jordan'
$ python -m facereg -d 'michael jordan' -l 5
  • Recognition
# -i: Directory path for image
$ python -m facereg -i tests/resources/michael_jordan.jpeg

Sample Result

image_sample

facereg's People

Contributors

abdullahselek avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mb140

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.