Train and publish
In Teachable Machine, give each class a useful name such as jump, card, or clap. Export the model and copy its share URL.
TurboWarp extension · user guide
The extension connects a Teachable Machine Pose, Image, or Audio model to TurboWarp. Your camera frame or microphone audio becomes label probabilities that scripts can read as labels, scores, and Boolean conditions.
Kamishibai DSL 4.0 bundle
Click the documentation button immediately below the Teachable Machine member
heading. The bundled blocks retain the model URL, recognition, preview, label, score,
threshold, and lifecycle behavior described here. The TurboWarp TM 2.0.0 package line keeps the public lifecycle
opcodes startRecognition, stopRecognition, and
isRecognizing, with no legacy aliases. Configurable SVG pose overlay blocks
remain available in pose mode, while image mode uses label scoring without keypoints. Latest-needed model initialization
and cancellation controls remain host APIs documented under Composition API.
Quick start
You need a published Teachable Machine Pose, Image, or Audio model, the matching camera or microphone permission, and network access. Load the extension as a custom extension with Run extension without sandbox enabled, then place these blocks in order.
In Teachable Machine, give each class a useful name such as jump, card, or clap. Export the model and copy its share URL.
Paste the model folder URL. A missing trailing slash is added automatically.
Allow camera or microphone access. The extension starts the required input and loads the model automatically if needed.
Read the top label, test one class, or use a confidence value to control your project.
How it works
While recognition is running, the extension repeatedly samples the selected camera or microphone input, runs the model in the browser, and stores a probability for every class in your model.
current label is the class with the highest probability. confidence is that class’s score, rounded to two decimal places. confidence of [NAME] reads one named class.
The preview is a camera canvas placed over the TurboWarp stage. It does not become a sprite and does not change model input when hidden. It is mirrored by default, and can switch between mirrored and unmirrored while the camera is running without changing recognition input.
Version 1.11.0 overlays the 17 recognized PoseNet joints and 12 standard bone connections as SVG by default. Blocks control visibility, each joint's color, opacity, and radius, shared bone color, opacity, and width, the minimum confidence, and independent confidence scaling for those visual properties.
The extension requests a normal Canvas2D context for its owned camera canvas. Physical-camera measurements of the 320x240, one-draw/one-read path did not show a repeatable end-to-end benefit from willReadFrequently; the hint helped a different read-heavy condition with four or more reads per draw, but could make video drawing more expensive. Chrome may therefore emit its Canvas2D readback warning during CPU inference. Other TurboWarp canvases are unchanged, and hosts do not need a global Canvas or Console patch.
start camera opens the camera and displays the preview.start recognition starts the required input and loads the model when necessary.stop recognition clears live results, stops audio listening, and leaves the camera available.stop camera stops recognition, releases media tracks, and removes the preview.hide camera preview only changes what is shown; recognition can continue.Composition hosts
The composition API lets an application host cancel obsolete model demand while camera startup continues independently. The first inference waits for both the active input and one registered model.
SHA checks for separate PoseNet files run in parallel. Shared descriptor verification overlaps classifier loading, but unverified bytes never reach TensorFlow. Camera getUserMedia() and video.play() may run alongside the complete model path.
Create the composition with modelInitializationPolicy: 'latest-needed' and pass an AbortSignal to registerPoseModel(). At most one heavy request is active and one newest request is pending. A cancelled model is never published to the registry.
Choosing a result
Default builds expose immediate probabilities. Builds that enable the optional temporalPoseScoring feature also expose accumulated scores for steadier decisions.
Best for quick gestures. The answer follows every frame, so it reacts fast but may flicker near a decision boundary.
Use label is [NAME] with confidence at least [THRESHOLD]?. Thresholds are clamped to 0–1; 0.75 is a practical starting point.
Best for sustained poses. Evidence is added over elapsed time while older evidence decays, reducing one-frame changes.
The reporter returns an empty label until the best positive score reaches the threshold. Hidden-tab time is excluded. Stopping recognition or resetting clears all accumulated scores.
Block guide
Reporter values are empty or zero before the first usable recognition result and after recognition stops. Boolean status blocks are useful when coordinating startup.
Configure and check the Teachable Machine model.
set model URL to [URL] changes the model and clears the previously loaded one.load model fetches model.json and metadata.json.model is loaded? reports readiness.Teachable Machine version reports the extension build.Control capture separately from recognition.
start camera · stop camera · camera is running?refresh camera list detects available video inputs.set camera to [CAMERA] · default, front, back, or a detected devicecamera count · camera device ID · camera device nameshow camera preview · hide camera previewcamera preview is visible?set camera preview opacity to [OPACITY] clamps opacity to 0–1.set camera preview position to [POSITION]set camera preview to [MIRRORING] · mirrored (default) or unmirroredcamera preview mirroring reports the current setting.set pose overlay [VISIBILITY] · pose overlay is visible?set [PART] joint color [COLOR] opacity [OPACITY] radius [RADIUS]set pose bone color [COLOR] opacity [OPACITY] width [WIDTH]set pose overlay minimum confidence to [CONFIDENCE]set pose [PROPERTY] confidence scaling [STATE]Camera labels may appear only after permission is granted. Device IDs are browser- and machine-specific. Switching a running camera preserves the model, recognition state, and preview settings; a failed switch attempts to restore the previous camera.
Start the loop, read scores, and make decisions.
start recognition · stop recognition · recognition is running?current label · confidence · confidence of [NAME]label is [NAME]? uses a fixed 0.75 threshold.label is [NAME] with confidence at least [THRESHOLD]?Measure startup and show useful failure details.
camera startup time (ms)model load time (ms)first recognition time (ms)last error keeps the latest runtime error message.These blocks appear only when the extension build enables temporalPoseScoring: set accumulated pose accumulation [ACCUMULATION] decay [DECAY], set accumulated pose threshold [THRESHOLD], reset accumulated pose scores, accumulated pose, accumulated score, and accumulated score of [NAME]. Decay is the fraction retained after one second (0–1), and a decay change takes effect the next time recognition starts.
Troubleshooting
Check last error first. Most setup failures come from permissions, an incorrect model URL, blocked network requests, or loading the extension in the sandbox.
Allow camera permission for the TurboWarp page and make sure another application is not exclusively using the camera. The page must run in a secure context (HTTPS or localhost). Then run start camera again.
Use the published Teachable Machine model folder URL—not a link to the editor or an individual JSON file. The extension appends model.json and metadata.json to that URL. Confirm that the network allows jsDelivr and Teachable Machine model hosting.
Add more varied training examples, keep the whole body visible, improve lighting, and test a threshold such as 0.75. If your build exposes accumulated-pose blocks, use them for a pose that must be held for a short time.
Run show camera preview, set opacity above zero, and choose a supported position. Packaged projects with a modified stage DOM may not support preview attachment; last error explains stage-detection failures.