xcyao00 / BGAD

Pytorch Implementation for CVPR2023 paper: Explicit Boundary Guided Semi-Push-Pull Contrastive Learning for Supervised Anomaly Detection
75 stars 9 forks source link

how to use fg_mask? #1

Open nicebro123 opened 1 year ago

nicebro123 commented 1 year ago

I was training under windows and the above error appeared FileNotFoundError: [Errno 2] No such file or directory: 'fg_mask/bottle\mvtec_anomaly_detection\bottle\train\good\023.png'

xcyao00 commented 1 year ago

This may be because the image path is incorrect. The foreground mask images are in fg_mask.zip file, you can unzip this file and modify the image path in the code lines where report the error.

nicebro123 commented 1 year ago

thk u

muaz1236 commented 1 week ago

@xcyao00 Thanks for the repo. Trying it in Sept 2024 is causing many version issues. After resolving those, I am stuck at a similar issue as in this thread. In the datasets/mvtec.py, line 382, in copy_paste fg_mask = Image.open(fg_path) , I am getting the following error: FileNotFoundError: [Errno 2] No such file or directory: 'fg_mask/bottle/125.png

Maybe it seems like previously the data directory of MVTec AD dataset was different than today! Can you help me resolve this error, please?