Update app.py
Browse files
app.py
CHANGED
|
@@ -329,7 +329,12 @@ def update_ui(vis_frame_type):
|
|
| 329 |
return gr.update(visible=False), gr.update(visible=True)
|
| 330 |
|
| 331 |
def switch_working_frame(working_frame, scanned_frames, video_frames_dir):
|
| 332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
match = re.search(r'frame_(\d+)', working_frame)
|
| 334 |
if match:
|
| 335 |
# Extract the integer from the match
|
|
|
|
| 329 |
return gr.update(visible=False), gr.update(visible=True)
|
| 330 |
|
| 331 |
def switch_working_frame(working_frame, scanned_frames, video_frames_dir):
|
| 332 |
+
new_working_frame = None
|
| 333 |
+
if working_frame == None:
|
| 334 |
+
new_working_frame = os.path.join(video_frames_dir, scanned_frames[0])
|
| 335 |
+
return new_working_frame, gr.State([]), gr.State([]), new_working_frame, new_working_frame, new_working_frame
|
| 336 |
+
else:
|
| 337 |
+
# Use a regular expression to find the integer
|
| 338 |
match = re.search(r'frame_(\d+)', working_frame)
|
| 339 |
if match:
|
| 340 |
# Extract the integer from the match
|