PyTorch implementation of uniform quantization on 3D CNN architectures for action recognition using UCF-101 dataset.
- PyTorch
- OpenCV
- FFmpeg, FFprobe
- Python 3
- 3D Resnet
- 3D SqueezeNet
- 3D MobileNetv2
- Download videos and train/test splits here.
- Convert from avi to jpg files using
util_scripts/generate_video_jpgs.py
python -m scripts.generate_video_jpgs avi_video_dir_path jpg_video_dir_path ucf101
- Generate annotation file in json format similar to ActivityNet using
util_scripts/ucf101_json.py
annotation_dir_path
includes classInd.txt, trainlist0{1, 2, 3}.txt, testlist0{1, 2, 3}.txt
python -m scripts.ucf101_json annotation_dir_path jpg_video_dir_path dst_json_path
The primary function of the code is available from the main file. Use the following command:
python main.py --mode <option>
The available modes are:
- train - train 3D networks
- post_train_quant - post training quantization
- quant_aware - quantization aware training
- test - test 3D networks
Please follow the command with --help to check a detailed description of every available parameter.
Example for every usecase can be found in the script folder.
The code was built on top of the works from Hara et al. and Kopuklu et al..