• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Multi-view face recognition, face cropping and saving the cropped faces as new images on videos to create a multi-view face recognition database.

Recognize, Crop and Save Faces as Images From Video

For technical details check the related medium post! Please contact if you need professional face detection & recognition project with the super high accuracy.

QUICK DEMO

  • Faces are Tracking, Cropping and Saving as Images from Video

  • Images are Saving from Video With Appropriate Path Hierarchy

THEORY

If you want to investigate some aspect of facial recognition or facial detection. One thing you are going to want is a variety of faces that you can use for your system. You can create your own face detection/recognition database by this program. face_recognizer.py recognizes the faces from video, crop and save them as an image under appropriate path hierarchy.

Once we have acquired the face data, we’ll need to read it in our program. In the demo applications I have decided to read the images from a very simple CSV file. Why? Because it’s the simplest platform-independent approach I can think of. However, if you know a simpler solution please ping me about it. Basically all the CSV file needs to contain are lines composed of a filename followed by a ; followed by the label (as integer number), making up a line like this:

/path/to/image.ext;0

You don’t really want to create the CSV file by hand. I have prepared you a little Python script create_csv.py that automatically creates you a CSV file.

face_recognizer.py calls create_csv.py and it can save the output as a csv file so you will have your own face detection/recognition dataset.

INSTALLATION

1.) Python and pip

Python is automatically installed on Ubuntu. Take a moment to confirm (by issuing a python -V command) that one of the following Python versions is already installed on your system:

  • Python 2.7
  • Python 3.3+

The pip or pip3 package manager is usually installed on Ubuntu. Take a moment to confirm (by issuing a pip -V or pip3 -V command) that pip or pip3 is installed. We strongly recommend version 8.1 or higher of pip or pip3. If Version 8.1 or later is not installed, issue the following command, which will either install or upgrade to the latest pip version:

$ sudo apt-get install python-pip python-dev   # for Python 2.7
$ sudo apt-get install python3-pip python3-dev # for Python 3.n

2.) dlib

Install dlib prerequisites

The dlib library only has four primary prerequisites: Boost Boost.Python CMake X11/XQuartx

Installing CMake, Boost, Boost.Python, and X11 can be accomplished easily with apt-get :

$ sudo apt-get install build-essential cmake
$ sudo apt-get install libgtk-3-dev
$ sudo apt-get install libboost-all-dev

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py

Install dlib with Python bindings

The dlib library doesn’t have any real Python prerequisites, but if you plan on using dlib for any type of computer vision or image processing, I would recommend installing:

  • NumPy
  • SciPy
  • scikit-image

These packages can be installed via pip :

$ pip install numpy
$ pip install scipy
$ pip install scikit-image

Years ago, we had to compile dlib manually from source (similar to how we install OpenCV). However, we can now use pip to install dlib as well:

$ pip install dlib

3.) face_recognition 1.2.1

In this project, Adam Geitgey's face recognition system (thanks a lot to Adam) was used for face recognition and it can be installed by pypi using pip3 (or pip2 for Python 2):

pip3 install face_recognition

USAGE

Just run face_recognizer.py

The default file paths are specified already, change them with yours. (edit the line 17, line 20, line 80, line 89 in face_recognizer.py)

  • The sample database and dataset can be found at here

CITATION

If you use this code for your publications, please cite it as:

@ONLINE{frc,
    author = "Ahmet Özlü",
    title  = "Face Database Creator",
    year   = "2017",
    url    = "https://github.com/ahmetozlu/face_recognition_crop"
}

AUTHOR

Ahmet Özlü

LICENSE

This system is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

tensorflow_object_counting_api

🚀 The TensorFlow Object Counting API is an open source framework built on top of TensorFlow and Keras that makes it easy to develop object counting systems!
Python
1,305
star
2

vehicle_counting_tensorflow

🚘 "MORE THAN VEHICLE COUNTING!" This project provides prediction for speed, color and size of the vehicles with TensorFlow Object Counting API.
Python
851
star
3

signature_extractor

A super lightweight image processing algorithm for detection and extraction of overlapped handwritten signatures on scanned documents using OpenCV and scikit-image.
Python
414
star
4

color_recognition

🎨 Color recognition & classification & detection on webcam stream / on video / on single image using K-Nearest Neighbors (KNN) is trained with color histogram features by OpenCV.
Python
301
star
5

augmented_reality

💎 "Marker-less Augmented Reality" with OpenCV and OpenGL.
C++
204
star
6

defi_yield_farming

🚜 🌾 A DeFi app, which provides staking & farming functions are deploy-able with a website, for yield farming.
JavaScript
142
star
7

vehicle_counting

Vehicle detection, tracking and counting by blob detection with OpenCV on c++.
C++
116
star
8

vehicle_counting_hog_svm

Vehicle detection, tracking and counting by SVM is trained with HOG features using OpenCV on c++.
C++
96
star
9

aipa

AIPA (A.I. Personal Assistant): Speech, Vision, Machine Learning and IoT based intelligent personal assistant for Ubuntu based Linux distributions.
Python
48
star
10

real_time_circle_detection_android

Real time circle detection and tracking by Hough Circle Transform with OpenCV on Android OS.
Java
44
star
11

human_computer_interaction

Fist, palm and hand detection & tracking for intelligent human-computer interaction game character movement control with OpenCV on Java (Processing sketchbook).
Processing
44
star
12

unity_calendar_ui

This is a well defined-basic "Calendar UI" for Unity.
C#
24
star
13

arlo_traffic_analysis

Vehicle detection, tracking, counting and speed prediction on videos with OpenCV.
Python
19
star
14

nonlinear_regression_keras

Training of a neural network for nonlinear regression prediction with TensorFlow and Keras API.
Jupyter Notebook
15
star
15

tcp_socket_programming_android_client

TCP Socket Programming implementation of client side on Android.
Java
12
star
16

decentralized_banking_system

🏦 Decentralized banking system is a DApp built on Ethereum blockchain with smart contract on solidity.
Solidity
9
star
17

object_detection_chooch

A sample project for super fast real time object detection and counting using CHOOCH AI API and OpenCV.
Python
9
star
18

smart_contract_helloworld

🔥 Smart contract hello world tutorial: write and deploy your first Ethereum smart contract!
Solidity
9
star
19

unity_camera_movements

"Main Camera" movements scripts for Unity (for Desktop and Gear VR platforms).
C#
8
star
20

tcp_socket_programming_c_server

TCP Socket Programming implementation of server side in c programming language.
C
8
star
21

the_smart_contract_burger_store

🍔 🍟 A real life case study for developing Ethereum smart contract for businesses: Building a smart contract to manage a burger store.
JavaScript
8
star
22

tensorflow_blob_analysis

A sample project to perform blob analysis on images with TensorFlow and Keras to detect blobs and analyze their shape features such as the presence, number, area, position, length, and direction of lumps.
Python
8
star
23

family_tree_warehouse_app

Ask relation, add/delete/update person, get information of any person, print the family tree, control under 18 age marriage and more...
Python
7
star
24

EncryptedMessengerApplication

Encrypted Messenger App: Sending and receiving messages (over TCP Socket) with high security (powered by RSA and AES).
Java
5
star
25

android_power_monitor

🔋 Android power monitor hardware with Arduino.
C++
4
star
26

java_native_interface

Java Native Interface to call "Java Code" from "C++ Program".
C++
3
star
27

family_tree

Ask relation, add/delete/update person, get information of any person, print the family tree, control under 18 age marriage and more...
Prolog
3
star
28

pattern_matching

Implementation and performance comparison of Boyer Moore, Horspool and Brute Force in c programming language.
C
1
star
29

ahmetozlu.github.io

1
star
30

ethereum-smart-contract-samples

💡 Small smart contract examples to understand basics and some details of developing Ethereum smart contracts!
Solidity
1
star
31

SimpleShell

This program is about a simple shell. The shell accepts user commands and then executes each command in a separate process.
C
1
star
32

sample_spring_microservice_case_study

🦅 An inventory management project for providing a sample microservice case study which contains Spring Cloud Eureka server & client, feign client, error handling & fault tolerance, API gateway, Spring Actuator, distributed log trace with Zipkin, centralized configuration and vault integration with Spring Cloud Config.
Java
1
star