For the complete documentation index, see llms.txt. This page is also available as Markdown.

Running Inference

Process files, streams, URLs, video, and image groups

Every example opens a session with a Pop, submits media, and reads predictions.

This page is the Python call shapes. What a source is, every kind the platform accepts, and the options that shape how one is processed are covered once in Sources and Options.

A single image

from eyepop import EyePopSdk
from eyepop.worker.worker_types import InferenceComponent, Pop

pop = Pop(components=[InferenceComponent(ability="eyepop.person:latest")])

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    result = endpoint.upload("photo.jpg").predict()
    print(result)

Binary streams

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    with open("photo.jpg", "rb") as file:
        result = endpoint.upload_stream(file, "image/jpeg").predict()

URLs

load_from() hands the platform a URL and lets it fetch, so nothing uploads from your application. Source Types lists every scheme it accepts.

Video

A video yields one prediction per frame, so read until predict() returns None.

Cancel a job mid-stream with job.cancel().

Image groups

A group is one source processed together as a single inference unit, returning one prediction for the whole set — unlike batching below, where each image is independent.

Image groups covers the size limit, the ordering guarantee, and which abilities accept a group.

Batching

Queue several uploads, then collect the results. Each image is an independent inference.

Async with callbacks

Visualizing results

Camera calibration

Every upload and load method takes a camera, which is what lets a depth map become positions in meters:

Set it once for every source with Pop.defaults instead — see Composable Pops.

EyePopPlot.depth(result) overlays a frame's depth map as a heatmap, and EyePopWorldPlot scatters world coordinates into a 3D axes.

Next steps

Last updated