Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
7da106d
1
Parent(s):
06fc2f7
Update app.py
Browse files
app.py
CHANGED
@@ -10,10 +10,14 @@ model = torch.hub.load("PeterL1n/RobustVideoMatting", "mobilenetv3") # or "resne
|
|
10 |
convert_video = torch.hub.load("PeterL1n/RobustVideoMatting", "converter")
|
11 |
|
12 |
def inference(video):
|
13 |
-
os.system('rm output.mp4')
|
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 |
convert_video(
|
18 |
model, # The loaded model, can be on any device (cpu or cuda).
|
19 |
input_source='output.mp4', # A video file or an image sequence directory.
|
|
|
10 |
convert_video = torch.hub.load("PeterL1n/RobustVideoMatting", "converter")
|
11 |
|
12 |
def inference(video):
|
13 |
+
#os.system('rm output.mp4')
|
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='output.mp4', # A video file or an image sequence directory.
|