Skip to content

Commit

Permalink
Change color channel from BGR to RGB for darknet preprocessing (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
vizero1 authored and alexwong committed Feb 26, 2020
1 parent 0db7a1f commit 6147639
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/tvm/relay/testing/darknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6147639

Please sign in to comment.