Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A basic face detection python program. Use frame images for motion detection to count people.

srleohung/facecounter

Repository files navigation

Face Counter

The package attempts to count faces using face detection and motion detection. It will be used on vending machines to calculate product attention and get traffic at that location.

Install

pip install -r requirements.txt
# Need to download models when using real-time pose estimation.
bash model_download.sh

Usage

Real-time Face Counter

Use face_counter.py -

python face_counter.py

Real-time Motion Detection

Use motion_detection.py

python motion_detection.py

Real-time Transparent Background

Use transparent.py

python transparent.py

Real-time Object Detection

Use object_detection.py

python object_detection.py --prototxt data/MobileNetSSD/MobileNetSSD_deploy.prototxt.txt --model data/MobileNetSSD/MobileNetSSD_deploy.caffemodel

Calibrate Wide-angle Camera

Use calibrate_camera.py

python calibrate_camera.py

Wide-angle Repair

Use wide_angle_repair.py

python wide_angle_repair.py

Real-time Pose Estimation

Use pose_estimation.py

  • MPI pretrained model
python pose_estimation.py --proto data/mpi/pose_deploy_linevec_faster_4_stages.prototxt  --model data/mpi/pose_iter_160000.caffemodel --dataset MPI
  • Body_25 pretrained model
python pose_estimation.py --proto data/body_25/body_25_deploy.prototxt  --model data/body_25/pose_iter_584000.caffemodel
  • COCO pretrained model
python pose_estimation.py --proto data/coco/deploy_coco.prototxt  --model data/coco/pose_iter_440000.caffemodel --dataset COCO

Parameters

Overlay image enable (Boolean)

overlay_enable = True

Pixel blurring (Tuple)

blur_pixel = (4, 4)

Move detection thresh (Int) range: 1 - 255

move_detection_thresh = 64

Minimum size of moving filter (Int) range: 0 - width*height

move_min_size = 2500

Face detection times (Int) range: > 1

face_detection_times = 3 

Minimum pixel of face filter (Tuple)

face_min_pixel = (120, 120)

Face detection interval (Int) range: > 1

face_detection_interval = 1

Motion detection average adjustment (Float)

avg_adjustment = 0.2

Webcam frame width (Int)

width = 1280

Webcam frame height (Int)

height = 960

Reference

OpenCV data, from https://github.com/opencv/opencv

MobileNetSSD caffemodel, from https://github.com/PINTO0309/MobileNet-SSD-RealSense

Wide Angle Repair, from https://blog.csdn.net/donkey_1993/article/details/103909811

Calibrate Camera, from https://blog.csdn.net/Thomson617/article/details/103506391

Pose Estimation, from https://github.com/legolas123/cv-tricks.com

About

A basic face detection python program. Use frame images for motion detection to count people.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •