ShesterG commited on
Commit
ced046a
·
1 Parent(s): f9581d8

added examples

Browse files
Files changed (1) hide show
  1. app.py +45 -38
app.py CHANGED
@@ -531,45 +531,52 @@ def process_video(video_file):
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
- This app uses TTIC's foundation model SHuBERT (introduced in an ACL 2025 paper, see http://shubert.pals.ttic.edu).
539
-
540
- **Requirements:**
541
- - We recommend that videos be under 20 seconds. Performance for longer videos has not been tested.
542
- - 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.
543
- - Supported formats: MP4, MOV
544
-
545
- **Note:**
546
- - This is just a demo of a research project, and should NOT be used to replace an interpreter in any way.
547
- - Videos will be deleted after the output is generated.
548
- - Inquires or feedback? Please email us at shesterg@ttic.edu
549
- """
 
 
 
 
 
550
 
551
- if initialization_error:
552
- description += f"\n\n:warning: **Initialization Error:** {initialization_error}"
553
-
554
- dailymoth_pathlist = download_example_videos()
555
-
556
- with gr.Blocks(title="ASL Video to English Text Translation") as interface:
557
- gr.Markdown(f"# ASL Video to English Text Translation\n\n{description}")
558
-
559
- with gr.Row():
560
- video_input = gr.Video(label="ASL Video (under 20 seconds)", format="mp4", height=480, width=640)
561
- output_text = gr.Textbox(label="English Translation", lines=5)
562
-
563
- submit_btn = gr.Button("Translate", variant="primary")
564
- submit_btn.click(fn=process_video, inputs=video_input, outputs=output_text)
565
-
566
- gr.Examples(
567
- examples=dailymoth_pathlist,
568
- inputs=video_input,
569
- label="Click a video to try an example"
570
- )
571
-
572
- return interface
 
 
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()