Spaces:
Runtime error
Runtime error
yiyixuxu
commited on
Commit
·
9855e99
1
Parent(s):
6f4e163
updated
Browse files
app.py
CHANGED
|
@@ -73,6 +73,8 @@ def download_video(url):
|
|
| 73 |
except youtube_dl.DownloadError as error:
|
| 74 |
print(f'error with download_video function: {error}')
|
| 75 |
save_location = None
|
|
|
|
|
|
|
| 76 |
return(fps, save_location)
|
| 77 |
|
| 78 |
def process_video_parallel(video, skip_frames, dest_path, num_processes, process_number):
|
|
@@ -182,7 +184,7 @@ def run_inference(url, sampling_interval, search_query, bs=526):
|
|
| 182 |
image_output = None
|
| 183 |
return(title, image_output)
|
| 184 |
|
| 185 |
-
inputs = [gr.inputs.Textbox(label="Give us the link to your youtube video! (
|
| 186 |
gr.Number(5,label='sampling interval (seconds)'),
|
| 187 |
gr.inputs.Textbox(label="What do you want to search?")]
|
| 188 |
outputs = [
|
|
@@ -197,7 +199,7 @@ gr.Interface(
|
|
| 197 |
inputs=inputs,
|
| 198 |
outputs=outputs,
|
| 199 |
title="It Happened One Frame",
|
| 200 |
-
description='A CLIP-based app that search video frame based on text',
|
| 201 |
examples=[
|
| 202 |
['https://youtu.be/v1rkzUIL8oc', 1, "James Cagney dancing down the stairs"],
|
| 203 |
['https://youtu.be/k4R5wZs8cxI', 1, "James Cagney smashes a grapefruit into Mae Clarke's face"],
|
|
|
|
| 73 |
except youtube_dl.DownloadError as error:
|
| 74 |
print(f'error with download_video function: {error}')
|
| 75 |
save_location = None
|
| 76 |
+
else:
|
| 77 |
+
fps, save_location = None, None
|
| 78 |
return(fps, save_location)
|
| 79 |
|
| 80 |
def process_video_parallel(video, skip_frames, dest_path, num_processes, process_number):
|
|
|
|
| 184 |
image_output = None
|
| 185 |
return(title, image_output)
|
| 186 |
|
| 187 |
+
inputs = [gr.inputs.Textbox(label="Give us the link to your youtube video! ( maximum size 50 MB)"),
|
| 188 |
gr.Number(5,label='sampling interval (seconds)'),
|
| 189 |
gr.inputs.Textbox(label="What do you want to search?")]
|
| 190 |
outputs = [
|
|
|
|
| 199 |
inputs=inputs,
|
| 200 |
outputs=outputs,
|
| 201 |
title="It Happened One Frame",
|
| 202 |
+
description='A CLIP-based app that search YouTube video frame based on text',
|
| 203 |
examples=[
|
| 204 |
['https://youtu.be/v1rkzUIL8oc', 1, "James Cagney dancing down the stairs"],
|
| 205 |
['https://youtu.be/k4R5wZs8cxI', 1, "James Cagney smashes a grapefruit into Mae Clarke's face"],
|