Made visualise work with all tarball ids

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-07-25 15:21:49 +02:00
parent 8c31794aad
commit 45b5fda185
2 changed files with 9 additions and 4 deletions

View File

@ -90,7 +90,9 @@ def visualise(args: argparse.Namespace) -> None:
from twomartens.masterthesis.ssd_keras.eval_utils import coco_utils from twomartens.masterthesis.ssd_keras.eval_utils import coco_utils
output_path, coco_path, ground_truth_path = _visualise_get_config_values(conf.get_property) output_path, coco_path, ground_truth_path = _visualise_get_config_values(conf.get_property)
output_path, annotation_file_train = _visualise_prepare_paths(args, output_path, coco_path) output_path, annotation_file_train, \
ground_truth_path = _visualise_prepare_paths(args, output_path, coco_path,
ground_truth_path)
file_names, instances, \ file_names, instances, \
cats_to_classes, cats_to_names = _visualise_load_gt(ground_truth_path, annotation_file_train, cats_to_classes, cats_to_names = _visualise_load_gt(ground_truth_path, annotation_file_train,
coco_utils.get_coco_category_maps) coco_utils.get_coco_category_maps)
@ -748,12 +750,14 @@ def _measure_prepare_paths(args: argparse.Namespace,
def _visualise_prepare_paths(args: argparse.Namespace, def _visualise_prepare_paths(args: argparse.Namespace,
output_path: str, coco_path: str) -> Tuple[str, str]: output_path: str, coco_path: str,
gt_path: str) -> Tuple[str, str, str]:
output_path = f"{output_path}/visualise/{args.trajectory}" output_path = f"{output_path}/visualise/{args.trajectory}"
annotation_file_train = f"{coco_path}/annotations/instances_train2014.json" annotation_file_train = f"{coco_path}/annotations/instances_train2014.json"
ground_truth_path = f"{gt_path}/{args.tarball_id}/"
return output_path, annotation_file_train
return output_path, annotation_file_train, ground_truth_path
def _visualise_metrics_prepare_paths(args: argparse.Namespace, def _visualise_metrics_prepare_paths(args: argparse.Namespace,

View File

@ -218,6 +218,7 @@ def _build_ssd_evaluate(parser: argparse.ArgumentParser) -> None:
def _build_visualise(parser: argparse.ArgumentParser) -> None: def _build_visualise(parser: argparse.ArgumentParser) -> None:
parser.add_argument("tarball_id", type=str, help="id of the used tarball. number for training tarball or 'test'")
parser.add_argument("trajectory", type=int, help="trajectory to visualise") parser.add_argument("trajectory", type=int, help="trajectory to visualise")