GithubHelp home page GithubHelp logo

peterzs / detection-of-traffic-anomaly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moonblvd/detection-of-traffic-anomaly

0.0 1.0 0.0 19.32 MB

This is the repo for our Detection of Traffic Anomaly (DoTA) dataset.

License: MIT License

Python 100.00%

detection-of-traffic-anomaly's Introduction

When, Where, and What? A New Dataset for Anomaly Detection in Driving Videos

Yu Yao, Xizi Wang, Mingze Xu, Zelin Pu, Ella Atkins, David Crandall

๐Ÿ’ฅ This repo contains the Detection of Traffic Anomaly (DoTA) dataset and the code of our paper.

DoTA dataset

Install ffmpeg.

Install python dependencies by pip install -r requirements.txt.

Get your youtube cookies to be able to download age restricted videos. Please find how to generate cookie based on this github issue. Chrome users can use this app to generate cookie file.

First, download the orginal videos from YouTube:

cd dataset
unzip DoTA_annotations.zip
python download_DoTA.py --url_file DoTA_urls.txt --download_dir PATH_TO_SAVE_RAW_VIDEO --cookiefile PATH_TO_COOKIE/cookies.txt

NOTE: 6 long videos (see dataset/broken_urls.txt) in DoTA were REMOVED by YouTube. Please download these videos here and put them in the user-defined PATH_TO_SAVE_RAW_VIDEO before running the next step.

Second, extract annotated frames from original videos:

python video2frames.py -v PATH_TO_SAVE_RAW_VIDEO -a annotations -f 10 -o PATH_TO_SAVE_FRAMES -n NUM_OF_PROCESSES

The video2frames.py script extracts annotated frames for each video clip and writes to PATH_TO_SAVE_FRAMES. This will take minitues to hours depending on your machine. It took us around 35 minutes to extract all clips with NUM_OF_PROCESSES=8.

Now the annotated clips are extracted and ready to use!

Annotations for VAD

Besides the per-video '.json' files, we also provide a metadata_train.json and a metadata_val.json which contains the video metadata in the following format:

{
video_id: {
    "video_start": int,
    "video_end": int,
    "anomaly_start": int,
    "anomaly_end": int,
    "anomaly_class": str,
    "num_frames": int,
    "subset": "train" or "test"
},

Extracted data for FOL model training and testing

We also provide the extracted object bounding box tracks and corresponding optical flow features that we used to train our FOL models. To use these extracted data, please download and extract the zip files to your data directory. We provide an example of how to run our dataloader:

python dataloader_example.py --load_config config/config_example.yaml

Please make sure the data directories match your data directory on your machine.

Citation

If you found this repo is useful, please cite our paper:

@article{yao2020dota,
    title={When, Where, and What? A New Dataset for Anomaly Detection in Driving Videos},
    author={Yao, Yu and Wang, Xizi and Xu, Mingze and Pu, Zelin and Atkins, Ella and Crandall, David},
    journal={arXiv preprint arXiv:2004.03044},
    year={2020}
}

detection-of-traffic-anomaly's People

Contributors

apbraga avatar moonblvd avatar xumingze0308 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.