Skip to content

Commit

Permalink
last two parts of file path for image saving
Browse files Browse the repository at this point in the history
  • Loading branch information
alexriedel1 authored Aug 28, 2024
1 parent b7188db commit 7362cdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/anomalib/data/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def save_image(filename: Path | str, image: np.ndarray | Figure, root: Path | No
# if file_path is absolute, then root is ignored
# so we remove the top level directory from the path
if file_path.is_absolute() and root:
file_path = Path(*file_path.parts[2:]) # OS-AGNOSTIC
file_path = Path(*file_path.parts[-2:]) # OS-AGNOSTIC
if root:
file_path = root / file_path

Expand Down

0 comments on commit 7362cdc

Please sign in to comment.