Skip to content

Commit dbbc384

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

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Object_detection_webcam.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
# Acquire frame and expand frame dimensions to have shape: [1, None, None, 3]
9696
# i.e. a single-column array, where each item in the column has the pixel RGB value
9797
ret, frame = video.read()
98+
frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
9899
frame_expanded = np.expand_dims(frame, axis=0)
99100

100101
# Perform the actual detection by running the model with the image as input

0 commit comments

Comments
 (0)