File size: 1,029 Bytes
ef1c94f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import gradio as gr 

TITLE = """<h2 align="center"> ✍️ Highlight Detection with MomentDETR </h2>"""

def submit_video(input_video, retrieval_text):
    print(input_video)
    print(retrieval_text)
    return input_video


with gr.Blocks() as demo:
    gr.HTML(TITLE)
    with gr.Row():
        with gr.Blocks():
            with gr.Column():
                gr.Markdown("### Input Video")
                input_video = gr.PlayableVideo().style(height=500)
                retrieval_text = gr.Textbox(
                    placeholder="What should be highlighted?",
                    visible=True
                )
                submit =gr.Button("Submit")
        with gr.Blocks():
            with gr.Column(): 
                gr.Markdown("### Results")
                with gr.Row():
                    output_video = gr.PlayableVideo().style(height=500)




    submit.click(
            fn=submit_video, 
            inputs=[input_video, retrieval_text], 
            outputs=[output_video]
        )

demo.launch()