Skip to content
No description, website, or topics provided.
Python Shell
Branch: master
Clone or download
Latest commit 7b22b71 Apr 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
analysis Updated README.md Aug 24, 2018
data Added Faster R-CNN code Aug 24, 2018
improved_frcnn added the contextual models Aug 24, 2018
.gitignore Added Faster R-CNN code Aug 24, 2018
LICENSE Create LICENSE Apr 9, 2019
README.md Update README.md Apr 30, 2019
TODO.md updated the TODO list Jul 20, 2018
cadp_stat.json Added Faster R-CNN code Aug 24, 2018
requirements.txt Added Faster R-CNN code Aug 24, 2018

README.md

Accident Forecasting in Traffic Camera CCTV Videos

Requirements

Please use Python 2.7 and install required packages by

$ pip install -r requirements.txt

Please edit Keras configuration to load Tensorflow backend (we don't use Theano backend). A GPU is recommended.

Train/Test with original Faster R-CNN

Data preparation

Assume that you have CADP dataset at CADP_IMAGE_HOME. For example, for video with ID 0, the frames should be in CADP_IMAGE_HOME/000000/.

Generating images

There are unlabeled regions in each images, therefore for task like object detections or tracking, anomalous detection, we should generate images with those regions are masked out. To generate mask images, please modify the output path CADP_MASK_HOME in cover_crowd_far.py, and then please run:

$ python analysis/cover_crowd_far.py --anno_dir=./data/annotations

where anno_dir is the directory containing VATIC format annotations (each file contains annotations for one video).

Generating CSV annotations

Please run the following command to output csv data for training/testing.

$ python analysis/generate_csv.py --anno_dir=./data/annotations/trainval/ --csv_output=./cadp_train.csv --use_mask=True

where csv_output is the output csv files and use_mask is the flag to specify whether to use masked images.

Download pretrained models

Please download pretrained Resnet-50 model from https://github.com/fchollet/keras/tree/master/keras/applications. Assuming that you have put the pretrained Resnet model at MODEL_DIR/resnet50_weights_tf_dim_ordering_tf_kernels.h5. Please set that path as the value of cfg.base_net_weights at L25 of train_cadp_frcnn.py.

Training

After all above steps are done, please train Faster R-CNN with

$ python analysis/train_cadp_frcnn.py

Testing

After training, to measure the mAP@IoU=0.5, please run

$ python analysis/measure_map.py --path=./cadp_test.csv --parser=simple

Where path is the CSV files containing the annotations of test set and parser must be simple to parse the annotations.

Website -

Accident Forecasting Traffic Camera

You can’t perform that action at this time.