Skip to content

Commit

Permalink
fixed js initialization routine
Browse files Browse the repository at this point in the history
  • Loading branch information
joreg committed Dec 19, 2023
1 parent 6d6c1c4 commit 0b56dff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deployment/VL.MediaPipe.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>VL.MediaPipe</id>
<version>0.0.9-alpha</version>
<version>0.0.10-alpha</version>
<title>VL.MediaPipe</title>
<authors>Dom Scott, Torin Blankensmith, vvvv</authors>
<owners>vvvv</owners>
Expand Down
6 changes: 1 addition & 5 deletions web/assets/index-cbca4c7b.js
Original file line number Diff line number Diff line change
Expand Up @@ -4698,10 +4698,7 @@ let landmarkerModelState = [faceLandmarkState, handState, gestureState, poseStat
objectState.landmarker = await createObjectDetector(WASM_PATH, objectsDiv);
imageState.landmarker = await createImageClassifier(WASM_PATH);
segmenterState.landmarker = await createImageSegmenter(WASM_PATH, video, segmentationCanvas);
webcamState.startWebcam();
if (webcamState.webcamRunning) {
window.requestAnimationFrame(() => predictWebcam(allModelState, objectState, webcamState, video));
}
})();
function handleQueryParams() {
socketState.port = window.location.port;
Expand All @@ -4720,8 +4717,7 @@ function safeSocketSend(ws2, data) {
async function predictWebcam(allModelState2, objectState2, webcamState2, video2) {
let timeToDetect = 0;
let timeToDraw = 0;
if (video2.videoWidth === 0 || video2.videoHeight === 0) {
console.log("videoWidth or videoHeight is 0");
if (!webcamState2.webcamRunning || video2.videoWidth === 0 || video2.videoHeight === 0) {
window.requestAnimationFrame(() => predictWebcam(allModelState2, objectState2, webcamState2, video2));
return;
}
Expand Down

0 comments on commit 0b56dff

Please sign in to comment.