Skip to content

Commit

Permalink
🐞 Fix folder dataset for classification tasks (#708)
Browse files Browse the repository at this point in the history
Fix folder dataset for classification tasks
  • Loading branch information
samet-akcay authored Nov 18, 2022
1 parent 6b799ce commit 5ebda53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions anomalib/data/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ def make_dataset(
if row.label_index == 1:
samples.loc[index, "mask_path"] = str(mask_dir / row.image_path.name)

# make sure all the files exist
# samples.image_path does NOT need to be checked because we build the df based on that
assert samples.mask_path.apply(
lambda x: Path(x).exists() if x != "" else True
).all(), f"missing mask files, mask_dir={mask_dir}"
# make sure all the files exist
# samples.image_path does NOT need to be checked because we build the df based on that
assert samples.mask_path.apply(
lambda x: Path(x).exists() if x != "" else True
).all(), f"missing mask files, mask_dir={mask_dir}"

# Ensure the pathlib objects are converted to str.
# This is because torch dataloader doesn't like pathlib.
Expand Down

0 comments on commit 5ebda53

Please sign in to comment.