Skip to content

Commit

Permalink
Update mvtec.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zqhang authored Jul 5, 2024
1 parent 2119bc2 commit 262b5a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generate_dataset_json/mvtec.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def run(self):
for specie in species:
is_abnormal = True if specie not in ['good'] else False
img_names = os.listdir(f'{cls_dir}/{phase}/{specie}')
mask_names = os.listdir(f'{cls_dir}/groundtruth/{specie}') if is_abnormal else None
mask_names = os.listdir(f'{cls_dir}/ground_truth/{specie}') if is_abnormal else None
img_names.sort()
mask_names.sort() if mask_names is not None else None
for idx, img_name in enumerate(img_names):
info_img = dict(
img_path=f'{cls_name}/{phase}/{specie}/{img_name}',
mask_path=f'{cls_name}/groundtruth/{specie}/{mask_names[idx]}' if is_abnormal else '',
mask_path=f'{cls_name}/ground_truth/{specie}/{mask_names[idx]}' if is_abnormal else '',
cls_name=cls_name,
specie_name=specie,
anomaly=1 if is_abnormal else 0,
Expand Down

0 comments on commit 262b5a1

Please sign in to comment.