ashu1069 commited on
Commit
f2658b4
·
1 Parent(s): b0d91d2
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -246,7 +246,7 @@ def create_interface():
246
  with gr.Row(): # Main row to hold video and controls side-by-side
247
  with gr.Column(scale=2): # Column for Video Player and Nav Buttons
248
  video_player = gr.Video(
249
- value=lambda annotator: annotator.get_current_video(),
250
  label="Current Video",
251
  height=350
252
  )
@@ -279,6 +279,13 @@ def create_interface():
279
 
280
  save_btn = gr.Button("Save Annotations", variant="primary")
281
 
 
 
 
 
 
 
 
282
  # Modify the event handlers to use the session-specific annotator
283
  save_btn.click(
284
  fn=lambda annotator, *args: annotator.save_annotation(*args),
 
246
  with gr.Row(): # Main row to hold video and controls side-by-side
247
  with gr.Column(scale=2): # Column for Video Player and Nav Buttons
248
  video_player = gr.Video(
249
+ value=None, # Initialize with None, we'll set it after getting the annotator
250
  label="Current Video",
251
  height=350
252
  )
 
279
 
280
  save_btn = gr.Button("Save Annotations", variant="primary")
281
 
282
+ # Add this after all components are defined but before the event handlers
283
+ demo.load(
284
+ fn=lambda annotator: annotator.get_current_video(),
285
+ inputs=[annotator_state],
286
+ outputs=video_player
287
+ )
288
+
289
  # Modify the event handlers to use the session-specific annotator
290
  save_btn.click(
291
  fn=lambda annotator, *args: annotator.save_annotation(*args),