Video Compression

VideoNerd

Content

How To Decode and Show Frames

Activation Web-Camera in Real-Time

How to detect Faces with cvlib

 

 

How To Decode and Show Frames

The python module sk-video  (to install this module pls. type ‘pip install sk-video’) contains a special iterator FFmpegReader to traverse (to decode) over all frames from any container (mp4,mkv,avi …). 

The python script ShowGrayFrames takes for example a mp4-file and converts each frame into gray and shows it, to get to next frame pls. type the space key, to exit the script pls. type Esc.

 

Example:

python ShowGrayFrames.py -i crowdrun1080p.mp4

resolution 1920×1080, num frames 1000

 

 

 

Activation Web-Camera in Real-Time

This is very simple python script activate_camera.py which activates your laptop camera and displays scaled-down video by the factor 2x in real-time, to exit press Esc

Usage:

--vs     vertical downscale factor, default 0.5
--hs      horizontal downscale factor, default 0.5

 

Example [only vertical resizing]:

python activate_camera.py --vs 0.5 --hs 1.0

 

my room (lack of money)

 

 

How to detect Faces with cvlib

To install cvlib package i recommend the following operations, firstly to install tensorflow and then cvlib:

pip install tensorflow --user  
pip install cvlib

 

The python script FaceDetect detects faces and put rectangle around each face with the confidence value:

Example:

python FaceDetection.py -i edge-detection-woman.png

 

most intriguing fact that if we apply the script on faked faces (i.e. faces generated by AI) we get low confidences:

 

if we define the detection index as the number of correctly detected faces divided by the total number of faces in an image. The for real human faces the detection index highly likely is above 90%, but for AI-generated faces the detection index is about 50%. 

Leave a Reply

Your email address will not be published. Required fields are marked *