Skip to content

Count the frames with each character to understand their amount of appearances

Notifications You must be signed in to change notification settings

tsmithv11/cheftracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Count the number of scenes with a person using facial recognition

Note: This is very hacky and a work in progress

This is modified from Jason Brownlee's tutorial: https://machinelearningmastery.com/how-to-develop-a-face-recognition-system-using-facenet-in-keras-and-an-svm-classifier/

This code takes a movie file and goes scene by scene and counts the number of scenes with each person from a trained model. It checks how many CPU cores your machine has and runs parrellel processes for each core. It also skips over some number of frames (currently set to 15) to save time.

Setup details

You need facenet_keras.h5 in your directory. Find it in the tutorial linked above.

First, make sure you create a trained model using a folder with subfolders for each person saved as a pickle file (currently set to svc_model.sav) and encoder classes (currently set to classes.npy).

Make sure to change {video/location.mp4} to your video location.

Other details

Check out how I used this to try to predict who gets eliminated in Top Chef: https://www.ifoundanifty.com/2021/04/can-you-predict-the-winner-of-top-chef-based-on-screentime/

About

Count the frames with each character to understand their amount of appearances

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages