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.
To perform the facial recognition we need some external librairies. These external librairies are listed below.
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 is a library for face recognition in OpenCV. You can get it from here : libfacerec
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
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
We'll use MySQLdb to communicate with database. You can download the librairy from here : MySQLdb
First, install Python(x, y). Before installing it, you have to desinstall existing Python installation in your system.
It's easy to install, you have just to open the file OpenCV-2.4.0_py27.exe and then follow the instructions.
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.
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.
You have just to open the MySQL-python-1.2.4b4.win32-py2.7.exe and follow the instructions.
-
Register as a Facebook developer here : Facebook developers
-
And then create a Facebook application here : Applications
-
After creating an app you'll get an app id and a secret key
-
After enter in this url address : Graph API Exlorer and copy the access token to the variable "oauth_access_token" in facerec.py
-
Dowload and install WAMP : Download WampServer We'll need it for managing the data base.
-
Open a browser and go to the url : localhost/phpmyadmin
-
Then create a database named : facerec
-
Change the values of "user" and "passwd" variable in dict_app.py to your database seeting
-
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
-
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.