s6.app package

Subpackages

Submodules

s6.app.dataset module

Manage dataset directories locally and in R2.

This master command provides subcommands to list, upload, download, and delete dataset directories. A “dataset directory” is any folder that contains data.jsonl (see examples under ./temp). By default, the command works under the local root ./temp and stores remote datasets under the R2 prefix datasets/<name>/ in the configured bucket.

Defaults

  • Local root: ./temp (override with --root)

  • Remote base prefix: datasets/ (override with --remote-prefix)

  • R2 connection defaults (bucket/endpoint) match the R2 CLI defaults and can be overridden with flags or environment variables.

  • Upload/download use multiple threads and always show progress by default.

Examples

  • List local datasets: s6 dataset list

  • List remote datasets: s6 dataset list --remote

  • Upload local dataset ./temp/diverse_2 to R2: s6 dataset upload diverse_2

  • Download remote dataset into ./temp/fail_case: s6 dataset download fail_case

  • Delete a remote dataset: s6 dataset delete fail_case --yes

s6.app.dataset.cmd_delete(args: Namespace) None
s6.app.dataset.cmd_download(args: Namespace) None
s6.app.dataset.cmd_list(args: Namespace) None
s6.app.dataset.cmd_upload(args: Namespace) None
s6.app.dataset.main() None

s6.app.ds module

s6.app.ds.main(*args)
s6.app.ds.parse_and_preview(dataset_path: str)

Parses the dataset file and previews the images with bounding boxes and center points.

Parameters:

dataset_file (str) – Path to the dataset file (JSON or JSONL format).

s6.app.id module

Interactive camera-ID ROI authoring using ArUco markers.

This tool visualizes detected ArUco markers (DICT_4X4_50) on the incoming camera frames and lets you draw rectangular regions that define which camera ID is being viewed based on where markers appear. It writes the configuration to configs/camera_ident.config.json as rule_config without any negate logic.

Behavior - Captures frames from the stream and takes the 10th frame batch to avoid

startup exposure issues. No live view is used after that.

Controls - Drag mouse: draw ROI for the active role - r: cycle role (B, L, R) - d: cycle displayed camera view - m: toggle current region type (positive/negative) - c: clear all ROIs for all roles - ENTER/SPACE: save and exit

s6.app.id.main()

s6.app.instrument_length_calibrate module

s6.app.main module

Application entrypoint loader for Sense Core.

Provides a small CLI that discovers and runs subcommands implemented in s6.app modules. It delegates to s6.utils.entrypoint_loader.EntryPointLoader and skips private or test-only modules (those starting with _ or test_).

s6.app.main.main()

Run the dynamic entrypoint loader.

Loads modules under s6.app and executes the selected subcommand if provided; otherwise prints a help summary.

Return type:

None

s6.app.monitor module

s6.app.monitor.main()

s6.app.perf-stats module

s6.app.stream module

FastAPI-based video stream server utilities.

Defines a thin preset server for OV2311 sensors by subclassing s6.utils.FastAPIVideoStreamServer, plus a CLI main that starts the server. Camera indices [0, 1, 2] are used by default.

class s6.app.stream.OV2311CaptureServer(device_ids: List[int], capture_width: int = 1280, capture_height: int = 960, capture_fps: int = 50, capture_auto_exposure: int = 1, capture_exposure: int = -9)

Bases: FastAPIVideoStreamServer

Capture server preset for OV2311 cameras.

Inherits all behavior from s6.utils.FastAPIVideoStreamServer. No overrides are required because device programming for OV2311 is integrated in the base server.

s6.app.stream.main(*args)

Start the OV2311 capture server.

Parameters:

*args – Unused positional arguments accepted for CLI compatibility.

Notes

Launches an asyncio event loop and serves FastAPI endpoints for streaming frames. Cameras with indices [0, 1, 2] are opened by default.

s6.app.test module

s6.app.test.main()

s6.app.track module

Entry points for running and serving the S6 tracking pipeline.

This module provides two primary entry points:

  • service_mode(…) runs a context generator and optional inference pipeline in a background process and exposes a FastAPI service with: - WebSocket endpoint ws/telemetry streaming the current context’s

    export payload and a small stats block.

    • HTTP endpoint GET /queue_size reporting the current telemetry queue size.

  • main() implements the CLI used during development and operations. It can acquire frames from multiple sources (network cameras, local USB cameras, datasets on disk, or a database), optionally record datasets, run the inference pipeline headlessly or with a Qt/VisPy UI, and optionally expose the telemetry service described above.

The context generators are defined in s6.app._contextgenerators. The inference pipeline is defined in s6.app._pipeline.pipeline and is responsible for constructing the context[“export”] structure consumed by telemetry.

s6.app.track.main()

CLI entry point for running the tracking stack.

This command can: - acquire frames from network cameras (--input network), local USB

cameras (--input local), a dataset directory (--input /path), or a database (--input db:<dataset_name>);

  • record datasets to --output-dataset (with optional -x/--output-log);

  • run the inference pipeline headlessly or with a Qt/VisPy UI (-v/--ui);

  • optionally expose a telemetry service (--service).

It selects a concrete context generator from s6.app._contextgenerators based on --input and, unless --record-only is set, applies s6.app._pipeline.pipeline() to each produced context.

The process runs in the foreground in headless mode. With --ui, it starts a Qt application and communicates with a background process via a multiprocessing queue. With --service but without --ui, it starts the FastAPI/uvicorn telemetry server.

s6.app.track.service_mode(context_generator, pipeline_func, host='0.0.0.0', port=8001)

Start a lightweight telemetry service around a running pipeline.

Runs the provided context_generator (and optional pipeline_func) in a separate process and exposes a FastAPI app that streams telemetry to clients. Messages are produced whenever the generator publishes a context.

The service exposes two endpoints: - GET /queue_size — returns {"queue_size": int | null} with the

current backlog of the inter-process queue.

  • WS /ws/telemetry — streams JSON objects of the form {"export": <dict>, "stats": {"queue_size": int | null}} where export mirrors the root context["export"] structure produced by the pipeline (see s6.app._pipeline_tip_detection_stage.tips_solve).

Parameters:
  • context_generator (ContextGenerator-like) – A generator object exposing run(pipeline_func, queue, command_queue) which produces per-frame context dictionaries.

  • pipeline_func (callable | None) – The inference function applied to each context (may be None to only relay contexts without inference).

  • host (str, optional) – Bind address for the FastAPI/uvicorn server, by default "0.0.0.0".

  • port (int, optional) – TCP port for the server, by default 8001.

Module contents