Code Monkey home page Code Monkey logo

pixood's Introduction

PixOOD

Official implementation of the "PixOOD: Pixel-Level Out-of-Distribution Detection" ECCV 2024 paper

[Paper]

PixOOD method overview

If you use this work please cite:

@InProceedings{Vojir_2024_ECCV,
    author    = {Vojíř, Tomáš and Šochman, Jan and Matas, Jiří},
    title     = {{PixOOD: Pixel-Level Out-of-Distribution Detection}},
    booktitle = {ECCV},
    year      = {2024},
}

Update

  • 2024.07.31 - 💥 Code published, inference tested "on my PC and it works" :)
  • 2024.07.03 - Accepted to ECCV 2024

TODO

  • Add documentation and comments
  • Clean up and test the training code
  • Streamline the training procedure

Inference

Download the pre-trained checkpoints (it uses gdown python app)

./checkpoints/download.sh

For example of single frame inference see the example.ipynb

For evaluation of whole sequence see example below:

output.mp4

This command generated the video above (Note that it requires ffmpeg for video generation, otherwise the individual images are stored)

python plot.py --img_dir ./assets/test_seq --out_dir ./_out/vis --dname wos_seq1 --fps 10 --thr 0.995

Training

The training code should work, but I did not test it after refactoring.

The PixOOD first train backbone with MLP classifier for in-distribution classes using configuration stored in ./code/config/dinov2_vit_l.yaml:

cd code
CUDA_VISIBLE_DEVICES=0 python3 train.py --config ./config/dinov2_vit_l.yaml EXPERIMENT.NAME backbone_lp

Then run the Condensation alg. and estimate the decision strategy:

cd code
CUDA_VISIBLE_DEVICES=0 python3 train.py --config ./config/pixood.yaml EXPERIMENT.NAME pixood

Copy the new checkpoints:

cp ./_out/experiments/backbone_lp/checkpoints/checkpoint-best.pth ./checkpoints/checkpoint-backbone.pth
cp ./_out/experiments/pixood/checkpoints/checkpoint-latest.pth ./checkpoints/checkpoint-latest.pth

and the inference code should work. Note that if you change some configuration you will probably need to copy the parameters.yaml from ./_out/experiments/pixood/ to the git repo root directory and change the OUT_DIR to ./.

Licence

Copyright (c) 2024 Toyota Motor Europe
Patent Pending. All rights reserved.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

pixood's People

Contributors

vojirt avatar

Stargazers

He Jiabei avatar  avatar TOMMY avatar  avatar  avatar Jonas Serych avatar Vítězslav Procházka avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar Rohit Gupta avatar

Watchers

Jog avatar  avatar  avatar  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.