Ahsen Khaliq commited on
Commit
ccccb71
·
1 Parent(s): b7f512e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,9 +8,10 @@ model = torch.hub.load("PeterL1n/RobustVideoMatting", "mobilenetv3") # or "resne
8
  convert_video = torch.hub.load("PeterL1n/RobustVideoMatting", "converter")
9
 
10
  def inference(video):
 
11
  convert_video(
12
  model, # The loaded model, can be on any device (cpu or cuda).
13
- input_source=video, # A video file or an image sequence directory.
14
  input_resize=(500, 500), # [Optional] Resize the input (also the output).
15
  downsample_ratio=0.25, # [Optional] If None, make downsampled max size be 512px.
16
  output_type='video', # Choose "video" or "png_sequence"
 
8
  convert_video = torch.hub.load("PeterL1n/RobustVideoMatting", "converter")
9
 
10
  def inference(video):
11
+ os.system('ffmpeg -ss 00:00:00 -i '+ video +' -to 00:00:05 -c copy output.mp4')
12
  convert_video(
13
  model, # The loaded model, can be on any device (cpu or cuda).
14
+ input_source='output.mp4', # A video file or an image sequence directory.
15
  input_resize=(500, 500), # [Optional] Resize the input (also the output).
16
  downsample_ratio=0.25, # [Optional] If None, make downsampled max size be 512px.
17
  output_type='video', # Choose "video" or "png_sequence"