Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
66964b3
1
Parent(s):
d17ebcf
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,10 +14,10 @@ def inference(video):
|
|
| 14 |
#clip = VideoFileClip(video).subclip(0, 5)
|
| 15 |
#clip.write_videofile("output.mp4")
|
| 16 |
#os.system('ffmpeg -ss 00:00:00 -i '+ video +' -to 00:00:05 -c copy -y output.mp4')
|
| 17 |
-
|
| 18 |
-
print(clip.duration)
|
| 19 |
-
if clip.duration > 5:
|
| 20 |
-
|
| 21 |
convert_video(
|
| 22 |
model, # The loaded model, can be on any device (cpu or cuda).
|
| 23 |
input_source=video, # A video file or an image sequence directory.
|
|
@@ -28,7 +28,7 @@ def inference(video):
|
|
| 28 |
output_alpha="pha.mp4", # [Optional] Output the raw alpha prediction.
|
| 29 |
output_foreground="fgr.mp4", # [Optional] Output the raw foreground prediction.
|
| 30 |
output_video_mbps=4, # Output video mbps. Not needed for png sequence.
|
| 31 |
-
seq_chunk=
|
| 32 |
num_workers=1, # Only for image sequence input. Reader threads.
|
| 33 |
progress=True # Print conversion progress.
|
| 34 |
)
|
|
|
|
| 14 |
#clip = VideoFileClip(video).subclip(0, 5)
|
| 15 |
#clip.write_videofile("output.mp4")
|
| 16 |
#os.system('ffmpeg -ss 00:00:00 -i '+ video +' -to 00:00:05 -c copy -y output.mp4')
|
| 17 |
+
# clip = VideoFileClip(video)
|
| 18 |
+
#print(clip.duration)
|
| 19 |
+
#if clip.duration > 5:
|
| 20 |
+
# return 'trim.mp4',"trim.mp4","trim.mp4"
|
| 21 |
convert_video(
|
| 22 |
model, # The loaded model, can be on any device (cpu or cuda).
|
| 23 |
input_source=video, # A video file or an image sequence directory.
|
|
|
|
| 28 |
output_alpha="pha.mp4", # [Optional] Output the raw alpha prediction.
|
| 29 |
output_foreground="fgr.mp4", # [Optional] Output the raw foreground prediction.
|
| 30 |
output_video_mbps=4, # Output video mbps. Not needed for png sequence.
|
| 31 |
+
seq_chunk=8, # Process n frames at once for better parallelism.
|
| 32 |
num_workers=1, # Only for image sequence input. Reader threads.
|
| 33 |
progress=True # Print conversion progress.
|
| 34 |
)
|