projects
/
platform
/
upstream
/
tvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00097b1
)
Change color channel from BGR to RGB for darknet preprocessing (#4794)
author
vizero1
<50483246+vizero1@users.noreply.github.com>
Mon, 3 Feb 2020 04:03:57 +0000
(
05:03
+0100)
committer
GitHub
<noreply@github.com>
Mon, 3 Feb 2020 04:03:57 +0000
(12:03 +0800)
python/tvm/relay/testing/darknet.py
patch
|
blob
|
history
diff --git
a/python/tvm/relay/testing/darknet.py
b/python/tvm/relay/testing/darknet.py
index
d4d673b
..
091600d
100644
(file)
--- 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)