Alessio Grancini
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -276,11 +276,11 @@ def get_detection_data(image_data):
|
|
276 |
|
277 |
# Use get_masked_depth to get mean depth directly from depthmap and mask
|
278 |
masked_depth_map, mean_depth = utils.get_masked_depth(depthmap, mask)
|
279 |
-
|
280 |
|
281 |
# Handle invalid or NaN mean_depth
|
282 |
if (np.isnan(mean_depth) or not isinstance(mean_depth, (int, float)) or mean_depth <= 0):
|
283 |
-
|
284 |
mean_depth = 1.0 # Fallback to 1.0 meter
|
285 |
|
286 |
|
|
|
276 |
|
277 |
# Use get_masked_depth to get mean depth directly from depthmap and mask
|
278 |
masked_depth_map, mean_depth = utils.get_masked_depth(depthmap, mask)
|
279 |
+
print(f"Debug - Object {idx}: Masked depth min/max: {masked_depth_map.min()}, {masked_depth_map.max()}, Mean depth: {mean_depth}")
|
280 |
|
281 |
# Handle invalid or NaN mean_depth
|
282 |
if (np.isnan(mean_depth) or not isinstance(mean_depth, (int, float)) or mean_depth <= 0):
|
283 |
+
print(f"Warning: Invalid mean depth ({mean_depth}) for Object {idx}. Using default depth of 1.0...")
|
284 |
mean_depth = 1.0 # Fallback to 1.0 meter
|
285 |
|
286 |
|