Skip to content

Latest commit

 

History

History
188 lines (186 loc) · 11.1 KB

File metadata and controls

188 lines (186 loc) · 11.1 KB

Roboflow Supervision for the browser

Render computer vision media as one synchronized scene.

supervision is a browser-native TypeScript library for interactive computer vision media. A media session keeps the visible frame, detections, annotation renderers, interaction, and playback on one timing reference.

Explore Annotation renderers Post processors Quickstart Recipes API reference

npm install supervision

One renderer-owned scene

Media frame Masks, geometry & assets Labels & interaction

The session owns composition and timing. Your application owns the surrounding UI, model calls, product workflow, and data persistence.

Interactive playground

See detections move with the media—not above it.

This looping basketball fixture combines segmentation masks, detection boxes, labels, and pose skeletons. Toggle annotation renderers and tune their styles while the same browser media session keeps every annotation in sync.

<iframe allow="autoplay" data-supervision-playground-src="demo/?embed=docs-playground" loading="lazy" title="Interactive basketball detection playground" ></iframe>

The playground is a small consumer of supervision, using the same session, detection, annotation renderer, and style contracts available to your application. Learn about detection rendering

Quick start

Create one session for one media item.

Give a session a container and media. It prepares the renderer, exposes state for your UI, and provides playback and detection controls without asking React or your app to run another frame loop.

Learn how media sessions work
import { createMediaSession } from "supervision";
const container = document.querySelector<HTMLElement>("#viewer");

if (!container) { throw new Error("Missing #viewer container."); }

const session = await createMediaSession({ container, media: "/media/example.mp4", renderer: { autoPlay: true, loop: true }, }); session.subscribe((state) => { console.log(state.status, state.activities); });

Browser capabilities

The parts of a serious CV viewer, kept in one system.

Use the common session API first; use the deeper data, media, and editing APIs when the integration needs them.

01

Media and playback

Images, video, and browser media streams with preparation, normalization, seeking, stepping, rate control, and current-frame refresh.

Media preparation 02

Detection rendering

Annotation renderers for boxes, masks, polygons, polylines, keypoints, labels, and multi-instance regions, selected from canonical media timing.

Detections and rendering 03

Interaction and editing

Renderer-synchronized picking plus host-owned editing engines, persistence, undo/redo policy, and annotation commits.

Interactive picking

Architecture

Portable semantics, platform-specific rendering.

The public browser package is built around a small platform-neutral core. Rendering and media engines stay behind that boundary so applications depend on sessions, detections, annotation renderer descriptors, and style contracts—not backend objects.

Private semantic core

supervision-js-core

Detections, geometry, masks, timelines, annotation renderer descriptors, styles, sources, picking, editing vocabulary, lifecycle contracts, and pure utilities.

Published browser package

supervision

createMediaSession(), browser media preparation, playback, render preparation, storage adapters, and the first 2D renderer.

Private experiment

supervision-js-react-native

Native session and rendering experiments that share core semantics but are not part of the browser package or its compatibility promise.

01

Semantic data

Detection frames and compact masks come from memory, chunks, IndexedDB, or your own source.

02

Prepared window

A bounded set of nearby frames is parsed and prepared for rendering without retaining an entire video in memory.

03

Active scene

Media and annotations are selected by the same media timing reference and presented together.

Public boundary

Start with the session. Keep implementation details private.

The public API is deliberately smaller than the implementation. It gives applications media sessions, detections, annotation renderer descriptors, styles, interaction, state, and lifecycle primitives without coupling them to a scene graph, decoder, worker protocol, or prepared-artifact format.

Explore the public API

Applications work with

sessions · detections · annotation renderers · styles · sources · state

Applications do not need to know

Pixi scenes · media adapters · workers · prepared artifacts

Keep learning

Choose the path that matches your integration.

QuickstartInstall, mount, and render your first detections. Annotation renderersSelect and style boxes, masks, labels, polygons, pose, and regions in live playgrounds. Post processorsApply ordered tracking to streaming boxes, masks, and keypoints in a browser worker. RecipesApply focused patterns for sources, picking, lifecycle, and React.