Skip to content

Commit c21d1ee

Browse files
authored
Change color channel from BGR to RGB for darknet preprocessing (#4794)
1 parent 00097b1 commit c21d1ee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

python/tvm/relay/testing/darknet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def _resize_image(img, w_in, h_in):
6060
def load_image_color(test_image):
6161
"""To load the image using opencv api and do preprocessing."""
6262
imagex = cv2.imread(test_image)
63+
imagex = cv2.cvtColor(imagex, cv2.COLOR_BGR2RGB)
6364
imagex = np.array(imagex)
6465
imagex = imagex.transpose((2, 0, 1))
6566
imagex = np.divide(imagex, 255.0)

0 commit comments

Comments
 (0)