Code Monkey home page Code Monkey logo

anomaly-seg's Introduction

Scaling OOD Detection

This repository contains the Species dataset, the StreetHazards dataset, and some code for the paper Scaling Out-of-Distribution Detection for Real-World Settings.

Download the Species OOD detection dataset here.

Download the StreetHazards OOD segmentation dataset here.

The optional StreetHazards training set is available here. Also, the BDD-Anomaly dataset is sourced from the BDD100K dataset. Code for the multi-label out-of-distribution detection experiments is available in this repository.

How to use this repository

git clone --recursive https://github.com/hendrycks/anomaly-seg

cd anomaly-seg
mv defaults.py semantic-segmentation-pytorch/config
mv anom_utils.py semantic-segmentation-pytorch/
mv dataset.py semantic-segmentation-pytorch/
mv eval_ood.py semantic-segmentation-pytorch/
mv create_dataset.py semantic-segmentation-pytorch/
cd semantic-segmentation-pytorch

# Place the above download in semantic-segmentation-pytorch/data/
cd data/
tar -xvf streethazards_train.tar
cd ..
python3 create_dataset.py

# Train pspnet or another model on our dataset
python3 train.py

# To evaluate the model on out of distribution test set
python3 eval_ood.py DATASET.list_val ./data/test.odgt

Note: to run on single gpu please refer to this issue#3.

To evaluate the model performance using a CRF with our code please install

pip install pydensecrf

The source package is from https://github.com/lucasb-eyer/pydensecrf

Evaluation with BDD100K

We cannot reshare the images from BDD100K so please visit BDD website to download them. The images should be from the 10K set of images that they released.

We have shared the labels in the folder called seg and part of the process by which we created these labels in create_bdd_dataset.py. To be able to fully utilize these labels one just needs to pattern match the label ids to the image id (they're the same) from our labels to the BDD images.

Pretrained model is availble at this Google drive link.

Citation

If you find this useful in your research, please consider citing:

@article{hendrycks2019anomalyseg,
  title={Scaling Out-of-Distribution Detection for Real-World Settings},
  author={Hendrycks, Dan and Basart, Steven and Mazeika, Mantas and Zou, Andy and Kwon, Joe and Mostajabi, Mohammadreza and Steinhardt, Jacob and Song, Dawn},
  journal={arXiv preprint arXiv:1911.11132},
  year={2019}
}

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.