Published
Edited
Jul 26, 2021
1 fork
Insert cell
Insert cell
Insert cell
videoHeight = 480
Insert cell
Insert cell

mutable camera = "Waiting..."
Insert cell
Insert cell
Insert cell
Insert cell
function takePhoto () {
const context = DOM.context2d(videoWidth, videoHeight);
context.drawImage(video, 0, 0, videoWidth, videoHeight);
return context.canvas
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
poses = {
if (photoCanvas) {
return await detector.estimatePoses(photoCanvas);
}
return [];
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
markPoses(photoCanvas, poses, showLabels, showFacePoints, '#ff0000', '#eeeeee')
Insert cell
poses[0].keypoints
Insert cell
Insert cell
model = poseDetection.SupportedModels.MoveNet
Insert cell
detector = await poseDetection.createDetector(model)
Insert cell
import {color} from '@jashkenas/inputs'
Insert cell
import {tf, requireTF, drawPose, drawLine, drawPoint, facePoints, sparkbar} from '@randomfractals/tensorflow-movenet-intro'
Insert cell
poseDetection = requireTF("@tensorflow-models/pose-detection@0.0.3/dist/pose-detection.js")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more