Skip to content

Commit

Permalink
fix: TODO update matching policy
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 committed Dec 28, 2023
1 parent faf73b7 commit d80327a
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,18 +421,15 @@ def _get_object_results_for_tlr(
estimated_objects_ = estimated_objects.copy()
ground_truth_objects_ = ground_truth_objects.copy()
# 1. matching based on same label primary
# NOTE: current implementation match Est/Gt pairs without considering ID, therefore it might not be right result
for est_object in estimated_objects:
for gt_object in ground_truth_objects:
if est_object.uuid is None or gt_object.uuid is None:
raise RuntimeError(
f"uuid of estimation and ground truth must be set, but got {est_object.uuid} and {gt_object.uuid}"
)

if (
est_object.uuid == gt_object.uuid
and est_object.frame_id == gt_object.frame_id
and est_object.semantic_label == gt_object.semantic_label
):
if est_object.semantic_label == gt_object.semantic_label and est_object.frame_id == gt_object.frame_id and est_object in estimated_objects_ and gt_object in ground_truth_objects_:
object_results.append(
DynamicObjectWithPerceptionResult(
estimated_object=est_object,
Expand All @@ -441,6 +438,7 @@ def _get_object_results_for_tlr(
)
estimated_objects_.remove(est_object)
ground_truth_objects_.remove(gt_object)

# 2. matching based on same ID
rest_estimated_objects_ = estimated_objects_.copy()
rest_ground_truth_objects_ = ground_truth_objects_.copy()
Expand All @@ -451,7 +449,7 @@ def _get_object_results_for_tlr(
f"uuid of estimation and ground truth must be set, but got {est_object.uuid} and {gt_object.uuid}"
)

if est_object.uuid == gt_object.uuid and est_object.frame_id == gt_object.frame_id:
if est_object.uuid == gt_object.uuid and est_object.frame_id == gt_object.frame_id and est_object in estimated_objects_ and gt_object in ground_truth_objects_:
object_results.append(
DynamicObjectWithPerceptionResult(
estimated_object=est_object,
Expand Down

0 comments on commit d80327a

Please sign in to comment.