Spaces:
Sleeping
Sleeping
MohamedMotaz
commited on
Commit
•
4bf1a31
1
Parent(s):
fd678cb
final deployment
Browse files
app.py
CHANGED
@@ -6,14 +6,14 @@ def process_file(file, is_video , skip = 1 , add_audio = True):
|
|
6 |
input_path = file.name
|
7 |
output_path = "output." + ("mp4" if is_video else "png")
|
8 |
if is_video == True:
|
9 |
-
process_video(input_path, output_path , skip = skip , add_audio = add_audio)
|
10 |
else:
|
11 |
process_image(input_path, output_path)
|
12 |
return output_path
|
13 |
|
14 |
iface = gr.Interface(
|
15 |
fn=process_file,
|
16 |
-
inputs=[gr.File(label="Upload File"), gr.Checkbox(label="Is Video?") ,
|
17 |
outputs=gr.File(label="Processed File"),
|
18 |
title="Face Emotion Detection",
|
19 |
description="Upload an image or video to detect and annotate emotions."
|
|
|
6 |
input_path = file.name
|
7 |
output_path = "output." + ("mp4" if is_video else "png")
|
8 |
if is_video == True:
|
9 |
+
process_video(input_path, output_path , skip = round(skip) , add_audio = add_audio)
|
10 |
else:
|
11 |
process_image(input_path, output_path)
|
12 |
return output_path
|
13 |
|
14 |
iface = gr.Interface(
|
15 |
fn=process_file,
|
16 |
+
inputs=[gr.File(label="Upload File"), gr.Checkbox(label="Is Video?") , gr.Slider(1, 20, 1, value=1, label="Frame Skip"), gr.Checkbox(label="Add Audio?")],
|
17 |
outputs=gr.File(label="Processed File"),
|
18 |
title="Face Emotion Detection",
|
19 |
description="Upload an image or video to detect and annotate emotions."
|