--- license: mit language: - en pipeline_tag: zero-shot-image-classification tags: - ood-detection - outlier-detection ---
🏠 MOODv2
• 🤗 Model
• 🐱 Code
• 📃 MOODv1
• 📃 MOODv2
## Performance
## Usage To predict an input image is in-distribution or out-of-distribution, we support the following OOD detection methods: - `MSP` - `MaxLogit` - `Energy` - `Energy+React` - `ViM` - `Residual` - `GradNorm` - `Mahalanobis` - `KL-Matching` ```bash python src/demo.py \ --img_path imgs/DTD_cracked_0004.jpg \ # change to your image path if needed --cfg configs/beit-base-p16_224px.py \ --checkpoint pretrain/beitv2-base_3rdparty_in1k_20221114-73e11905.pth \ --fc data/fc.pkl \ --id_train_feature data/imagenet_train.pkl \ --id_val_feature data/imagenet_test.pkl \ --methods MSP MaxLogit Energy Energy+React ViM Residual GradNorm Mahalanobis ``` For the example OOD image `imgs/DTD_cracked_0004.jpg`, you are supposed to get: ``` MSP evaluation: out-of-distribution MaxLogit evaluation: out-of-distribution Energy evaluation: out-of-distribution Energy+React evaluation: out-of-distribution ViM evaluation: out-of-distribution Residual evaluation: out-of-distribution GradNorm evaluation: out-of-distribution Mahalanobis evaluation: out-of-distribution ``` ## Benchmark To reproduce the results in our paper, please refer to our [repository](https://github.com/dvlab-research/MOOD) for details.