Omnibus commited on
Commit
4c19d70
·
1 Parent(s): 9bc8da2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -15
app.py CHANGED
@@ -50,8 +50,8 @@ def capture_function(vid=None):
50
  capture.set(cv2.CAP_PROP_POS_FRAMES, i)
51
  ret, frame_f = capture.read(i)
52
  frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
53
- cv2.imwrite(f'{uid}/{i}.png',frame_ff)
54
- fbox.append(f'{uid}/{i}.png')
55
  return fbox,fbox
56
 
57
  def im_2_vid(images,fps):
@@ -91,19 +91,7 @@ def rem_bg(vid):
91
  frame_num=f'Done: {i+1} of {frame_count1-1}'
92
  out_vid,_file = im_2_vid(fbox2, fps)
93
  yield (fbox2,frame_num,out_vid)
94
-
95
- def rem_bg_og(inp):
96
- #transparent background .mov
97
- #os.system(f'backgroundremover -i "{inp}" -tv -o "{inp}.mov"')
98
- #video video to be overlayed output
99
- #os.system(f' backgroundremover -i "/path/to/video.mp4" -tov "/path/to/videtobeoverlayed.mp4" -o "output.mov"')
100
- #video over image file
101
- #os.system(f'backgroundremover -i "/path/to/video.mp4" -toi "/path/to/videtobeoverlayed.mp4" -o "output.mov"')
102
- #output to transparent GIF
103
- #os.system(f'backgroundremover -i "/path/to/video.mp4" -tg -o "output.gif"')
104
- #output to matte background
105
- os.system(f'backgroundremover -i "{inp}" -mk -o "{inp}.matte.mp4"')
106
- return f'{inp}.matte.mp4'
107
 
108
  def predict(text, url_params):
109
  mod_url=""
 
50
  capture.set(cv2.CAP_PROP_POS_FRAMES, i)
51
  ret, frame_f = capture.read(i)
52
  frame_ff = cv2.cvtColor(frame_f, cv2.COLOR_BGR2RGB)
53
+ cv2.imwrite(f'{uid}-frames/{i}.png',frame_ff)
54
+ fbox.append(f'{uid}-frames/{i}.png')
55
  return fbox,fbox
56
 
57
  def im_2_vid(images,fps):
 
91
  frame_num=f'Done: {i+1} of {frame_count1-1}'
92
  out_vid,_file = im_2_vid(fbox2, fps)
93
  yield (fbox2,frame_num,out_vid)
94
+
 
 
 
 
 
 
 
 
 
 
 
 
95
 
96
  def predict(text, url_params):
97
  mod_url=""