Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
16cff9a
1
Parent(s):
0fc14c1
Update app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,14 @@ def inference(video):
|
|
15 |
downsample_ratio=0.25, # [Optional] If None, make downsampled max size be 512px.
|
16 |
output_type='video', # Choose "video" or "png_sequence"
|
17 |
output_composition='com.mp4', # File path if video; directory path if png sequence.
|
18 |
-
output_alpha=
|
19 |
-
output_foreground=
|
20 |
output_video_mbps=4, # Output video mbps. Not needed for png sequence.
|
21 |
seq_chunk=7, # Process n frames at once for better parallelism.
|
22 |
num_workers=1, # Only for image sequence input. Reader threads.
|
23 |
progress=True # Print conversion progress.
|
24 |
)
|
25 |
-
return 'com.mp4'
|
26 |
|
27 |
title = "Robust Video Matting"
|
28 |
description = "Gradio demo for Robust Video Matting. To use it, simply upload your video, or click one of the examples to load them. Read more at the links below."
|
@@ -33,7 +33,7 @@ examples = [['pexels-darina-belonogova-7539228.mp4']]
|
|
33 |
gr.Interface(
|
34 |
inference,
|
35 |
gr.inputs.Video(label="Input"),
|
36 |
-
gr.outputs.Video(label="Output"),
|
37 |
title=title,
|
38 |
description=description,
|
39 |
article=article,
|
|
|
15 |
downsample_ratio=0.25, # [Optional] If None, make downsampled max size be 512px.
|
16 |
output_type='video', # Choose "video" or "png_sequence"
|
17 |
output_composition='com.mp4', # File path if video; directory path if png sequence.
|
18 |
+
output_alpha="pha.mp4", # [Optional] Output the raw alpha prediction.
|
19 |
+
output_foreground="fgr.mp4", # [Optional] Output the raw foreground prediction.
|
20 |
output_video_mbps=4, # Output video mbps. Not needed for png sequence.
|
21 |
seq_chunk=7, # Process n frames at once for better parallelism.
|
22 |
num_workers=1, # Only for image sequence input. Reader threads.
|
23 |
progress=True # Print conversion progress.
|
24 |
)
|
25 |
+
return 'com.mp4',"pha.mp4","fgr.mp4"
|
26 |
|
27 |
title = "Robust Video Matting"
|
28 |
description = "Gradio demo for Robust Video Matting. To use it, simply upload your video, or click one of the examples to load them. Read more at the links below."
|
|
|
33 |
gr.Interface(
|
34 |
inference,
|
35 |
gr.inputs.Video(label="Input"),
|
36 |
+
[gr.outputs.Video(label="Output Composition"),gr.outputs.Video(label="Output Alpha"),gr.outputs.Video(label="Output Foreground")],
|
37 |
title=title,
|
38 |
description=description,
|
39 |
article=article,
|