• Latest News

    Thursday, 28 December 2017

    Smart Face Recognition System using Python & PHP build with dlib 99.38% accurate

    The objective of this project is to build smart face recognition system that can be easily implemented from multiple clients Android, Web App & using IP Cameras real-time wireless face recognition can be achieved in ATMs,  banks, offices etc. The main idea is to create a backend python server & service that will process the bank API and predict the confidence of image provided. Further, the results will be sent back again to bank API with the confidence of prediction.

    *Ignore SSL Error: Chrome: (Advance-Proceed Unsafe) Firefox: (Add Exception-Allow Security Certificate)

    Read this post for jumpstart:

    How to install face_recognition?


    How to configure LAMP & SSL?

    • 1. Install LAMP:
    • sudo apt-get install apache2
      sudo apt-get install libapache2-mod-php
    • 2. SSL is required when you are trying to access devices from browsers like chrome. Install OpenSSL: 
    • sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt
    • sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
    • 3. Configure your IP details in the default config for SSL check the link.
    • 4. Don't forget to allow SSL in your firewall ufw.
    • 5. Assign static IP to your server, also you can get your DNS free from here:
    • 6. Now, you can browse your server from https://<YOUR_IP> or DNS if mapped. You will get alert from browsers for your self-signed SSL because your organization is not authorized to provide SSL to resolve this you can buy 3rd party SSLs or buy authorization online.

    Configure Code- SmartFaceRecognition

    • register.php:  Simple javascript that contains front-end restrictions for file upload. This will upload an image with the adhar_id name & save to known_people directory.
    • login.php: Initialize camera from the device & onclick of capture button save the image to unknown_people directory. Onlclick of login button executes that will do the face recognition & return image name: adhar_id from known_people directory then session for adhar_id is set to do the profile stuff. After recognition, it deletes unknown.jpg file to avoid conflicts with multi-user usage.

    • profile.php: Get the session adhar_id then you can connect to your HRM database & do whatever profiling you want.
    • 1. Buy repository:
    • 2. Unzip
    • 3. Copy to www: sudo cp -R  smartfacerecognition /var/www/html
    • 4. Change permission of folder to write also for files to be uploaded & stored in you known_people & unknown_people directories: 
    • cd /var/www/html
    • sudo chmod -R 777 smartfacerecognition

    Now, you can test your fully-functional Smart FaceRecognition System from Android or any device. This can be easily added to any API calls or backend-service you are trying to build.

    You can create .iso of your server & share the fully configured package with anyone or run on your Windows System using Vmware/VirtualBox, read this post:

    Read Detailed Report:

    Credits: Mayuresh
    • Blogger Comments
    • Facebook Comments


    Post a Comment

    Thanks for your comment. We will try to reply as soon as possible.

    VSL Creations

    Item Reviewed: Smart Face Recognition System using Python & PHP build with dlib 99.38% accurate Rating: 5 Reviewed By: Vishal Aditya
    Scroll to Top