Skip to content

mapping.py: downward-orientation normalization uses detection class instead of assigned target #25

@coderabbitai

Description

@coderabbitai

Summary

In riptide_mapping/riptide_mapping2/mapping.py, the transform_detection_to_object_parent method normalizes orientation for downward-facing objects by checking result.hypothesis.class_id against self.downwards_objects. However, in binary-classifier mode the detection class (e.g., blood) can differ from the assigned mapping target (e.g., bin_target1), causing downward normalization to be incorrectly skipped for downward targets.

This can inject unstable orientation updates into downward-facing mapping targets when the binary classifier is active.

Expected Fix

Replace the check on the raw detection class with a check on the resolved mapping target (child):

# Before
if result.hypothesis.class_id in self.downwards_objects.keys():

# After
if child in self.downwards_objects:

Context

Requester

Requested by @zehdari

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions