harvitronix / five-video-classification-methods

Code that accompanies my blog post outlining five video classification methods in Keras and TensorFlow
https://medium.com/@harvitronix/five-video-classification-methods-implemented-in-keras-and-tensorflow-99cad29cc0b5
MIT License
1.17k stars 479 forks source link

Add a demo script to make predictions on a single sample. #70

Closed harvitronix closed 6 years ago

harvitronix commented 6 years ago

This quick demo script allows us to specify a video filename (more of an ID, really) that is in our train or test set, and then using a trained model checkpoint, we can make predictions.

Usage: python demo.py

Before running, edit the variables within that file to specify the checkpoint location, model type, video name, etc.

Note that this is quite a rough script and is more for illustration purposes than anything. The main limitation is that the video we're making predictions for must already have its frames extracted and sequences generated (if applicable) before making predictions.

A true demo script would instead take an original video file, extract frames, generate features (if applicable) and then make predictions. That will come later.