From e0572ef1994c3747bc84a965853d7ad61250035e Mon Sep 17 00:00:00 2001 From: Maxwell Stone <38924020+MadeWithStone@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:51:49 -0700 Subject: [PATCH] fix scaling issue and allow webcam inference for all models --- newhome.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/newhome.js b/newhome.js index 2492203..fce980b 100644 --- a/newhome.js +++ b/newhome.js @@ -277,11 +277,8 @@ function switchModel() { } // hide webcam button if model is not microsoft-coco - if (current_model_name != "microsoft-coco") { - document.getElementById("webcam-predict").style.display = "none"; - } else { - document.getElementById("webcam-predict").style.display = "inline"; - } + + document.getElementById("webcam-predict").style.display = "inline"; // change video to use new one // var video = document.getElementById("video_source"); @@ -484,13 +481,8 @@ function webcamInference() { // on full load video.onplay = function () { const settings = stream.getVideoTracks()[0].getSettings(); - console.log(settings); height = video.videoHeight; width = video.videoWidth; - console.log( - `stream width: ${width} canvas width: ${canvas.style.width}` - ); - video.setAttribute("width", width); video.setAttribute("height", height); video.style.width = canvas.style.width + "px";