ShesterG commited on
Commit
8bedffe
·
1 Parent(s): 75f174e

added one example attached with the code

Browse files
Files changed (1) hide show
  1. app.py +35 -19
app.py CHANGED
@@ -565,29 +565,45 @@ This app uses TTIC's foundation model SHuBERT (introduced in an ACL 2025 paper,
565
  else:
566
  print(f"Warning: File not found at {src_path}")
567
  dailymoth_pathlist = []
568
-
569
- video_input = gr.Video(label="ASL Video (under 20 seconds)", format="mp4", height=480, width=640)
570
- text_output = gr.Textbox(label="English Translation", lines=5)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
571
 
572
 
573
 
574
- interface = gr.Interface(
575
- fn=process_video,
576
- inputs=video_input,
577
- outputs=text_output,
578
- title="ASL Video to English Text Translation",
579
- description=description,
580
- article="",
581
- # examples=dailymoth_pathlist,
582
- # example_labels=["Officials with an EU force said they are searching for the missing."],
583
- allow_flagging="never",
584
- )
585
 
586
- gr.Examples(
587
- examples=dailymoth_pathlist,
588
- inputs=video_input,
589
- label="Click a video to try an example"
590
- )
591
 
592
  return interface
593
 
 
565
  else:
566
  print(f"Warning: File not found at {src_path}")
567
  dailymoth_pathlist = []
568
+
569
+ with gr.Blocks(title="ASL Video to English Text Translation") as interface:
570
+ gr.Markdown(f"# ASL Video to English Text Translation\n\n{description}")
571
+
572
+ with gr.Row():
573
+ video_input = gr.Video(label="ASL Video (under 20 seconds)", format="mp4", height=480, width=640)
574
+ output_text = gr.Textbox(label="English Translation", lines=5)
575
+
576
+ submit_btn = gr.Button("Translate", variant="primary")
577
+ submit_btn.click(fn=process_video, inputs=video_input, outputs=output_text)
578
+
579
+ gr.Examples(
580
+ examples=dailymoth_pathlist,
581
+ inputs=video_input,
582
+ label="Click a video to try an example"
583
+ )
584
+
585
+ # video_input = gr.Video(label="ASL Video (under 20 seconds)", format="mp4", height=480, width=640)
586
+ # text_output = gr.Textbox(label="English Translation", lines=5)
587
 
588
 
589
 
590
+ # interface = gr.Interface(
591
+ # fn=process_video,
592
+ # inputs=video_input,
593
+ # outputs=text_output,
594
+ # title="ASL Video to English Text Translation",
595
+ # description=description,
596
+ # article="",
597
+ # # examples=dailymoth_pathlist,
598
+ # # example_labels=["Officials with an EU force said they are searching for the missing."],
599
+ # allow_flagging="never",
600
+ # )
601
 
602
+ # gr.Examples(
603
+ # examples=dailymoth_pathlist,
604
+ # inputs=video_input,
605
+ # label="Click a video to try an example"
606
+ # )
607
 
608
  return interface
609