Spaces:
Sleeping
Sleeping
fix bug
Browse files
model.py
CHANGED
|
@@ -74,13 +74,12 @@ class TrafficSignDetector:
|
|
| 74 |
|
| 75 |
def _preprocess(self, image):
|
| 76 |
"""
|
| 77 |
-
Preprocess image:
|
| 78 |
:param image: input image (numpy array, uint8)
|
| 79 |
-
:return:
|
| 80 |
"""
|
| 81 |
-
#
|
| 82 |
-
image
|
| 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):
|