scene_service.ingest.perception_vlm

VLM object detection: ask an OpenAI-compatible vision model (VLM_BASE_URL, VLM_API_KEY, VLM_MODEL) for the objects in an RGB frame and project them into the world frame. An unchanged frame reuses the last answer; failures back off exponentially.

Classes

VLMObjectDetector(*, rgb_fetcher, ...)

Polls rgb_fetcher, asks the VLM, and hands Detection batches to on_detections.

class scene_service.ingest.perception_vlm.VLMObjectDetector(*, rgb_fetcher: ~typing.Callable[[], bytes | tuple[bytes, int | float] | None], camera_to_world_fn: ~typing.Callable[[], tuple[object, str] | None], on_detections: ~typing.Callable[[list[~scene_service.state.data_assoc.Detection]], ~typing.Awaitable[None]], period_s: float = 3.0, intrinsics: ~scene_service.ingest.perception_vlm._CamIntrinsics | None = None, intrinsics_fn: ~typing.Callable[[], ~scene_service.ingest.perception_vlm._CamIntrinsics | None] | None = None, frame_change_threshold: float | None = None, cache_max_age_s: float | None = None, failure_backoff_base_s: float | None = None, failure_backoff_max_s: float | None = None, clock: ~typing.Callable[[], float] = <built-in function monotonic>)[source]

Bases: object

Polls rgb_fetcher, asks the VLM, and hands Detection batches to on_detections.

property inference_counts: dict[str, int]
async start() → None[source]
async stop() → None[source]