BrainAI-1 commited on
Commit
8eb120a
·
verified ·
1 Parent(s): 005b658

Update utils/object_detection_brainai.py

Browse files
Files changed (1) hide show
  1. utils/object_detection_brainai.py +2 -2
utils/object_detection_brainai.py CHANGED
@@ -43,10 +43,10 @@ class ObjectDetectionModel():
43
  return img_plot, f'Objects Detected: {", ".join(detected_classes) if detected_classes else "No objects detected"}'
44
 
45
  def play_video(self, input_video):
46
- g = io.BytesIO(input_video.read())
47
  temporary_location = "upload.mp4"
48
  with open(temporary_location, "wb") as out:
49
- out.write(g.read())
50
  out.close()
51
 
52
  camera = cv2.VideoCapture(temporary_location)
 
43
  return img_plot, f'Objects Detected: {", ".join(detected_classes) if detected_classes else "No objects detected"}'
44
 
45
  def play_video(self, input_video):
46
+ uploaded_video = io.BytesIO(input_video.read())
47
  temporary_location = "upload.mp4"
48
  with open(temporary_location, "wb") as out:
49
+ out.write(uploaded_video.read())
50
  out.close()
51
 
52
  camera = cv2.VideoCapture(temporary_location)