Spaces:
Sleeping
Sleeping
Commit ·
07b432d
1
Parent(s): 0e7c368
Reorder UI: extract frames (step 4) now follows transcribe + generate
Browse filesAuto-extract depends on the transcript and LLM step outline, so the frames section
moves below them. Auto-extract is the primary action there; manual capture still
grabs from the player above. Renumbered: 1 Upload, 2 Transcribe, 3 Generate,
4 Capture & extract frames, 5 Build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -391,33 +391,16 @@ def build_ui() -> gr.Blocks:
|
|
| 391 |
cap_url = gr.Textbox(visible=False)
|
| 392 |
cap_time = gr.Number(visible=False)
|
| 393 |
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
player = gr.HTML()
|
| 403 |
-
with gr.Row():
|
| 404 |
-
capture_btn = gr.Button("📸 Capture current frame", variant="primary")
|
| 405 |
-
auto_btn = gr.Button("✨ Auto-extract frames")
|
| 406 |
-
with gr.Column(scale=2):
|
| 407 |
-
gr.Markdown(
|
| 408 |
-
"### Captured frames\n"
|
| 409 |
-
"_**Auto-extract** runs transcription + the step outline first, so frames "
|
| 410 |
-
"anchor to the guide steps (and skip recorder intro/idle screens)._"
|
| 411 |
-
)
|
| 412 |
-
gallery = gr.Gallery(
|
| 413 |
-
label="Frames pool — click an image to enlarge / select it",
|
| 414 |
-
elem_id="dm-gallery",
|
| 415 |
-
columns=3, height=320, object_fit="contain", allow_preview=False,
|
| 416 |
-
)
|
| 417 |
-
with gr.Row():
|
| 418 |
-
delete_btn = gr.Button("🗑️ Delete selected")
|
| 419 |
-
clear_btn = gr.Button("Clear all")
|
| 420 |
|
|
|
|
| 421 |
gr.Markdown("### 2 · Transcribe → 3 · Generate guide")
|
| 422 |
with gr.Row():
|
| 423 |
with gr.Column():
|
|
@@ -429,7 +412,30 @@ def build_ui() -> gr.Blocks:
|
|
| 429 |
generate_btn = gr.Button("📝 Generate step-by-step guide (LLM)")
|
| 430 |
guide_md = gr.Markdown()
|
| 431 |
|
| 432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
with gr.Row():
|
| 434 |
caption_chk = gr.Checkbox(value=config.ENABLE_VISION, label="Caption images with vision model")
|
| 435 |
build_btn = gr.Button("📄 Build DOCX", variant="primary")
|
|
|
|
| 391 |
cap_url = gr.Textbox(visible=False)
|
| 392 |
cap_time = gr.Number(visible=False)
|
| 393 |
|
| 394 |
+
# 1 · Upload & preview
|
| 395 |
+
gr.Markdown("### 1 · Upload & preview")
|
| 396 |
+
upload = gr.File(
|
| 397 |
+
label="Upload a video",
|
| 398 |
+
type="filepath",
|
| 399 |
+
file_types=[".mp4", ".mov", ".mkv", ".webm", ".avi", ".m4v", ".mpg", ".mpeg"],
|
| 400 |
+
)
|
| 401 |
+
player = gr.HTML()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
|
| 403 |
+
# 2 · Transcribe → 3 · Generate guide
|
| 404 |
gr.Markdown("### 2 · Transcribe → 3 · Generate guide")
|
| 405 |
with gr.Row():
|
| 406 |
with gr.Column():
|
|
|
|
| 412 |
generate_btn = gr.Button("📝 Generate step-by-step guide (LLM)")
|
| 413 |
guide_md = gr.Markdown()
|
| 414 |
|
| 415 |
+
# 4 · Capture & extract frames (after transcription + the step outline)
|
| 416 |
+
gr.Markdown(
|
| 417 |
+
"### 4 · Capture & extract frames\n"
|
| 418 |
+
"_**Auto-extract** uses the transcript + step outline (steps 2–3) to pull frames "
|
| 419 |
+
"at the guide's step moments and skip recorder intro/idle screens — it will run "
|
| 420 |
+
"those first if needed. **Capture current frame** grabs the exact moment showing "
|
| 421 |
+
"in the player above._"
|
| 422 |
+
)
|
| 423 |
+
with gr.Row():
|
| 424 |
+
with gr.Column(scale=2):
|
| 425 |
+
auto_btn = gr.Button("✨ Auto-extract frames", variant="primary")
|
| 426 |
+
capture_btn = gr.Button("📸 Capture current frame")
|
| 427 |
+
with gr.Column(scale=3):
|
| 428 |
+
gallery = gr.Gallery(
|
| 429 |
+
label="Frames pool — click an image to enlarge / select it",
|
| 430 |
+
elem_id="dm-gallery",
|
| 431 |
+
columns=3, height=320, object_fit="contain", allow_preview=False,
|
| 432 |
+
)
|
| 433 |
+
with gr.Row():
|
| 434 |
+
delete_btn = gr.Button("🗑️ Delete selected")
|
| 435 |
+
clear_btn = gr.Button("Clear all")
|
| 436 |
+
|
| 437 |
+
# 5 · Build the document
|
| 438 |
+
gr.Markdown("### 5 · Build the document")
|
| 439 |
with gr.Row():
|
| 440 |
caption_chk = gr.Checkbox(value=config.ENABLE_VISION, label="Caption images with vision model")
|
| 441 |
build_btn = gr.Button("📄 Build DOCX", variant="primary")
|