Skip to main content
The Inference pipeline replaces the multi-step manual pipeline (Backbone + mask provider + SlideInference + writer) with a single, reusable object. The constructor is the pipeline config; the methods do the work. It caches tissue masks, organizes outputs into a structured workspace, and can serialize its config for reproducibility.

Configure the pipeline

Pick your backend and model — the rest of the guide follows the same steps.

Run the pipeline

The tissue mask is cached to <workspace>/tissue/<slide>.png and reused automatically on later calls.
If the first call raises a connection error, the on-premise server behind api_url isn’t reachable yet. Verify it with requests.get(f"{api_url}/ping", timeout=5) (a healthy server returns {"status": "ok", ...}) and see Server not responding? for how to start it.

Reproducibility

The config is auto-saved to <workspace>/config.yaml on first use. Reconstruct the exact pipeline later:
The same object works across multiple slides — call infer.embed([s1, s2]) (or infer.predict([s1, s2]) for M-Optimus) rather than creating a new Inference per slide. For full cohorts with bulk RNA, see Cohorts.

Workspaces & variants

Your workspace is the directory where all outputs are written. It’s resolved from the config you pass:
Only output_path is required; experiment, run, and variant are appended when set: variant (a string) adds a final sub-folder so you can keep multiple runs side by side — useful for experiments (e.g. comparing mask thresholds or model versions) without overwriting earlier outputs:
A populated workspace looks like: