From 3354a033fe7ca293fb8e7fd07e6eac79c3203a6f Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 4 Jul 2019 16:25:57 +0200 Subject: [PATCH] Updated prepare action to use new config Signed-off-by: Jim Martens --- src/twomartens/masterthesis/cli.py | 16 +++++++++++----- src/twomartens/masterthesis/config.py | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/twomartens/masterthesis/cli.py b/src/twomartens/masterthesis/cli.py index e99847f..5d9278f 100644 --- a/src/twomartens/masterthesis/cli.py +++ b/src/twomartens/masterthesis/cli.py @@ -45,13 +45,19 @@ def prepare(args: argparse.Namespace) -> None: from twomartens.masterthesis import data - file_names_photos, file_names_instances, instances = data.prepare_scenenet_data(args.scenenet_path, - args.protobuf_path) - with open(f"{args.ground_truth_path}/photo_paths.bin", "wb") as file: + file_names_photos, file_names_instances, \ + instances = data.prepare_scenenet_data(conf.get_property("Paths.scenenet"), + args.protobuf_path) + with open(f"{conf.get_property('Paths.scenenet_gt')}/" + f"{args.ground_truth_path}/photo_paths.bin", "wb") as file: pickle.dump(file_names_photos, file) - with open(f"{args.ground_truth_path}/instance_paths.bin", "wb") as file: + + with open(f"{conf.get_property('Paths.scenenet_gt')}/" + f"{args.ground_truth_path}/instance_paths.bin", "wb") as file: pickle.dump(file_names_instances, file) - with open(f"{args.ground_truth_path}/instances.bin", "wb") as file: + + with open(f"{conf.get_property('Paths.scenenet_gt')}/" + f"{args.ground_truth_path}/instances.bin", "wb") as file: pickle.dump(instances, file) diff --git a/src/twomartens/masterthesis/config.py b/src/twomartens/masterthesis/config.py index 5c922d3..c793ee3 100644 --- a/src/twomartens/masterthesis/config.py +++ b/src/twomartens/masterthesis/config.py @@ -36,6 +36,7 @@ _CONFIG_PROPS = { "Paths": { "coco": (str, ""), "scenenet": (str, ""), + "scenenet_gt": (str, ""), "scenenet_gt_train": (str, ""), "scenenet_gt_val": (str, ""), "scenenet_gt_test": (str, ""),