Spaces:
Runtime error
Runtime error
jens
commited on
Commit
·
430fde6
1
Parent(s):
3105d8e
fix
Browse files- inference.py +2 -1
inference.py
CHANGED
|
@@ -26,6 +26,7 @@ def map_image_range(image, min_value, max_value):
|
|
| 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
|
|
@@ -78,7 +79,7 @@ class DepthPredictor:
|
|
| 78 |
).squeeze()
|
| 79 |
|
| 80 |
output = prediction.cpu().numpy()
|
| 81 |
-
output = 1 - (output/np.max(output))
|
| 82 |
return output
|
| 83 |
|
| 84 |
def generate_pcl(self, image):
|
|
|
|
| 26 |
# Ensure the input image is a numpy array
|
| 27 |
print(np.min(image))
|
| 28 |
print(np.max(image))
|
| 29 |
+
|
| 30 |
# Map the values to the specified range
|
| 31 |
mapped_image = (image - 0) * (max_value - min_value) / (1 - 0) + min_value
|
| 32 |
return mapped_image
|
|
|
|
| 79 |
).squeeze()
|
| 80 |
|
| 81 |
output = prediction.cpu().numpy()
|
| 82 |
+
#output = 1 - (output/np.max(output))
|
| 83 |
return output
|
| 84 |
|
| 85 |
def generate_pcl(self, image):
|