Code for the Submission to AI City Challenge Track 4 by Computer Vision LAB, College of Engineering, Trivandrum which obtained third position in leaderboard. The leader board statistics for the proposed method are :
- F1-Score : 0.7018
- RMSE : 67.5044
- S4 Score : 0.5438
- Python 3
- ImageAI
- TensorFlow 1.x
- SciPy
- MatPlotlib
- Opencv-Contrib
The detection model YOLOv3 uses the pretrained weights provided here : OlafenwaMoses/ImageAI , the weight file is expected to be placed in the same working directory as the code.
We have provided the detections text files both in the Original Video, Background Images, and the Detections on the Zoomed(Cropped Video) under the releases, please download the Release and unzip to your workspace and run the anomaly extractor only to extract the anomalies from the detection text files, the anomaly extractor module extracts the anomaly time from the videos using the detection text files, the anomaly extractor can be tried after downloading and unzipping the release by running :
python3 CombinedExtractor.py
Export the Environment variable AICITYVIDEOPATH
to the input video directory (test and train)
export AICITYVIDEOPATH="/path/to/track4/dataset/"
Step 1 Running the detections on Original Video and Background Generation (to save time both of these can be run in parallel)
python3 normdetect.py
python3 createbg.py
python3 bgnormdetect.py
This will partially fill the results and provide a text file zoomcheck.txt which gives the video numbers for the videos to check for zoom/cropped detections.
python3 CombinedExtractor.py normal
python3 cropdetect.py
python3 bgcropdetect.py
This will fill up the rest of the Result.txt by running the anomaly extraction algorithm on the detection text files
python3 CombinedExtractor.py zoom
Result.txt will contain the results in the AI City Challenge Track 4 format
- Background Generation : Using same parameters as 2019-CVPR-AIC-Track-3-UWIPL
- Freeze detection on videos : 2019-CVPR-AIC-Track-3-UWIPL