I trained a pose model on teachablemachine.with google.com. I tried to use that model as a web-application, so I applied it to the ml5.js on JavaScript like below.
const imageModelURL = 'teachable machine model URL';
async function start() {
const stream = await navigator.mediaDevices.getUserMedia({
audio: false,
video: true,
});
const video = document.getElementById('webcam');
video.srcObject = stream;
classifier = ml5.imageClassifier(imageModelURL + 'model.json', video, () => {
console.log('モデルの読み込みが完了しました');
});
function loop() {
classifier.classify(async (err, results) => {
if (results[0]) {
document.getElementById("result").textContent = results[0].label;//
}
setTimeout(loop, 1000);
});
}
loop();
}
I can use this on other models made by theachable machine image project, but it doesn't work in the case of pose model. I red the article that normally we can't use the pose model on ml5.js, but is there any way to use?
At this moment, we can not use the teachable machine's pose project on ml5. If you want, you can use Image Project instead.