Hand a device-scored sequence back to the API model when the device stops scoring

Aperta
#736 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
fastapi, postgresql, python
Ambito
api, backend, databases

Direzione di ricerca

Read #723 and inspect the sequence scoring worker, the sequences model, and its migrations; the payload does not name file paths or tests. Compare the proposed frame-count fallback with the engine signal alternative, including how each distinguishes an unsupported device model from a failed model. Done means sequences resume API scoring after device scores stop and avoid applying WINDOW_EXHAUSTED from the old device score.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up of #723. Since that PR a frame without a device score keeps the sequence's last device verdict: the API never falls back to its own model once a sequence received a device score, and the stored score only ever rises.

Edge case. If the device stops sending scores for good in the middle of a sequence (pyro-engine fails open until the end of the event, pyronear/pyro-engine#415) while the stored max is below the threshold, frames keep arriving but nothing judges them anymore: no API scoring, no fail-open, no WINDOW_EXHAUSTED. A real fire on that sequence would never alert. Much less likely than the old single-blip reset, which is why #723 accepted it.

Proposal (fe51).

  • store when the device last sent a score, e.g. a device_scored_at column on sequences (migration);
  • in the worker, after N frames without a device score (e.g. MIN_FRAMES), take the API path on the last MAX_FRAMES frames;
  • in that case skip the WINDOW_EXHAUSTED rule based on the old device score.

Failing open there is acceptable because it only happens after N missed frames, not after one.

Alternative to weigh. The engine knows when it fails open. It could say so explicitly (an empty temporal_model_scores=[], or a dedicated flag) instead of sending nothing, and the API would hand the sequence back to its own model on that signal without counting frames and without a new column. Needs the engine to distinguish "no model on this device" from "model down since frame N".

Lingua principale
Python
Stelle
30
Fork
15
Merge medio
7g 16h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pyronear/pyro-api

Tutte le issue di pyronear/pyro-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.