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

Examples

Worked Pop pipelines, from a single ability to multi-stage chains

Each example below is a complete Pop. Pass one to a worker session and it runs against every source you submit. For the attributes these examples use, see Components and Forwarding; for the abilities they name, Models.

from eyepop import EyePopSdk

with EyePopSdk.sync_worker(pop=pop) as endpoint:
    result = endpoint.upload("street.jpg").predict()
import { EyePop } from '@eyepop.ai/eyepop'

const endpoint = await EyePop.workerEndpoint({ pop }).connect()

One ability

The simplest Pop runs a single ability over the whole frame.

from eyepop.worker.worker_types import Pop, InferenceComponent

pop = Pop(components=[
    InferenceComponent(ability="eyepop.person:latest"),
])
import { PopComponentType } from '@eyepop.ai/eyepop'

const pop = {
    components: [
        { type: PopComponentType.INFERENCE, ability: 'eyepop.person:latest' },
    ],
}

Detect, crop, then read

The canonical chain: find vehicles, crop each one, find the plate inside it, crop that, and run OCR on the result. Nothing round-trips to your code between stages.

orientationTargetAngle straightens the cropped plate before OCR, which is what makes angled plates readable. topK keeps only the best plate per vehicle.

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

pop = Pop(components=[
    InferenceComponent(
        ability="eyepop.vehicle:latest",
        categoryName="vehicles",
        confidenceThreshold=0.8,
        forward=CropForward(
            includeClasses=["car", "truck"],
            targets=[
                InferenceComponent(
                    ability="eyepop.vehicle.license-plate:latest",
                    topK=1,
                    forward=CropForward(
                        orientationTargetAngle=0.0,
                        boxPadding=0.1,
                        targets=[
                            InferenceComponent(
                                ability="eyepop.text.recognize.landscape:latest",
                                categoryName="license-plate",
                            ),
                        ],
                    ),
                ),
            ],
        ),
    ),
])

Track people across frames

Tracking hangs off the detector whose objects it should follow. Naming a re-identification ability adds appearance matching, so a person who is briefly occluded keeps their trackId instead of becoming a new object.

Hide a stage the caller never asked for

Facial expression analysis needs a face detector in front of it, but the caller wants expressions attached to people — not a separate list of face boxes. Marking the face detector hidden keeps its output out of the response while still feeding the stage below it, and because it produces object detections, the expression results attach to the enclosing person.

Segment, then trace an outline

A segmentation mask is a per-pixel result. A contour finder turns it into a polygon your application can draw or measure. The finder takes a full forward, because it works on the mask the segmenter produced rather than on a new crop.

Count objects inside one mask

When a segmenter returns a single mask covering many touching objects, a component finder splits it into separate sub-objects. erode shrinks the mask first, breaking the thin bridges between objects that are really separate — here by a kernel 20% of the mask's own size. See How erode and dilate reshape the mask for combining it with dilate.

Find anything, then ask about it

An open-vocabulary ability takes its target through params rather than a fixed label set, and a vision-language ability downstream answers a question about each crop.

Run two analyses side by side

Top-level components run in parallel on the full frame. Use this when a Pop needs two unrelated answers about the same media rather than a chain.

Always return something

crop_with_full_fallback runs the downstream stage on each detection when the parent found objects, and on the whole frame when it found none — so media that defeats the first stage still produces an answer.

Next steps

Last updated