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

未关闭
#736 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
fastapi, postgresql, python
领域
api, backend, databases

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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".

主要语言
Python
星标
30
派生
15
平均合并
7 天 16 小时
30 天内合并 PR
16

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pyronear/pyro-api 的其他 Issue

查看 pyronear/pyro-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。