mala-lab / InCTRL

Official implementation of CVPR'24 paper 'Toward Generalist Anomaly Detection via In-context Residual Learning with Few-shot Sample Prompts'.
Apache License 2.0
83 stars 12 forks source link

how to test one img? #21

Open czy5638222 opened 1 week ago

czy5638222 commented 1 week ago

How should I write the code to input an image and return the anomaly score? Please help me

baraa-m commented 3 days ago

@Diana1026 Thank you for sharing this Github, it's very interesting. I have exactly the same question above, I hope someone can help. The idea is to test the pretrained model on one image and see either the mask of image if there is an anomaly or "no anomaly detected" ... Best regards!

Diana1026 commented 3 days ago

Hi, I did not write any script for testing one single image, so maybe you can modify the code by yourself. Besides, our paper did not involve the anomaly segmentation task as we did not use the mask ground truth during training. However, I believe you can obtain a simple anomaly similarity map based on interpolating the holistic map.