From 65367279ce13432d7d1a405460f895e827adaa14 Mon Sep 17 00:00:00 2001
From: Colin Clark
Date: Sat, 16 Nov 2024 14:27:37 -0500
Subject: [PATCH] Fixes gh-16: updates renderer width/height on loading video
sources.
---
src/renderer/detect.js | 5 ++++-
src/renderer/index.html | 9 +++++----
src/renderer/styles.css | 4 ++++
src/renderer/video-pose-renderer.js | 8 ++++----
src/test/node-osc-listener.js | 2 ++
5 files changed, 19 insertions(+), 9 deletions(-)
mode change 100644 => 100755 src/test/node-osc-listener.js
diff --git a/src/renderer/detect.js b/src/renderer/detect.js
index 05f45c8..36a9e9f 100644
--- a/src/renderer/detect.js
+++ b/src/renderer/detect.js
@@ -8,6 +8,8 @@ import { VideoPoseRenderer } from "./video-pose-renderer.js";
import { TextField } from "./text-field.js";
import { NumberField } from "./number-field.js";
+let videoPoseRenderer;
+
let modelSelector = new ModelSelector(document.getElementById("modelSelector"));
async function selectModel(id) {
modelSelector.selectedModel = modelSelector.options[id];
@@ -31,11 +33,12 @@ let cameraVideo = new CameraVideo(document.getElementById("camera"));
async function selectDevice(id) {
cameraVideo.id = id;
await cameraVideo.update();
+ videoPoseRenderer.update();
}
deviceSelector.select.bind(selectDevice);
await cameraVideo.ready();
-let videoPoseRenderer = new VideoPoseRenderer(
+videoPoseRenderer = new VideoPoseRenderer(
document.getElementById("points"), cameraVideo.container);
let fpsDisplay = new FPSDisplay(document.getElementById("fps"), 2.5);
let poseInfoRenderer = new PoseInfoRenderer();
diff --git a/src/renderer/index.html b/src/renderer/index.html
index ea85bbc..5b768b3 100644
--- a/src/renderer/index.html
+++ b/src/renderer/index.html
@@ -26,10 +26,11 @@ MovementOSC
:
-
-
- 0 people detected at 0 fps.
-
+
+
0 people detected at 0 fps.
+
+
+