Skip to content

Conversation

@MateoLostanlen
Copy link
Member

@MateoLostanlen MateoLostanlen commented Dec 28, 2025

⚠️ This PR depends on #538 and must be merged after it.

This PR builds on top of #538 and further refines the detection and sequencing logic by making pose handling explicit and by tightening payload validation and sequence attribution.

What’s new in this PR

Detection model and API changes

  • Dropped Detection.azimuth

  • Made pose_id mandatory for all detections

  • Creation logic now:

    • Explodes multi bbox payloads into one Detection per bbox
    • Stores sibling bounding boxes in others_bboxes
    • Ensures all detections reference the same uploaded media key

Sequencing logic improvements

  • Sequences are now looked up using:

    • camera_id
    • pose_id
    • Recent last_seen
  • For each new detection:

    • Its bbox is parsed

    • A candidate sequence is reused only if the last bbox overlaps

    • Otherwise, a new sequence is created

      • Cone is computed using the pose azimuth
      • First bbox initializes the spatial reference
  • This prevents merging detections that are spatially distant but temporally close

Helpers refactor

  • Bbox parsing moved to a shared scope
  • Overlap and parsing helpers are always available
  • Cone computation consistently relies on pose azimuth

Why this matters

The main goal of this change is to separate unrelated detections coming from the same image.
When a single frame contains both a real fire and a false positive, these detections have nothing in common spatially or semantically and must not end up in the same sequence.

By enforcing one detection per bbox and reusing sequences only when spatial overlap exists, we ensure that fires and false positives evolve independently, even if they originate from the same image and timestamp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants