Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tuomastik/video_face_detection

Open more actions menu

Repository files navigation

video_face_detection

A small Python program which adds a face, gender and age detection annotations to a video.

Example output

Installation and usage instructions

  1. Clone this repository:
git clone --recursive git@github.com:tuomastik/video_face_detection.git
  1. Prepare Python environment with Conda:
conda create -n video_face_detection python=3.5 scipy numpy pillow tensorflow keras
source activate video_face_detection
pip install google-cloud-vision==0.30.1
  1. Install FFmpeg for video processing. On Linux, install by sudo apt-get install ffmpeg.

  2. Put your Google Cloud Platform service account key in the root directory of this repository with a name gcp_service_account_key.json.

  3. Execute main() function in main.py. The script will start by downloading the weights for gender and age predictor:

main(input_video_path="input.mp4",
     output_video_path="input_annotated.mp4",
     detection_start_time=2, detection_end_time=4,
     highlight_color="#00ff00", font="Montserrat-Bold.ttf", font_size=32,
     line_width_rectangle=4, line_width_face_parts=4, language=Language.english,
     draw_eyes=True, draw_eyebrows=True, draw_mouth=True, draw_nose=True)

About

📹🧐 Add face, gender and age detection annotations to a video

Topics

Resources

License

Stars

Watchers

Forks

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.