OValery16 / Tutorial-about-3D-convolutional-network

Tutorial about 3D convolutional network
Mozilla Public License 2.0
227 stars 36 forks source link

Prediction code #1

Open developer888891 opened 5 years ago

developer888891 commented 5 years ago

Hi, thanks for the repo! I'm working on hand gesture recognition currently(Especially on JESTER dataset), I saw your work on it, but I didn't find any prediction code in it. Can you please share a hand gesture prediction code for webcam?

Thank You!

OValery16 commented 5 years ago

Hi @developer888891,

For the prediction code, you just need to run the train.py with the arg "eval_only"

example: python train.py --eval_only True --resume True --config configs/config.json -g 0

For the webcam, my advice would be to use opencv and capture the different frames. For example, with this code https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html

Later you plug the image in the data loader "VideoFolder" (you can modify it a bit to get the frame directly from the webcam, it is not complicated), and after you run the prediction step with "validate(val_loader, model, criterion, train_data.classes_dict)"

If you like you like this project, feel free to leave a star. (it is my only reward ^^)

Olivier