Pop Defaults
Set source options once on the Pop instead of repeating them on every source
Most source options describe the scene rather than the request — the region of a camera's frame that matters, the rate worth analyzing it at, whether to gate on motion. Repeating them on every source is noise, and one call that forgets them is a silent behavior change.
defaults puts them on the Pop instead. Every source the Pop processes takes them, and any source can still override them.
What can be defaulted
fps
motionDetect, motionSensitivity, motionThreshold, motionGap, motionGridX, motionGridY
camera
Only options that describe the scene and the capture belong here. A source's identity and transport — its URL, whether it is live, its component parameters — are deliberately not defaultable: there is no sensible value for every source to share.
Setting defaults
from eyepop import EyePopSdk
from eyepop.data.types.asset import RectangleArea
from eyepop.worker.worker_types import InferenceComponent, Pop, SourceDefaults
pop = Pop(
components=[InferenceComponent(ability="eyepop.person:latest")],
defaults=SourceDefaults(
fps="1/1",
roi=RectangleArea(x=160, y=0, width=320, height=480),
motionDetect=True,
motionSensitivity=0.6,
),
)
with EyePopSdk.sync_worker(pop=pop) as endpoint:
# takes fps, roi and motion detection from the Pop
job = endpoint.load_from("rtsp://camera.example.com/stream1")
while result := job.predict():
print(result)import { AreaType, EyePop, PopComponentType } from '@eyepop.ai/eyepop'
const endpoint = await EyePop.workerEndpoint({
pop: {
components: [{ type: PopComponentType.INFERENCE, ability: 'eyepop.person:latest' }],
defaults: {
fps: '1/1',
roi: { type: AreaType.RECTANGLE, x: 160, y: 0, width: 320, height: 480 },
motionDetect: true,
motionSensitivity: 0.6,
},
},
}).connect()
// takes fps, roi and motion detection from the Pop
const results = await endpoint.process({
source: { url: 'rtsp://camera.example.com/stream1' },
})Overriding per source
Defaults are merged field by field, and anything the source sets wins. A source that gives its own fps but no roi keeps its own frame rate and takes the Pop's region — it does not lose the whole block by setting one field of it. The region is one field whichever shape it is, so a Pop can default a contour exactly as it defaults a rectangle, and a source overriding it replaces the whole region rather than merging points into it.
Merging happens server-side, so a source's options and the Pop's defaults are combined the same way from every SDK.
When to use them
A Pop that serves one camera. Its region and frame rate are properties of that installation, not of each frame. Put them on the Pop and every source is correct by construction — including sources submitted by code that does not know about the installation.
A persistent Deployment. The Pop is configured once and lives on; callers just push sources at it.
Many callers, one policy. Changing the Pop changes every future source at once, rather than needing every call site updated.
Set options on the source instead when they genuinely differ per request — a prompt, a one-off crop, a video that should stream rather than buffer.
Next steps
Source Options — what each option does
Pops — how a Pop is composed
Last updated
