Spaces:
Running
on
Zero
Running
on
Zero
added examples
Browse files
app.py
CHANGED
@@ -531,45 +531,52 @@ def process_video(video_file):
|
|
531 |
|
532 |
# Create Gradio interface
|
533 |
def create_interface():
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
|
|
|
|
|
|
|
|
|
|
550 |
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
|
|
|
|
573 |
|
574 |
# Create the demo
|
575 |
demo = create_interface()
|
|
|
531 |
|
532 |
# Create Gradio interface
|
533 |
def create_interface():
|
534 |
+
"""Create the Gradio interface"""
|
535 |
+
description = """
|
536 |
+
Upload an ASL* video to get an English translation. *Sign languages belonging to the same sign language family as ASL (e.g. Ghanaian Sign Language, as well as others listed in Table 7, Row 1 of https://aclanthology.org/2023.findings-emnlp.664.pdf) might also have non-trivial performance, although the model is trained only on ASL data.
|
537 |
+
|
538 |
+
|
539 |
+
This app uses TTIC's foundation model SHuBERT (introduced in an ACL 2025 paper, see http://shubert.pals.ttic.edu).
|
540 |
+
|
541 |
+
**Requirements:**
|
542 |
+
- We recommend that videos be under 20 seconds. Performance for longer videos has not been tested.
|
543 |
+
- The signer should be the main part (e.g. 90% of the area) of the video. Videos recorded from a phone camera, tablet, or personal computer should work well. Studio recordings where the signer is farther from the camera may not work as well.
|
544 |
+
- Supported formats: MP4, MOV
|
545 |
+
|
546 |
+
**Note:**
|
547 |
+
- This is just a demo of a research project, and should NOT be used to replace an interpreter in any way.
|
548 |
+
- Videos will be deleted after the output is generated.
|
549 |
+
- Inquires or feedback? Please email us at [email protected]
|
550 |
+
"""
|
551 |
+
|
552 |
+
if initialization_error:
|
553 |
+
description += f"\n\n:warning: **Initialization Error:** {initialization_error}"
|
554 |
+
|
555 |
|
556 |
+
dailymoth_pathlist = download_example_videos()
|
557 |
+
|
558 |
+
video_input = gr.Video(label="ASL Video (under 20 seconds)", format="mp4", height=480, width=640)
|
559 |
+
text_output = gr.Textbox(label="English Translation", lines=5)
|
560 |
+
|
561 |
+
|
562 |
+
|
563 |
+
interface = gr.Interface(
|
564 |
+
fn=process_video,
|
565 |
+
inputs=video_input,
|
566 |
+
outputs=text_output,
|
567 |
+
title="ASL Video to English Text Translation",
|
568 |
+
description=description,
|
569 |
+
article="",
|
570 |
+
allow_flagging="never"
|
571 |
+
)
|
572 |
+
|
573 |
+
gr.Examples(
|
574 |
+
examples=dailymoth_pathlist,
|
575 |
+
inputs=video_input,
|
576 |
+
label="Click a video to try an example"
|
577 |
+
)
|
578 |
+
|
579 |
+
return interface
|
580 |
|
581 |
# Create the demo
|
582 |
demo = create_interface()
|