From 71685832869810a14adf8a846023573d734283ff Mon Sep 17 00:00:00 2001 From: fustyles <34397289+fustyles@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:03:23 +0800 Subject: [PATCH] Update faceapi-recognition_esp32cam_stream.js --- .../faceapi-recognition_esp32cam_stream.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/faceapi_recognize_20201012/faceapi-recognition_esp32cam_stream.js b/faceapi_recognize_20201012/faceapi-recognition_esp32cam_stream.js index f91c5fcb3e..9bf8ebe230 100644 --- a/faceapi_recognize_20201012/faceapi-recognition_esp32cam_stream.js +++ b/faceapi_recognize_20201012/faceapi-recognition_esp32cam_stream.js @@ -45,8 +45,10 @@ window.onload = function () { facelabels = document.getElementById('facelabel_faceapirecognize').innerHTML; facelabels = facelabels.split(";"); - ShowImage.src = window.location.hostname+':81/?stream'; - ShowImage.style.visibility = "visible"; + + ShowImage.onload = function () { + DetectImage(); + } Promise.all([ faceapi.nets.faceLandmark68Net.load(modelPath), @@ -54,7 +56,7 @@ window.onload = function () { faceapi.nets.ssdMobilenetv1.load(modelPath) ]).then(function(){ ShowImage.style.visibility = "hidden"; - DetectImage(); + ShowImage.src = window.location.hostname+':81/?stream'; }) async function DetectImage() {