Spaces:
Sleeping
Sleeping
updates
Browse files
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=
|
| 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),
|