diff --git a/src/twomartens/masterthesis/cli.py b/src/twomartens/masterthesis/cli.py index 37e05c2..810a0d9 100644 --- a/src/twomartens/masterthesis/cli.py +++ b/src/twomartens/masterthesis/cli.py @@ -75,13 +75,13 @@ def _ssd_train(args: argparse.Namespace) -> None: predictor_sizes=ssd_model.predictor_sizes, batch_size=batch_size, resized_shape=(image_size, image_size), - mode="training") + training=True) val_generator, val_length = \ data.load_scenenet_data(file_names_val, instances_val, args.coco_path, predictor_sizes=ssd_model.predictor_sizes, batch_size=batch_size, resized_shape=(image_size, image_size), - mode="validation") + training=False) del file_names_train, instances_train, file_names_val, instances_val nr_batches_train = int(math.ceil(train_length / float(batch_size))) diff --git a/src/twomartens/masterthesis/data.py b/src/twomartens/masterthesis/data.py index 2061e3a..78613c3 100644 --- a/src/twomartens/masterthesis/data.py +++ b/src/twomartens/masterthesis/data.py @@ -237,7 +237,7 @@ def load_scenenet_data(photo_paths: Sequence[Sequence[str]], coco_path: str, predictor_sizes: np.ndarray, batch_size: int, resized_shape: Sequence[int], - mode: str) -> Tuple[callable, int]: + training: bool) -> Tuple[callable, int]: """ Loads the SceneNet RGB-D data and returns a data set. @@ -248,7 +248,7 @@ def load_scenenet_data(photo_paths: Sequence[Sequence[str]], predictor_sizes: sizes of the predictor layers batch_size: size of every batch resized_shape: shape of input images to SSD - mode: one of "validation" or "training" + training: True if training data is desired Returns: scenenet data set generator @@ -290,7 +290,7 @@ def load_scenenet_data(photo_paths: Sequence[Sequence[str]], labels=final_labels ) - if mode == "training": + if training: shuffle = True transformations = [data_augmentation_chain_original_ssd.SSDDataAugmentation( img_width=resized_shape[0],