xiaochus / YOLOv3

Keras implementation of yolo v3 object detection.
MIT License
605 stars 264 forks source link

Opencv loads BGR images thus lowering detection accuracy #22

Open AlbinSou opened 5 years ago

AlbinSou commented 5 years ago

I have noticed that Opencv imread was loading color channels in BGR order, what I did not know before. Since I suppose the original weights are made to deal with the channels in RGB order, I swapped the channels back by adding the line:

image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

,at the beggining of the function process_image.

It indeed increased the detection rate especially for the yolo_tiny model. It may solve issue #8 btw.

eehoeskrap commented 5 years ago

thank you!