Most Recent Updates
May 23, 2018: Some pre-trained models are released.
You can find the details about my model in the following reports:
A poster is also available. (The poster is only based on experiment results of v1~v3)
Get poster
Unfortunately, pre-trained models of v1 and v4 are missing :(
Version 2
Version 3
Version 5
generate_bg.py
generating background images; very time consuming to run
You can get the preprocessed dataset from here. Extract this and you will get a directory containing the original dataset with the generated background images. You can directly use it and run prepare_data.py.
prepare_data.py
constructing TFrecords files for preparation of training the model
bgsCNN_v*.py
training the model
v1 ~ v3 respectively correspond to Model I ~ III mentioned in the second report; v4, v5 haven't been included in reports yet
NOTE
If you use bgsCNN_v1, v2 or v3, set the image_height & image_width as multiples of 32 plus 1, e.g. 321.
If you use bgsCNN_v4 or v5, set the image_height & image_width as multiples of 32, e.g. 320.
In the following demos, suppose we use bgsCNN_v2.
python train.py \
--generate_bg True \
--prepare_data True \
--dataset_dir dataset \
--log_dir logs \
--model_version 2 \
--image_height 321 \
--image_width 321 \
--train_batch_size 40 \
--test_batch_size 200 \
--max_iteration 10000
python train.py \
--prepare_data True \
--dataset_dir dataset \
--log_dir logs \
--model_version 2 \
--image_height 321 \
--image_width 321 \
--train_batch_size 40 \
--test_batch_size 200 \
--max_iteration 10000
python train.py \
--prepare_data False \
--train_file train.tfrecords \
--test_file test.tfrecords \
--log_dir logs \
--model_version 2 \
--image_height 321 \
--image_width 321 \
--train_batch_size 40 \
--test_batch_size 200 \
--max_iteration 10000
When you've finished the training, you can evaluate the model on test to see average test loss. The logs of this test procedure will be in sub-directory "model_test" under your identified logs directory.
python test.py \
--test_file test.tfrecords \
--log_dir logs \
--model_version 2 \
--image_height 321 \
--image_width 321 \
--optimal_step 9600
You can also run the model on your own video.
python test_on_video.py \
--log_dir logs \
--model_version 2 \
--image_height 321 \
--image_width 321 \
--video_file test.mp4
--optimal_step 9600