From 2d0965a6ec89c2d623e85e4e78ec81398add9333 Mon Sep 17 00:00:00 2001 From: jeongHwarr Date: Tue, 5 Jul 2022 16:37:00 +0900 Subject: [PATCH] Fix: data split issue #https://github.com/openvinotoolkit/anomalib/issues/403 --- anomalib/data/utils/split.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anomalib/data/utils/split.py b/anomalib/data/utils/split.py index 8c63497a41..ef12ae9773 100644 --- a/anomalib/data/utils/split.py +++ b/anomalib/data/utils/split.py @@ -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() @@ -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.