[arXiv
]
Please follow the Installation Instruction to set up the codebase.
We have three different sets of dataset used for training, ood-fine-tuning, and anomaly inference. Please follow the below steps to set-up each set.
cfg.MODEL.MASK_FORMER.ANOMALY_FILEPATH
accordingly.The training of the model takes place in two stages:
CUDA_VISIBLE_DEVICES=1 python train_net.py --num-gpus 1 --config-file configs/cityscapes/semantic-segmentation/anomaly_train.yaml
. Streethazard Dataset: CUDA_VISIBLE_DEVICES=1 python train_net.py --num-gpus 1 --config-file 'configs/streethazard/streethazard_training.yaml'
.CUDA_VISIBLE_DEVICES=1 python train_net.py --num-gpus 1 --config-file configs/cityscapes/semantic-segmentation/anomaly_ft.yaml
. Streethazard Dataset: CUDA_VISIBLE_DEVICES=1 python train_net.py --num-gpus 1 --config-file 'configs/streethazard/streethazard_ft.yaml'
.During inference, we use the final-weights obtained after fine-tuning: CUDA_VISIBLE_DEVICES=1 python anomaly_utils/anomaly_inference.py --input '/path-to-images-files/*.jpg' --config-file '/path-to-anomaly-inference-config/anomaly_inference.yaml'
We provide all the commands for training, ood-fine-tune, and anomaly inference in run.sh
and corresponding config files at /configs/cityscapes /semantic-segmentation/
.
To perform anomaly segmentation using pre-trained models, download the model from shared Google Drive link and then change the model weight path in /configs/cityscapes/semantic-segmentation/anomaly_inference.yaml
.
singularity run --bind {input-path-to-image-datset}:/input,{output-path-to-save-segmentation-maps}:/output mask2former.sif
The majority of Mask2Anomaly is licensed under a MIT License.
However portions of the project are available under separate license terms: Mask2Former and Swin-Transformer-Semantic-Segmentation is licensed under the MIT license, Deformable-DETR is licensed under the Apache-2.0 License.
We thank the authors of the codebases mentioned below, which helped build the repository.