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

Fix: data split issue #404

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions anomalib/data/utils/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def split_normal_images_in_train_set(
DataFrame: Output dataframe where the part of the training set is assigned to test set.
"""

if seed > 0:
if seed >= 0:
random.seed(seed)

normal_train_image_indices = samples.index[(samples.split == "train") & (samples.label == normal_label)].to_list()
Expand All @@ -74,7 +74,7 @@ def create_validation_set_from_test_set(samples: DataFrame, seed: int = 0, norma
normal_label (str): Name of the normal label. For MVTec AD, for instance, this is normal_label.
"""

if seed > 0:
if seed >= 0:
random.seed(seed)

# Split normal images.
Expand Down