VietCat commited on
Commit
ef364be
·
1 Parent(s): 21e825c
Files changed (1) hide show
  1. model.py +4 -5
model.py CHANGED
@@ -74,13 +74,12 @@ class TrafficSignDetector:
74
 
75
  def _preprocess(self, image):
76
  """
77
- Preprocess image: normalize pixel values to [0, 1] range.
78
  :param image: input image (numpy array, uint8)
79
- :return: normalized image (float32)
80
  """
81
- # Normalize pixel values from [0, 255] to [0, 1]
82
- image = image.astype(np.float32) / 255.0
83
- print(f"Image normalized - Min: {image.min():.3f}, Max: {image.max():.3f}, Mean: {image.mean():.3f}")
84
  return image
85
 
86
  def detect(self, image):
 
74
 
75
  def _preprocess(self, image):
76
  """
77
+ Preprocess image: keep uint8 format as YOLO expects.
78
  :param image: input image (numpy array, uint8)
79
+ :return: image in uint8 format
80
  """
81
+ # YOLO handles normalization internally, keep uint8 format
82
+ print(f"Image format: {image.dtype}, Min: {image.min()}, Max: {image.max()}, Mean: {image.mean():.1f}")
 
83
  return image
84
 
85
  def detect(self, image):