Skip to main content

Run in Colab

Step through this example interactively
In this tutorial, we’ll use the Perceptron SDK to run Isaac across an MP4 video of a surfing scene and stitch annotated frames back into a video. You can download the Jupyter notebook here.
1

Install dependencies and configure the SDK

Install the SDK, OpenCV, Pillow, and tqdm. Export an API key so configure() can pick it up.
Create frame_by_frame.py and add the imports + configuration block:
frame_by_frame.py
2

Download the sample video

Grab the shared surfing clip (or point the script at your own MP4).
3

Extract frames (tune the stride)

We sample one JPG every stride frames so long clips stay manageable.
Tuning tip: decrease stride for smoother playback, increase it when you just need periodic samples.
4

Detect surfers in every frame

The @perceive helper wraps Isaac 0.1 so we can send each frame plus a natural-language instruction. The loop captures the raw answer, counts boxes, converts them to pixel coordinates, and draws overlays.
  • result.points_to_pixels() keeps the normalized → pixel conversion consistent.
  • The all_detections list becomes a quick audit trail (counts + captions per frame).
5

Stitch annotated frames back to MP4

OpenCV writes the annotated JPGs back into a video using the original resolution and your preferred FPS.
6

Run the pipeline

Execute the script end-to-end and inspect the outputs. You should see:
  • frames/ and frames_annotated/ populated with numbered JPGs.
  • surf_annotated.mp4 in the project root.
Feel free to tweak the prompt and target classes to match your production objects. We’d be delighted to hear about your project on Discord.