Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when evaluate with MVTec code #42

Open
winstonchu498 opened this issue Apr 27, 2024 · 1 comment
Open

Error when evaluate with MVTec code #42

winstonchu498 opened this issue Apr 27, 2024 · 1 comment

Comments

@winstonchu498
Copy link

I used the python script you gave as follow:

python mvtec_ad_evaluation/evaluate_experiment.py --dataset_base_dir './mvtec_anomaly_detection/' --anomaly_maps_dir './output/1/anomaly_maps/mvtec_ad/' --output_dir './output/1/metrics/mvtec_ad/' --evaluated_objects bottle

but there are errors:

`python mvtec_ad_evaluation/evaluate_experiment.py --dataset_base_dir './mvtec_anomaly_detection/' --anomaly_maps_dir './output/1/anomaly_maps/mvtec_ad/' --output_dir './output/1/metrics/mvtec_ad/' --evaluated_objects bottle
=== Evaluate bottle ===
Parsed 83 ground truth image files.
Read ground truth files and corresponding predictions...
0%| | 0/83 [00:00<?, ?it/s]
Traceback (most recent call last):
File "F:\implementation_anomalydetection\nelson1425_EfficientAD\nelson_data\mvtec_ad_evaluation\evaluate_experiment.py", line 247, in
main()
File "F:\implementation_anomalydetection\nelson1425_EfficientAD\nelson_data\mvtec_ad_evaluation\evaluate_experiment.py", line 215, in main
calculate_au_pro_au_roc(
File "F:\implementation_anomalydetection\nelson1425_EfficientAD\nelson_data\mvtec_ad_evaluation\evaluate_experiment.py", line 148, in calculate_au_pro_au_roc
prediction = util.read_tiff(pred_name)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\implementation_anomalydetection\nelson1425_EfficientAD\nelson_data\mvtec_ad_evaluation\generic_util.py", line 102, in read_tiff
raise FileNotFoundError('Could not find a file with a TIFF extension'
FileNotFoundError: Could not find a file with a TIFF extension at ./output/1/anomaly_maps/mvtec_ad/bottle\test\broken_large\000
(base) PS F:\implementation_anomalydetection\nelson1425_EfficientAD\nelson_data>

`

all the mvtec_ad_evaluation.tar.xz and mvtec_anomaly_detection.tar.xz are from what you share.
I am running from aconda powershell from windows 10

can anyone point a way ?

@HoseinHashemi
Copy link

HoseinHashemi commented May 15, 2024

Pass the argument exts=['.tiff'] to the util.read_tiff(pred_name) and it must solve the issue.
So line 148 of evaluate_experiment.py should look like : prediction = util.read_tiff(pred_name, exts=['.tiff'])

Or alternatively, the function could be changed to deal with the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants