Skip to content

Commit

Permalink
Fix bug where expected color chanel order was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-joan authored and fcakyon committed Nov 6, 2023
1 parent 3a21a06 commit ae67e75
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sahi/models/onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ def _preprocess_image(self, image: np.ndarray, input_shape: Tuple[int, int]) ->
Args:
image: np.ndarray
Input image with color channel order BGR.
Input image with color channel order RGB.
"""
input_image = cv2.resize(image, input_shape)
input_image = cv2.cvtColor(input_image, cv2.COLOR_BGR2RGB)

input_image = input_image / 255.0
input_image = input_image.transpose(2, 0, 1)
Expand Down

0 comments on commit ae67e75

Please sign in to comment.