Piarasingh85 commited on
Commit
b4b3ab0
·
verified ·
1 Parent(s): 1a6b50c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,12 +5,12 @@ def video_feed():
5
  cap = cv2.VideoCapture(0) # Use 0 for the default camera
6
  if not cap.isOpened():
7
  raise RuntimeError("Could not start camera.")
 
8
  while True:
9
  ret, frame = cap.read()
10
  if not ret:
11
  continue
12
- _, buffer = cv2.imencode('.jpg', frame)
13
- frame = buffer.tobytes()
14
  yield frame
15
 
16
  cap.release()
 
5
  cap = cv2.VideoCapture(0) # Use 0 for the default camera
6
  if not cap.isOpened():
7
  raise RuntimeError("Could not start camera.")
8
+
9
  while True:
10
  ret, frame = cap.read()
11
  if not ret:
12
  continue
13
+ frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
 
14
  yield frame
15
 
16
  cap.release()