Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def save_uploaded_file(uploaded_file):
|
|
53 |
if uploaded_file is None:
|
54 |
return None # Handle cases where no file was uploaded
|
55 |
|
56 |
-
filedata = uploaded_file # When using '
|
57 |
upload_dir = "uploaded_videos"
|
58 |
os.makedirs(upload_dir, exist_ok=True)
|
59 |
file_path = os.path.join(upload_dir, "uploaded_video.mp4") # Using a fixed name for simplicity
|
@@ -77,7 +77,6 @@ def display_results(video_file, description):
|
|
77 |
else:
|
78 |
return "No file provided", None
|
79 |
|
80 |
-
|
81 |
css = """
|
82 |
body {
|
83 |
background-color: #ffffff;
|
@@ -129,7 +128,7 @@ h3 {
|
|
129 |
|
130 |
with gr.Blocks() as demo:
|
131 |
with gr.Column():
|
132 |
-
upload_button = gr.UploadButton(label="Upload Video File", type="
|
133 |
description = gr.Textbox(label="Describe your clip")
|
134 |
submit_button = gr.Button("Process Video")
|
135 |
video_output = gr.Video(label="Processed Video")
|
|
|
53 |
if uploaded_file is None:
|
54 |
return None # Handle cases where no file was uploaded
|
55 |
|
56 |
+
filedata = uploaded_file # When using 'binary', the filedata will be directly accessible
|
57 |
upload_dir = "uploaded_videos"
|
58 |
os.makedirs(upload_dir, exist_ok=True)
|
59 |
file_path = os.path.join(upload_dir, "uploaded_video.mp4") # Using a fixed name for simplicity
|
|
|
77 |
else:
|
78 |
return "No file provided", None
|
79 |
|
|
|
80 |
css = """
|
81 |
body {
|
82 |
background-color: #ffffff;
|
|
|
128 |
|
129 |
with gr.Blocks() as demo:
|
130 |
with gr.Column():
|
131 |
+
upload_button = gr.UploadButton(label="Upload Video File", type="binary", file_types=["video"])
|
132 |
description = gr.Textbox(label="Describe your clip")
|
133 |
submit_button = gr.Button("Process Video")
|
134 |
video_output = gr.Video(label="Processed Video")
|