This set of code is adapted from https://github.com/hx173149/C3D-tensorflow with modifications. I should have forked it but I'm too lazy and stupid.
If there is any copyright violation, please notify zijwei@cs.stonybrook.edu to delete
- The data loading process
- Image loaders
- options on RGB or BGR Image
- In order to fix the uncertainties, no random sampling for frames was used during testing and training. the starting frame is (#allframes-samplelength)/2
This code is trying to improve the performance reported by @hx173149. Here I'm using the provided model without any modification. The performance, however, on UCF101 is as below:
training (~9K) | Testing (~3.7K) |
---|---|
0.93 | 0.91 |
This is higher than both the results posed on https://github.com/hx173149/C3D-tensorflow (~.72) and in the C3D paper (.85).
I double checked without noticing any bugs. But if you do find one, please let me know.
- tensorflow
- opencv (conda install opencv)
- scipy.ndimage
- [PIL] is not necessary
- Prepare data like list/train.list and list/test.list, make sure the paths stored in are correct
python train_c3d_ucf101.py --max_steps 0 --gpu_id 1
Here 0 means only test
Below are from the original post:
- You must have installed the following two python libs: a) tensorflow b) Pillow
- You must have downloaded the UCF101 (Action Recognition Data Set)
- Each single avi file is decoded with 5FPS (it's depend your decision) in a single directory.
- you can use the
./list/convert_video_to_images.sh
script to decode the ucf101 video files - run
./list/convert_video_to_images.sh .../UCF101 5
- you can use the
- Generate {train,test}.list files in
list
directory. Each line corresponds to "image directory" and a class (zero-based). For example:- you can use the
./list/convert_images_to_list.sh
script to generate the {train,test}.list for the dataset - run
./list/convert_images_to_list.sh .../dataset_images dataset_train
, this will generatedataset_train.list
file inside the root folder
- you can use the
database/ucf101/train/ApplyEyeMakeup/v_ApplyEyeMakeup_g01_c01 0
database/ucf101/train/ApplyEyeMakeup/v_ApplyEyeMakeup_g01_c02 0
database/ucf101/train/ApplyEyeMakeup/v_ApplyEyeMakeup_g01_c03 0
database/ucf101/train/ApplyLipstick/v_ApplyLipstick_g01_c01 1
database/ucf101/train/ApplyLipstick/v_ApplyLipstick_g01_c02 1
database/ucf101/train/ApplyLipstick/v_ApplyLipstick_g01_c03 1
database/ucf101/train/Archery/v_Archery_g01_c01 2
database/ucf101/train/Archery/v_Archery_g01_c02 2
database/ucf101/train/Archery/v_Archery_g01_c03 2
database/ucf101/train/Archery/v_Archery_g01_c04 2
database/ucf101/train/BabyCrawling/v_BabyCrawling_g01_c01 3
database/ucf101/train/BabyCrawling/v_BabyCrawling_g01_c02 3
database/ucf101/train/BabyCrawling/v_BabyCrawling_g01_c03 3
database/ucf101/train/BabyCrawling/v_BabyCrawling_g01_c04 3
database/ucf101/train/BalanceBeam/v_BalanceBeam_g01_c01 4
database/ucf101/train/BalanceBeam/v_BalanceBeam_g01_c02 4
database/ucf101/train/BalanceBeam/v_BalanceBeam_g01_c03 4
database/ucf101/train/BalanceBeam/v_BalanceBeam_g01_c04 4
...
- If you want to test my pre-trained model, you need to download my model from here: https://www.dropbox.com/sh/8wcjrcadx4r31ux/AAAkz3dQ706pPO8ZavrztRCca?dl=0
python train_c3d_ucf101.py
will train C3D model. The trained model will saved inmodels
directory.python predict_c3d_ucf101.py
will test C3D model on a validation data set.
Top-1 accuracy of 72.6% should be achieved for the validation dataset with this code and pre-trained from the sports1M model. You can download my pretrained UCF101 model and mean file from here: https://www.dropbox.com/sh/8wcjrcadx4r31ux/AAAkz3dQ706pPO8ZavrztRCca?dl=0
- Thanks the author Du tran's code: C3D-caffe
- C3D: Generic Features for Video Analysis