Public
Edited
Jan 14, 2023
Insert cell
Insert cell
Insert cell
viewof table = Inputs.table(output)
Insert cell
Insert cell
p5(sketch => {
let mobileNet
let video
function onModelReady() {
mobileNet.predict(onPrediction)
}
function onPrediction(error, results) {
if (error) mutable output = [error]
else mutable output = results

onModelReady()
}

sketch.setup = function() {
sketch.createCanvas(640, 480)
sketch.background(0)
video = sketch.createCapture(sketch.VIDEO)
video.hide()
mobileNet = ml5.imageClassifier('MobileNet', video, onModelReady)
};
sketch.draw = function() {
sketch.image(video, 0, 0)
}
})
Insert cell
Insert cell
import { p5 } from "@tmcw/p5"
Insert cell
ml5 = import("https://cdn.skypack.dev/ml5@0.1.1").then(x => x.default)
Insert cell
mutable output = []
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