From 00c645dd3167762bbbf97f136d175a24d5cd59ee Mon Sep 17 00:00:00 2001 From: vizero1 <50483246+vizero1@users.noreply.github.com> Date: Mon, 3 Feb 2020 05:03:57 +0100 Subject: [PATCH] Change color channel from BGR to RGB for darknet preprocessing (#4794) --- python/tvm/relay/testing/darknet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/tvm/relay/testing/darknet.py b/python/tvm/relay/testing/darknet.py index d4d673b7823f..091600db3036 100644 --- a/python/tvm/relay/testing/darknet.py +++ b/python/tvm/relay/testing/darknet.py @@ -60,6 +60,7 @@ def _resize_image(img, w_in, h_in): def load_image_color(test_image): """To load the image using opencv api and do preprocessing.""" imagex = cv2.imread(test_image) + imagex = cv2.cvtColor(imagex, cv2.COLOR_BGR2RGB) imagex = np.array(imagex) imagex = imagex.transpose((2, 0, 1)) imagex = np.divide(imagex, 255.0)