Spaces:
Runtime error
Runtime error
s194649
commited on
Commit
·
3105d8e
1
Parent(s):
2ab737a
fix
Browse files- inference.py +2 -7
inference.py
CHANGED
|
@@ -24,13 +24,8 @@ def map_image_range(image, min_value, max_value):
|
|
| 24 |
numpy.ndarray: Image array with values mapped to the specified range.
|
| 25 |
"""
|
| 26 |
# Ensure the input image is a numpy array
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
# Ensure the image values are within the valid range (0 to 1)
|
| 31 |
-
if not (0 <= np.min(image) <= 1) or not (0 <= np.max(image) <= 1):
|
| 32 |
-
raise ValueError("Input image values must be in the range [0, 1].")
|
| 33 |
-
|
| 34 |
# Map the values to the specified range
|
| 35 |
mapped_image = (image - 0) * (max_value - min_value) / (1 - 0) + min_value
|
| 36 |
return mapped_image
|
|
|
|
| 24 |
numpy.ndarray: Image array with values mapped to the specified range.
|
| 25 |
"""
|
| 26 |
# Ensure the input image is a numpy array
|
| 27 |
+
print(np.min(image))
|
| 28 |
+
print(np.max(image))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# Map the values to the specified range
|
| 30 |
mapped_image = (image - 0) * (max_value - min_value) / (1 - 0) + min_value
|
| 31 |
return mapped_image
|