Repository navigation
feat: accept the temporal score computed on the device - #723
Open
MateoLostanlen wants to merge 5 commits into
Open
MateoLostanlen wants to merge 5 commits into
MateoLostanlen wants to merge 5 commits into
Conversation
The engine may run the temporal smoke model itself and send its score with the detection. Store it on the touched sequences with 'engine' as provenance so the validation worker knows the sequence was already scored.
When the stored score came from the engine, apply the threshold to it instead of calling the temporal API. No frame window: the engine scores a sliding window and sends a fresh score with every frame, so a sequence below threshold waits for the next one. The risk gate still applies.
A scored sequence that receives an unscored frame means the device's temporal service failed open. Drop the stale device verdict so the worker falls back to scoring the sequence itself.
| TERMINAL_VALIDATION_STATUSES = (WINDOW_EXHAUSTED, VALIDATION_FAILED) | ||
| # sequences.temporal_api_version value for a score computed on the device and sent with the | ||
| # detection: the worker applies the threshold to it instead of calling the model. | ||
| TEMPORAL_SCORE_SOURCE_ENGINE = "engine" |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #723 +/- ##
==========================================
- Coverage 94.70% 94.68% -0.02%
==========================================
Files 60 60
Lines 3266 3292 +26
==========================================
+ Hits 3093 3117 +24
- Misses 173 175 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The device scores each tracked object separately, so the detection route now takes temporal_model_scores, a list aligned with bboxes like the crops, and each matched or created sequence receives the score of its own bbox instead of one score shared by every sequence of the request.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POST /detectionstakes an optionaltemporal_model_scoresform field: a list of probabilities (0 to 1, max 3 decimals), one per bbox in the same order, like the crops. Each matched or created sequence receives the score of its own bbox, stored withengineas provenance in the existingtemporal_api_versioncolumn, so no migration.TEMPORAL_MODEL_THRESHOLDto a device score instead of calling the temporal API. Above the threshold the sequence is validated as today (triangulation, notifications). Below it the sequence stays in the DB unvalidated and waits for the next frame, with no 10-frame window since the device scores a sliding window. The risk gate still applies first.pyroclient.create_detectiongains the matching optionaltemporal_model_scoresparameter.Known limitation: a sequence already
window_exhaustedby the API model is not revived when the device later starts sending scores.