/GUI-tkinter-face-detection

GUI made by python library "tkinter " to play video files, detect human face, and save detected face as a video file.

Primary LanguagePython

GUI-tkinter-face-detection

GUI made by python library "tkinter " to play video files, detect human face, and save detected face as a video file.

Dependencies:

  • Python 3.6.4

  • OpenCV 4.1.0

  • tkinter 8.6

  • PIL 5.0.0

OpenCV face detector: Please download OpenCV face detector (haarcascade_frontalface_default.xml) from the following URL:

https://github.com/opencv/opencv/tree/master/data/haarcascades

Then, save it in the folder where this repository is saved on your PC.

How to use:

After you run this code, a GUI will be opened which includes following buttons:

Select video file: Browse and open a video file. This code supports "mp4" and "avi" formats.

Play

Pause

Record: Start face detection and saving detected face as a video file in the folder where this repository is saved on your PC.

Stop recording: Stop face detection.

Snapshot: Save current frame as an image file.

Note:

I only tested with a video file including only one human face.