Run in Colab
Step through this example interactively
Basic usage
For multi-modal in-context learning, build a sequence of nodes (images, videos, and text) using the@perceive decorator. Perceptron Mk1 will treat the leading nodes as exemplars and the trailing video + question as the query.
@perceive):
| Parameter | Type | Default | Description |
|---|---|---|---|
reasoning | bool | False | Set True to let the model think through the example + query before answering |
expects | str | "text" | Output structure ("text", "clip", "point", "box", "polygon") |
PerceiveResult object:
text(str): The model’s answer with inline<clip>tags when grounding is requested. See Video Clipping › Output format for the exact tag shape.reasoning(str | None): Chain-of-thought whenreasoning=True.clips/points/boxes/polygons: Only the bucket matchingexpectsis populated; the others areNone. For example,expects="clip"populatesresult.clips(alist[Clip]) and leaves the rest empty.
Example: Inventory check from a single reference image
In this example we show Perceptron Mk1 one example image (a box of mini-wheats) with a brief intent, then ask whether the same item appears in a different shelf-walking video. The model returns a clip pointing at the moment that justifies its answer.Best practices
- One concept at a time: Each ICL call should teach a single concept. If you need to find both mini-wheats and corn flakes, run two calls — don’t ask the model to juggle both from a single example.
- Make the intent statement match the query: The text node between the example and the query should describe what you want done in the same vocabulary you’ll use in the question. The closer the framing, the better Perceptron Mk1 generalizes from the example.
- Reach for
expects="clip"when grounding to time matters: For yes/no answers, plain text is fine. For “show me when,” ask for a clip in the prompt and parseresult.clips.
Run through the full Jupyter notebook here. Reach out to Perceptron support if you have questions.