Facial Recognition Script - puchka/pyFBfriendsFacerec GitHub Wiki

It's a script intending to perform facial recognition. The script constantly process through pictures on facebook and twitter logging the names and pictures that correlate to them. The information is placed into an SQL database where it will be accessed as needed. At a later date, we should be able to find all references to an individuals based upon what the script has cataloged, if we type in a name or if we have a match to the facial recognition algorithm. The script is written in Python.


Librairies

To perform the facial recognition we need some external librairies. These external librairies are listed below.

Python(x, y)

This script need several librairies which require complex installation. For preoccupation of simplicity we have first to install Python(x, y) which is a librairy that contain many librairies that we'll need. You can find it here : Python(x,y)

libfacerec

libfacerec is a library for face recognition in OpenCV. You can get it from here : libfacerec

OpenCV

OpenCV is a powerful librairy for image processing. We'll need it to perform face detection in image from Facebook. download OpenCV for Python here : OpenCV for Python

Facebook SDK

This client library is designed to support the "Facebook Graph API". We'll use it to grab information about the subject.
You can get it here : Facebook SDK

MySQLdb

We'll use MySQLdb to communicate with database. You can download the librairy from here : MySQLdb


Installation

Python(x, y)

First, install Python(x, y). Before installing it, you have to desinstall existing Python installation in your system.

OpenCV

It's easy to install, you have just to open the file OpenCV-2.4.0_py27.exe and then follow the instructions.

Facebook SDK

You have to extract the .zip that you've downloaded. After you have to enter in console mode and move to the directory where you extracted it. After you have to do this command : python setup.py install
This command will install the Facebook SDK.

libfacerec

You have just to extract the libfacerec-master.zip in the directory where you put your script.

For this first version we don't need. I'm working on the appropriate algorithme for comparing two faces.

MySQLdb

You have just to open the MySQL-python-1.2.4b4.win32-py2.7.exe and follow the instructions.

Steps

  1. Register as a Facebook developer here : Facebook developers

  2. And then create a Facebook application here : Applications

  3. After creating an app you'll get an app id and a secret key

  4. After enter in this url address : Graph API Exlorer and copy the access token to the variable "oauth_access_token" in facerec.py

  5. Dowload and install WAMP : Download WampServer We'll need it for managing the data base.

  6. Open a browser and go to the url : localhost/phpmyadmin

  7. Then create a database named : facerec

  8. Change the values of "user" and "passwd" variable in dict_app.py to your database seeting

  9. Then, enter in command line and move to the directory which contain the root directory and execute the python script create_tables.py by executing this command line : python create_tables.py

  10. After, run the main script with this command line python facerec.py

It will grab all names and photos of your buddies and store it in the "friends" MySQL table in the facerec database. All faces in the image files will be stored in images/face and the photos will be stored in images/photo.

⚠️ **GitHub.com Fallback** ⚠️