-
-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Description
To efficiently load the detections (and therefore the images) associated with a sequence, the frontend needs to know how many detections are contained in that sequence.
Providing the total number of detections would allow the frontend to better manage loading and navigation within a sequence.
It would help frontend issue helping users to navigate through detection pyronear/new-pyro-platform#58
Proposed Change
Add a field in some API responses that returns the number of detections associated with a sequence.
Suggested field name:
detections_count
Affected Endpoints
This information should be returned in the following endpoints:
In Sequences
/api/v1/sequences/{sequence_id}/api/v1/sequences/unlabeled/latest/api/v1/sequences/all/fromdate
in Alerts endpoints returning related sequences info
- /api/v1/alerts/{alert_id}
/api/v1/alerts/{alert_id}/sequences/api/v1/alerts/unlabeled/latest/api/v1/alerts/all/fromdate- Might be not useful here
/api/v1/sequences/{sequence_id}/detections
-> happy to discuss it, to be sure to add it only where it is needed by the frontend
Future Improvement
In a second step, we could support pagination parameters for detections within a sequence.
For example:
- specify an offset (e.g., start from the 7th detection)
Thanks a lot for you help