Skip to content

feat(notebooks): replay coherent demo scenarios - #67

Open
Majyles wants to merge 1 commit into
pyronear:mainfrom
Majyles:feat/coherent-demo-scenarios
Open

Majyles wants to merge 1 commit into
pyronear:mainfrom
Majyles:feat/coherent-demo-scenarios

Conversation

@Majyles

@Majyles Majyles commented Oct 22, 2026

Copy link
Copy Markdown

Why

As a newcomer, the sample alerts of the dev environment were confusing: footage from distant towers (Aveyron, Chile…) sent to Seine-et-Marne cameras, camera ids in the notebook not matching the seed CSV, unrelated sequences merged into the same alerts. Closes #26 (and goes in the direction of #11).

What

  • New scenarios.py module: each scenario replays real footage with the camera that recorded it, so images, camera names and cones on the map agree. Cameras are referenced by name, not id.
  • send_real_alerts.ipynb rewritten: a Quick start cell sends every scenario (~12 s), a Start over cell deletes every alert/sequence/detection through the API, then one short cell per scenario explains what to look at in the platform, plus a section to send your own sequence folder with send_sequences().
  • Scenarios: a fire triangulated by three towers (2025-07-14, sdis-77), a fire seen by a single camera (Videlles, sdis-77), a fire for sdis-07 (Serre-de-Barre).
  • Detections keep the real capture times of the samples, shifted to now, so the alert timeline replays the real pace of the fire without waiting for it.
  • Each detection comes with a close-up per box, and each camera gets its last image, so the "close-up" button and the dashboard show real views.
  • Same features from a shell: python scenarios.py [name...], python scenarios.py --delete-all-alerts.
  • README: documents the scenarios; also fixes the users CSV path and an unclosed code block.

Notes on the sample data

  • videlles-02-300: the landscape matches the map at ~120°, not 300° (forest shapes, road landmarks), so the scenario uses 120.
  • Brison-03 / Serre-de-Barre (2025-09-29): Brison's box has a 0 confidence, and the triangulated position falls 600 m from Serre-de-Barre while the image shows the smoke several km away (nearly aligned cones). Only Serre-de-Barre is used.
  • In selection-true-positives, the prediction files have a 0 confidence, so the ground-truth labels are used instead.
  • The samples start with a burst of frames ~1 s apart, then ~30 s: likely buffered frames uploaded at once when the smoke was detected. This leading burst is spread at the typical gap; regular sequences are left untouched.

Tested

Clean database: quick start, start over, full notebook executed end to end, and scenarios.py from a shell. Coherent alerts each time, timelines with one step per frame, close-ups displayed. Pre-commit hooks pass.
Description generated with Claude Code.

Rewrite send_real_alerts.ipynb around a scenarios.py module so that every
alert of the dev environment replays real footage with the camera that
recorded it: images, camera names and cones on the map now agree.

- Cameras are referenced by name (the DB ids do not match the seed CSV ids).
- Three scenarios: a fire triangulated by three towers (sdis-77), a fire seen
  by a single camera (sdis-77) and a fire for sdis-07.
- Quick start cell sending every scenario in about 12 s, and a Start over
  cell deleting every alert, sequence and detection through the API.
- Detections keep the real capture times of the samples (shifted to now), so
  the alert timeline replays the real pace of the fire; the leading burst of
  ~1 s gaps found in the samples is spread at the typical gap.
- Each detection comes with a close-up per box, and each camera gets its last
  image, so the "close-up" button and the dashboard show real views.
- send_sequences() replays any sequence folder, and can keep an unrelated
  fire out of other fires' alerts.
- The scenarios can also be sent from a shell: python scenarios.py
- README: document the scenarios, fix the users CSV path and an unclosed
  code block.

Closes pyronear#26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean notebook send_real_alerts

1 participant