Zhen Ye Claude Opus 4.5 commited on
Commit
85ec659
·
1 Parent(s): d496e6d

Show first frame radar when processed image appears

Browse files

- Add state.firstFrameReady flag set after first frame is processed
- First frame radar now displays with processed image (not after video done)
- Reset flag on video unload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

frontend/js/core/state.js CHANGED
@@ -6,6 +6,7 @@ APP.core.state = {
6
  useDepthFeed: false, // Flag for depth view (Tab 2 video)
7
  useFrameDepthView: false, // Flag for first frame depth view (Tab 1)
8
  hasReasoned: false,
 
9
  isReasoning: false, // Flag to prevent concurrent Reason executions
10
 
11
  hf: {
 
6
  useDepthFeed: false, // Flag for depth view (Tab 2 video)
7
  useFrameDepthView: false, // Flag for first frame depth view (Tab 1)
8
  hasReasoned: false,
9
+ firstFrameReady: false, // Flag for first frame radar display
10
  isReasoning: false, // Flag to prevent concurrent Reason executions
11
 
12
  hf: {
frontend/js/core/video.js CHANGED
@@ -124,6 +124,7 @@ APP.core.video.unloadVideo = async function (options = {}) {
124
 
125
  setHfStatus("idle");
126
  state.hasReasoned = false;
 
127
  state.isReasoning = false;
128
 
129
  // Reset button states
 
124
 
125
  setHfStatus("idle");
126
  state.hasReasoned = false;
127
+ state.firstFrameReady = false;
128
  state.isReasoning = false;
129
 
130
  // Reset button states
frontend/js/main.js CHANGED
@@ -454,6 +454,9 @@ document.addEventListener("DOMContentLoaded", () => {
454
  processFirstFrameDetections(rawDetections);
455
  }
456
 
 
 
 
457
  // Store depth URLs if provided
458
  if (data.depth_video_url) {
459
  state.hf.depthVideoUrl = data.depth_video_url.startsWith("http")
 
454
  processFirstFrameDetections(rawDetections);
455
  }
456
 
457
+ // Mark first frame as ready (for radar display)
458
+ state.firstFrameReady = true;
459
+
460
  // Store depth URLs if provided
461
  if (data.depth_video_url) {
462
  state.hf.depthVideoUrl = data.depth_video_url.startsWith("http")
frontend/js/ui/radar.js CHANGED
@@ -635,8 +635,8 @@ APP.ui.radar.render = function (canvasId, trackSource, options = {}) {
635
  APP.ui.radar.renderFrameRadar = function () {
636
  const { state } = APP.core;
637
 
638
- // Only show tracks after Reason has been clicked
639
- if (!state.hasReasoned) {
640
  APP.ui.radar.render("frameRadar", [], { static: true });
641
  return;
642
  }
 
635
  APP.ui.radar.renderFrameRadar = function () {
636
  const { state } = APP.core;
637
 
638
+ // Only show tracks after first frame is processed
639
+ if (!state.firstFrameReady) {
640
  APP.ui.radar.render("frameRadar", [], { static: true });
641
  return;
642
  }