LapStore commited on
Commit
7ebdcd1
1 Parent(s): 8aa8201
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -57,9 +57,13 @@ async def image_step2(image_file: UploadFile = File(...),things_replace: str = F
57
 
58
  @app.post('/Video')
59
  async def Video(video_file: UploadFile = File(...),kind_back: str = Form(...), blur_radius: str = Form(...)):#--->,background_image: UploadFile = File(...)):
60
- video_data = await video_file.read()
61
- nparr = np.frombuffer(video_data, np.uint8)
62
- video_path=cv2.imdecode(nparr, cv2.IMREAD_COLOR) #named this as just passed as it's path
 
 
 
 
63
 
64
  produced_video=SegmenterBackground().Back_video(video_path, 'tmp/29_sep_2.avi','cam',['animal','person'])#video,background_image,what_remove,blur_radius=23)
65
 
 
57
 
58
  @app.post('/Video')
59
  async def Video(video_file: UploadFile = File(...),kind_back: str = Form(...), blur_radius: str = Form(...)):#--->,background_image: UploadFile = File(...)):
60
+ #video_data = await video_file.read()
61
+ #nparr = np.frombuffer(video_data, np.uint8)
62
+ #video_path=cv2.imdecode(nparr, cv2.IMREAD_COLOR) #named this as just passed as it's path
63
+
64
+ video_path = f'tmp/tmptmp.mp4'#{video_file.filename}
65
+ with open(video_path, 'wb') as f:
66
+ f.write(await video_file.read())
67
 
68
  produced_video=SegmenterBackground().Back_video(video_path, 'tmp/29_sep_2.avi','cam',['animal','person'])#video,background_image,what_remove,blur_radius=23)
69