Giter VIP home page Giter VIP logo

facedetect's Introduction

SETUP :

STEP 1 : Create a virtual environment in model folder

  • Change working directory to model :
cd model
  • Install virtualenv package if it is not installed already :
pip install virtualenv
  • Create virtual environment :
virtualenv venv

STEP 2 : Activate virtual environment :

venv\Scripts\activate

source venv/bin/activate

This command need administrative permissions. Use command prompt to execute this Will not work in powershell

STEP 3 : Install required libraries

pip install -r requirements.txt

STEP 4 : Run flask app

python app.py

After this the api will be up and running on : localhost:8080 You can now give api calls from react frontend.

API ROUTES :

  1. '/predict_pose' : To predict head pose
  2. '/predict_people' : To predict number of people in input image

NOTE :

  • Both of these function takes as input a b64 encoded string which is sent via react webcam.
  • For testing purposes you will find a sample encoded string of foward pose image given below in sample_input.txt file .
  • Here we are detecting only 3 directions (forward, left , right) because that is all we need.
  • The number of detected directions can be increased.
  • To detect more directions go to draw annotations function in pose_estimator.py file and elif conditions for more angles.

if angles[1] < -15:
    GAZE = "Looking: Left"
elif angles[1] > 15:
    GAZE = "Looking: Right"
else:
    GAZE = "Forward"

Results of crowd couting model :

SAMPLE1 :

first_image

SAMPLE2 :

seccond_image

NOTE :

The number of people detected can be changed via lowering the threshold To do that go to predict funtion in app.py and change the variable threshold Our default value is 0.5

threshold = 0.5

  • Original repo for pose-estimation-model ๐Ÿ‘‰ REPO_LINK
  • Link for object detection model ๐Ÿ‘‰ MODEL_LINK

facedetect's People

Contributors

m-azra3l avatar madesina avatar

Watchers

 avatar

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.