Ahsen Khaliq commited on
Commit
f38d7e4
1 Parent(s): 66964b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- # 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.
@@ -35,7 +35,7 @@ def inference(video):
35
  return 'com.mp4',"pha.mp4","fgr.mp4"
36
 
37
  title = "Robust Video Matting"
38
- description = "Gradio demo for Robust Video Matting. To use it, simply upload your video, currently only mp4 and ogg formats are supported. Please trim video to 5 seconds or less. Read more at the links below."
39
 
40
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2108.11515'>Robust High-Resolution Video Matting with Temporal Guidance</a> | <a href='https://github.com/PeterL1n/RobustVideoMatting'>Github Repo</a></p>"
41
 
 
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 > 10:
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.
 
35
  return 'com.mp4',"pha.mp4","fgr.mp4"
36
 
37
  title = "Robust Video Matting"
38
+ description = "Gradio demo for Robust Video Matting. To use it, simply upload your video, currently only mp4 and ogg formats are supported. Please trim video to 10 seconds or less. Read more at the links below."
39
 
40
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2108.11515'>Robust High-Resolution Video Matting with Temporal Guidance</a> | <a href='https://github.com/PeterL1n/RobustVideoMatting'>Github Repo</a></p>"
41