Skip to content

Commit

Permalink
fix: correct image normalization in RAM preprocessing (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
CVHub520 committed Oct 15, 2024
1 parent 41799b5 commit 0b07dc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions anylabeling/services/auto_labeling/__base__/ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def preprocess(self, input_image, input_shape):
"""
h, w = input_shape
image = cv2.resize(input_image, (w, h))
image /= 255.0
mean = np.array([0.485, 0.456, 0.406])
std = np.array([0.229, 0.224, 0.225])
image = (image - mean) / std
Expand Down
1 change: 1 addition & 0 deletions anylabeling/services/auto_labeling/yolov5_ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def ram_preprocess(self, input_image):
"""
h, w = self.ram_input_shape
image = cv2.resize(input_image, (w, h))
image /= 255.0
mean = np.array([0.485, 0.456, 0.406])
std = np.array([0.229, 0.224, 0.225])
image = (image - mean) / std
Expand Down

0 comments on commit 0b07dc4

Please sign in to comment.