Webcam Vision
Technical field notes / 001
Open experiment ↗
Under the hood

Movement,
made legible.

From webcam pixels to body landmarks, raised fingers and a window that responds to your head. A small browser experiment with two core libraries.

VANILLA JAVASCRIPTLOCAL INFERENCENO BUILD STEP
FIG. 01 / LANDMARK STUDY● SCHEMATIC
POSE / 33 HAND / 21 x → y ↓
VIDEO → LANDMARKS → RESPONSEGPU / CPU FALLBACK
02external JavaScript
libraries
04vision model
assets
00frontend frameworks
or bundlers

01 / The libraries

Exact versions from the source
Vision & inferencev0.10.21

MediaPipe Tasks Vision

@mediapipe/tasks-vision

Runs the object, face, hand and body-pose detectors in the browser. Its FilesetResolver loads the WebAssembly runtime; each task loads its own model asset. The app tries the GPU delegate, then falls back to CPU.

index.html + parallax.htmlES MODULE / CDN
3D renderingv0.170.0

Three.js

three

Draws the head-tracked, one-foot-deep box using WebGL. Custom projection math shifts the viewpoint with your estimated eye position, making the browser window act like an opening into a scene.

parallax.html onlyES MODULE / CDN

02 / What the camera sees

Select a model to inspect
PoseLandmarker

Pose Landmarker Lite

Returns 33 body landmarks per person. The app draws the body skeleton and uses joint positions to estimate “arm up,” “sitting,” “standing” or “upper body.” Face landmarks are omitted from the pose overlay in favor of the separate face detector.

pose_landmarker_lite.task

03 / Pixels to interaction

Processing happens in the browser
01 → CAPTURE

Webcam frames

getUserMedia() feeds a video element. Video is requested; audio is disabled.

02 → INFER

MediaPipe tasks

Models produce boxes, keypoints and landmarks from the current video frame.

03 → INTERPRET

Custom JavaScript

Joint comparisons count raised fingers and label posture. Eye spacing estimates head position for parallax.

04 → DRAW

Canvas or WebGL

Canvas 2D draws detection overlays. Three.js renders the separate 3D parallax scene.

The app code processes camera frames locally; it contains no frame-upload or recording path. Startup still fetches JavaScript and WASM from jsDelivr, and model files from Google Cloud Storage. This overview itself has no external dependencies and does not access the camera.

04 / The supporting pieces

Native APIs + handwritten logic
Interface
Plain HTML, CSS and JavaScript modules. No React, UI kit, package install or compile step.
Browser APIs
MediaDevices, HTML video, Canvas 2D, WebGL, requestAnimationFrame and the Fullscreen API.
Calibration
Browser localStorage remembers parallax settings such as display size, camera offset and calibrated focal length.
Local server
Node.js built-ins: node:http, node:fs/promises and node:path. No Express. server.mjs serves files on 127.0.0.1:8765.
Launcher
serve.sh starts the Node server and opens the default macOS browser. Camera use requires browser permission and localhost or HTTPS.