Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m-azra3l/facedetect
https://github.com/m-azra3l/facedetect
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/m-azra3l/facedetect
- Owner: m-azra3l
- Created: 2024-05-22T12:33:17.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-26T21:53:21.000Z (5 months ago)
- Last Synced: 2024-11-08T23:33:00.407Z (3 months ago)
- Language: Python
- Size: 35.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## SETUP :
_STEP 1 :_ Create a virtual environment in model folder
- Change working directory to model :
```bash
cd model
```- Install virtualenv package if it is not installed already :
```bash
pip install virtualenv
```- Create virtual environment :
```bash
virtualenv venv
```_STEP 2 :_ Activate virtual environment :
```bash
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
```py
pip install -r requirements.txt
```_STEP 4 :_ Run flask app
```bash
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 imageNOTE :
- 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.---
```py
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](images/first.jpeg)
### SAMPLE2 :
![seccond_image](images/second.jpeg)
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```py
threshold = 0.5
```---
- Original repo for pose-estimation-model 👉 [REPO_LINK](https://github.com/yinguobing/head-pose-estimation)
- Link for object detection model 👉 [MODEL_LINK](https://tfhub.dev/tensorflow/efficientdet/d0/1)