From 1ac306a434aecd0ec8eef89447ecfcc3af1c09ad Mon Sep 17 00:00:00 2001 From: Adam Tonderski Date: Wed, 21 Jun 2023 11:21:05 +0200 Subject: [PATCH] :art: Exclude some classes from detection evaluation --- zod/eval/detection/constants.py | 8 +++++++- zod/eval/detection/eval_nuscenes_style.py | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zod/eval/detection/constants.py b/zod/eval/detection/constants.py index 8567cb9..51b4719 100644 --- a/zod/eval/detection/constants.py +++ b/zod/eval/detection/constants.py @@ -2,5 +2,11 @@ # Try to evaluate all classes, including subclasses. all_classes = set(OBJECT_CLASSES + OBJECT_SUBCLASSES) -all_classes -= {"Unclear"} +# Remove classes that +all_classes -= { + "Unclear", + "Vehicle_Other", + "VulnerableVehicle_Other", + "VulnerableVehicle_Wheelchair", +} EVALUATION_CLASSES = sorted(all_classes) diff --git a/zod/eval/detection/eval_nuscenes_style.py b/zod/eval/detection/eval_nuscenes_style.py index 010a175..64d8c9f 100644 --- a/zod/eval/detection/eval_nuscenes_style.py +++ b/zod/eval/detection/eval_nuscenes_style.py @@ -5,7 +5,6 @@ from typing import Callable, Dict import numpy as np -import tqdm from zod.eval.detection._nuscenes_eval.common.data_classes import EvalBoxes from zod.eval.detection._nuscenes_eval.common.utils import center_distance @@ -95,12 +94,9 @@ def evaluate_nuscenes_style( } evaluated_clses = set(metrics[detection_cfg.dist_ths[0]].keys()) - n_eval_steps = len(evaluated_clses) * len(detection_cfg.dist_ths) - pbar = tqdm.tqdm(total=n_eval_steps, desc="Evaluating...", unit="class") for zod_cls in evaluated_clses: # They evaluate the ap across all thresholds for dist_th in detection_cfg.dist_ths: - pbar.set_description(f"Evaluating {zod_cls} AP @ {dist_th:.2f}m...") detection_metrics.add_label_ap( detection_name=zod_cls, dist_th=dist_th, @@ -108,11 +104,9 @@ def evaluate_nuscenes_style( ) # They evaluate the tp across only one threshold for metric in VALID_TP_METRICS: - pbar.set_description(f"Evaluating {zod_cls} {metric}...") detection_metrics.add_label_tp( zod_cls, metric, metrics[detection_cfg.dist_th_tp][zod_cls][metric] ) - pbar.update(1) if verbose: _print_nuscenes_metrics(detection_metrics)