Skip to content

Commit af20035

Browse files
Convert frame to RGB before processing
1 parent dbbc384 commit af20035

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Object_detection_webcam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
# i.e. a single-column array, where each item in the column has the pixel RGB value
9797
ret, frame = video.read()
9898
frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
99-
frame_expanded = np.expand_dims(frame, axis=0)
99+
frame_expanded = np.expand_dims(frame_rgb, axis=0)
100100

101101
# Perform the actual detection by running the model with the image as input
102102
(boxes, scores, classes, num) = sess.run(

0 commit comments

Comments
 (0)