Context & obj
The frontend is currently facing performance issues (both API response time and client-side caching) when loading detections for the player. To improve scalability and enable smooth playback, at least a temporary solution, add support for retrieving sampled detections from a sequence.
This can be implemented either as:
- a new endpoint, or
- an optional query parameter on the existing endpoint.
The API should allow the client to specify a sampling interval (e.g. sampling=10), so that only 1 detection out of every 10 is returned.
Example:
Sequence contains 1,000 detections.
Request with sampling=10.
Response contains approximately 100 detections (1 every 10 detections).
The frontend will determine the appropriate sampling interval based on the total number of detections and the desired number of frames to display.
Open questions:
- Should the API expose a sampling interval (e.g. every N detections) or a target sample count (e.g. return N uniformly distributed detections)?
- Since the frontend will also fetch the first and last ~20 detections separately, an interval-based approach may be simpler and more predictable.
happy to discuss it !
Context & obj
The frontend is currently facing performance issues (both API response time and client-side caching) when loading detections for the player. To improve scalability and enable smooth playback, at least a temporary solution, add support for retrieving sampled detections from a sequence.
This can be implemented either as:
The API should allow the client to specify a sampling interval (e.g. sampling=10), so that only 1 detection out of every 10 is returned.
Example:
Sequence contains 1,000 detections.
Request with sampling=10.
Response contains approximately 100 detections (1 every 10 detections).
The frontend will determine the appropriate sampling interval based on the total number of detections and the desired number of frames to display.
Open questions:
happy to discuss it !