you need to change color format of the image after resizing because opencv works with bgr format and yolo expects rgb
img = cv2.resize(image, (640, 640)) # Resize to model input size
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = img.astype(np.float32)
I guess this will solve your problem