ricardo238costa commited on
Commit
76b08f6
·
verified ·
1 Parent(s): 454a9ac

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -12,7 +12,9 @@ def detect_product_in_frame(frame):
12
 
13
  @app.post("/process_video/")
14
  async def process_video(file: UploadFile = File(...)):
15
- input_filename = f"input_{uuid.uuid4()}.mp4"
 
 
16
  with open(input_filename, "wb") as f:
17
  f.write(await file.read())
18
 
@@ -24,8 +26,6 @@ async def process_video(file: UploadFile = File(...)):
24
  roi_box = detect_product_in_frame(frame)
25
  cap.release()
26
 
27
- output_filename = f"output_{uuid.uuid4()}.mp4"
28
-
29
  if roi_box:
30
  x, y, w, h = roi_box
31
  crop_cmd = [
 
12
 
13
  @app.post("/process_video/")
14
  async def process_video(file: UploadFile = File(...)):
15
+ input_filename = f"/tmp/input_{uuid.uuid4()}.mp4"
16
+ output_filename = f"/tmp/output_{uuid.uuid4()}.mp4"
17
+
18
  with open(input_filename, "wb") as f:
19
  f.write(await file.read())
20
 
 
26
  roi_box = detect_product_in_frame(frame)
27
  cap.release()
28
 
 
 
29
  if roi_box:
30
  x, y, w, h = roi_box
31
  crop_cmd = [