GUI made by python library "tkinter " to play video files, detect human face, and save detected face as a video file.
-
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.
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.
I only tested with a video file including only one human face.