Spaces:
Sleeping
Sleeping
File size: 2,077 Bytes
dcb53fc f774200 e579fcc f774200 5bc9969 4b4dd62 0df108b 5bc9969 5d5059e 0df108b 5d5059e 8539651 5d5059e 5bc9969 0df108b 4b4dd62 2ced557 5d5059e 6386896 7a647ca 99e7b16 0df108b 5d5059e 0df108b 99e7b16 5bc9969 0df108b 6386896 5d5059e 5bc9969 4b4dd62 5bc9969 5d5059e 2ced557 7a647ca 2ced557 5bc9969 5d5059e 2ced557 5d5059e dcb53fc |
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
import gradio as gr
from video_processing import process_video
def display_results(video_url, description):
final_clip_path = process_video(video_url, description)
if final_clip_path:
return final_clip_path, final_clip_path
return "No matching scene found", None
# Custom CSS
css = """
body {
background-color: #eb5726;
color: #ffffff;
font-family: 'Arial', sans-serif;
}
h1 {
color: #282828;
text-align: center;
}
h2 {
color: #eb5726;
}
h3 {
color: #eb5726;
}
h4 {
color: #eb5726;
}
h5 {
color: #282828;
}
h6 {
color: #eb5726;
}
#video_url {
background-color: #eb5726;
color: #ffffff;
border: 2px solid #ecf0f1;
label: #ffffff
}
#description + label {
background-color: #ecf0f1;
color: #eb5726;
border: 2px solid #eb5726;
}
#submit_button {
background-color: #ffffff;
color: #eb5726;
border: 2px solid #eb5726;
}
#submit_button:hover {
background-color: #c0392b;
}
#video_output, #download_output {
border: 1px solid #eb5726;
}
.centered-markdown {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
width: 100%;
}
.textbox-label {
color: #eb5726;
}
#description ~ label {
color: #eb5726;
}
"""
with gr.Blocks(css=css) as demo:
with gr.Column():
gr.Markdown("# Sickstadium AI", elem_classes="centered-markdown")
gr.Markdown("### Upload your video. Find sick clips. Tell your truth.", elem_classes="centered-markdown")
video_url = gr.Textbox(label="Video URL or Filepath", elem_id="video_url")
description = gr.Textbox(label="Description of desired clip", elem_id="description")
submit_button = gr.Button("Process Video", elem_id="submit_button")
video_output = gr.Video(label="Processed Video", elem_id="video_output")
download_output = gr.File(label="Download Processed Video", elem_id="download_output")
submit_button.click(fn=display_results, inputs=[video_url, description], outputs=[video_output, download_output])
demo.launch()
|