Skip to content

Add detection sampling support for sequence retrieval #660

Description

@fe51

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 !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions