Spaces:
Running
Running
Create app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@ import gradio as gr
|
|
| 2 |
from inference import run_halftime_pipeline
|
| 3 |
|
| 4 |
def process_video(url, product):
|
|
|
|
|
|
|
| 5 |
try:
|
| 6 |
output_video = run_halftime_pipeline(url, product)
|
| 7 |
return output_video
|
|
@@ -12,11 +14,15 @@ ui = gr.Interface(
|
|
| 12 |
fn=process_video,
|
| 13 |
inputs=[
|
| 14 |
gr.Textbox(label="YouTube URL"),
|
| 15 |
-
gr.Textbox(label="Product description")
|
| 16 |
],
|
| 17 |
outputs=gr.Video(label="Edited Video"),
|
| 18 |
-
title="YouTube Halftime
|
| 19 |
-
description=
|
|
|
|
|
|
|
|
|
|
| 20 |
)
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
| 2 |
from inference import run_halftime_pipeline
|
| 3 |
|
| 4 |
def process_video(url, product):
|
| 5 |
+
if not url or not product:
|
| 6 |
+
return "Please enter a YouTube URL and a product description."
|
| 7 |
try:
|
| 8 |
output_video = run_halftime_pipeline(url, product)
|
| 9 |
return output_video
|
|
|
|
| 14 |
fn=process_video,
|
| 15 |
inputs=[
|
| 16 |
gr.Textbox(label="YouTube URL"),
|
| 17 |
+
gr.Textbox(label="Product / Brand description")
|
| 18 |
],
|
| 19 |
outputs=gr.Video(label="Edited Video"),
|
| 20 |
+
title="YouTube Halftime (Simple Version)",
|
| 21 |
+
description=(
|
| 22 |
+
"Prototype: downloads the YouTube video and draws a colored box "
|
| 23 |
+
"where the AI thinks your product should appear, for a few seconds."
|
| 24 |
+
)
|
| 25 |
)
|
| 26 |
|
| 27 |
+
if __name__ == "__main__":
|
| 28 |
+
ui.launch()
|