Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -105,7 +105,7 @@ def predict_depth(image: Image.Image):
|
|
| 105 |
depth_bilateral = cv2.bilateralFilter((depth_array / 65535 * 255).astype(np.uint8), d=12, sigmaColor=90, sigmaSpace=90)
|
| 106 |
depth_bilateral = depth_bilateral.astype(np.float32) / 255 * 65535 # Back to 16-bit scale
|
| 107 |
laplacian = cv2.Laplacian(depth_bilateral, cv2.CV_32F)
|
| 108 |
-
depth_sharpened = cv2.addWeighted(depth_bilateral, 1.1, laplacian, -0.
|
| 109 |
|
| 110 |
# Normalize to 16-bit for consistent scaling
|
| 111 |
depth_normalized = cv2.normalize(depth_sharpened, None, 0, 65535, cv2.NORM_MINMAX, dtype=cv2.CV_16U)
|
|
|
|
| 105 |
depth_bilateral = cv2.bilateralFilter((depth_array / 65535 * 255).astype(np.uint8), d=12, sigmaColor=90, sigmaSpace=90)
|
| 106 |
depth_bilateral = depth_bilateral.astype(np.float32) / 255 * 65535 # Back to 16-bit scale
|
| 107 |
laplacian = cv2.Laplacian(depth_bilateral, cv2.CV_32F)
|
| 108 |
+
depth_sharpened = cv2.addWeighted(depth_bilateral, 1.1, laplacian, -0.4, 0)
|
| 109 |
|
| 110 |
# Normalize to 16-bit for consistent scaling
|
| 111 |
depth_normalized = cv2.normalize(depth_sharpened, None, 0, 65535, cv2.NORM_MINMAX, dtype=cv2.CV_16U)
|