Action Recognition Deep Learning Project (recognizing drinking and cooking)
pip install -r requirements.txt
"m", "--model" :
path to trained serialized model"-l", "--label-bin":
path to label binarizer"-i", "--input":
path to our input video (e.g.example_clips/video.mp4
)"-o", "--output":
path to our output video (e.g.output/myVideo.avi
)"-s", "--size":
size of queue for averaging (e.g. 128)"-a", "--action":
choose a predictive action from this list (drinking, cooking
). This name will be used in labeling the JSON file and the output figure y_label."-f", "--fig":
figure name"-j", "--json":
JSON file name
Download these two video samples and place them in 'example_clips' folder.
Drinking Video Sample | Cooking Video Sample |
---|---|
drinking sample video | cooking sample video |
- Create a folder called
model
, download the pre-trained model and the binarized Labels add place them into the model folder. - Create a folder called
output
for the code output. - Create a folder called
example_clips
and put the above 'video samples' together with your test videos in it.
python predict_video.py --model model/activity.model --label-bin model/lb.pickle --input example_clips/
VIDEO-NAME --output output/output_video.avi --fig TimeLabel --json TimeLabel --action drinking --size 128
python predict_video.py --model model/activity.model --label-bin model/lb.pickle --input example_clips/
VIDEO-NAME --output output/output_video.avi --fig TimeLabel --json TimeLabel --action cooking --size 128