Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/bodyPose-blazePose-keypoints/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta charset="UTF-8" />
<title>ml5.js bodyPose BlazePose Detection Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-pose.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/bodyPose-blazePose-skeleton/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta charset="UTF-8" />
<title>ml5.js bodyPose BlazePose Skeleton Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-pose.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/bodyPose-keypoints/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta charset="UTF-8" />
<title>ml5.js bodyPose Detection Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-pose.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/bodyPose-skeletal-connections/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta charset="UTF-8" />
<title>ml5.js bodyPose Skeleton Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-pose.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/bodySegmentation-mask-background/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js bodySegmentation Mask Background Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-segmentation.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/bodySegmentation-mask-body-parts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js bodySegmentation Parts Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-segmentation.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/bodySegmentation-mask-person/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js bodySegmentation Mask Person Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-segmentation.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/bodySegmentation-select-body-parts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js bodySegmentation Parts Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-body-segmentation.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-bounding-box/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Bounding Box Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-keypoints-from-parts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Keypoints from Parts Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-keypoints/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Webcam Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-parts-bounding-box/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Parts Bounding Box Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-parts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh p5 Webcam Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-shapes-from-parts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Shapes from Parts Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-single-image/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Image Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-triangle-mesh/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Triangle Mesh Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/faceMesh-uv-map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js faceMesh Webcam Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-face-mesh.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/handPose-detect-start-stop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js handPose Start and Stop Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-hand-pose.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/handPose-keypoints/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js handPose Webcam Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-hand-pose.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/handPose-parts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js handPose p5 Webcam Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-hand-pose.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/handPose-single-image/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js handPose Image Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-hand-pose.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/handPose-skeletal-connections/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js handPose Skeletal Connection Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-hand-pose.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/imageClassifier-single-image/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js imageClassifier Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-image-classifier.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/imageClassifier-teachable-machine/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js imageClassifier + Teachable Machine Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-image-classifier.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/imageClassifier-webcam/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js imageClassifier Webcam Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-image-classifier.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
20 changes: 20 additions & 0 deletions examples/ml5-bodyPose/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
👋 Hello! This is an ml5.js example made and shared with ❤️.
Learn more about the ml5.js project: https://ml5js.org/
ml5.js license and Code of Conduct: https://github.com/ml5js/ml5-next-gen/blob/main/LICENSE.md

This example demonstrates pose tracking on live video through ml5.bodyPose with BlazePose model.
-->

<html>
<head>
<meta charset="UTF-8" />
<title>ml5.js bodyPose BlazePose Detection Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5-body-pose.js"></script>
</head>

<body>
<script src="sketch.js"></script>
</body>
</html>
50 changes: 50 additions & 0 deletions examples/ml5-bodyPose/sketch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 👋 Hello! This is an ml5.js example made and shared with ❤️.
* Learn more about the ml5.js project: https://ml5js.org/
* ml5.js license and Code of Conduct: https://github.com/ml5js/ml5-next-gen/blob/main/LICENSE.md
*
* This example demonstrates pose tracking on live video through ml5.bodyPose with BlazePose model
*/

let video;
let bodyPose;
let poses = [];

function preload() {
// Load the bodyPose model
bodyPose = ml5.bodyPose("BlazePose");
}

function setup() {
createCanvas(640, 480);

// Create the video and hide it
video = createCapture(VIDEO);
video.size(640, 480);
video.hide();

// Start detecting poses in the webcam video
bodyPose.detectStart(video, gotPoses);
}

function draw() {
// Draw the webcam video
image(video, 0, 0, width, height);

// Draw all the tracked landmark points
for (let i = 0; i < poses.length; i++) {
let pose = poses[i];
for (let j = 0; j < pose.keypoints.length; j++) {
let keypoint = pose.keypoints[j];
fill(0, 255, 0);
noStroke();
circle(keypoint.x, keypoint.y, 10);
}
}
}

// Callback function for when bodyPose outputs data
function gotPoses(results) {
// Save the output to the poses variable
poses = results;
}
2 changes: 1 addition & 1 deletion examples/neuralNetwork-color-classifier/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js neuralNetwork Color Classifier Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-neural-network.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/neuralNetwork-load-model/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js neuralNetwork Loading Pre-trained Model Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-neural-network.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/neuralNetwork-mouse-gesture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js neuralNetwork Gesture Classifier Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-neural-network.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/neuralNetwork-train-and-save/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js neuralNetwork Training and Saving Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-neural-network.js"></script>
</head>
<body>
<script src="sketch.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/neuroEvolution-flappy-bird/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js neuralNetwork Neuroevolution Flappy Bird</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-neural-network.js"></script>
</head>
<body>
<script src="bird.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/neuroEvolution-sensors/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js neuralNetwork Neuroevolution Sensors</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-neural-network.js"></script>
</head>
<body>
<script src="food.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/neuroEvolution-steering/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ml5.js neuralNetwork Neuroevolution Steering</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-neural-network.js"></script>
</head>
<body>
<script src="glow.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/sentiment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<head>
<title>ml5.js Sentiment Analysis Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-sentiment.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/soundClassifier-speech-command/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sound classification using SpeechCommands18w and p5.js</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-sound-classifier.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/soundClassifier-teachable-machine/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sound classification using pre-trained custom model</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="../../dist/ml5.js"></script>
<script src="../../dist/ml5-sound-classifier.js"></script>
</head>

<body>
Expand Down
Loading