Spaces:
Sleeping
Sleeping
Georg
commited on
Commit
·
86ef72b
1
Parent(s):
1e45924
Prepare job build context
Browse files- app.py +8 -1
- estimator.py +1 -1
app.py
CHANGED
|
@@ -402,7 +402,14 @@ def gradio_estimate(
|
|
| 402 |
|
| 403 |
if not result.get("success"):
|
| 404 |
error = result.get("error", "Unknown error")
|
| 405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 406 |
|
| 407 |
poses = result.get("poses", [])
|
| 408 |
note = result.get("note", "")
|
|
|
|
| 402 |
|
| 403 |
if not result.get("success"):
|
| 404 |
error = result.get("error", "Unknown error")
|
| 405 |
+
# Still show mask output even on failure
|
| 406 |
+
mask_vis = None
|
| 407 |
+
if debug_mask is not None:
|
| 408 |
+
mask_vis = query_image.copy()
|
| 409 |
+
mask_overlay = np.zeros_like(query_image)
|
| 410 |
+
mask_overlay[:, :, 1] = debug_mask
|
| 411 |
+
mask_vis = cv2.addWeighted(mask_vis, 0.7, mask_overlay, 0.3, 0)
|
| 412 |
+
return f"✗ Estimation failed: {error}", query_image, mask_vis
|
| 413 |
|
| 414 |
poses = result.get("poses", [])
|
| 415 |
note = result.get("note", "")
|
estimator.py
CHANGED
|
@@ -285,7 +285,7 @@ class FoundationPoseEstimator:
|
|
| 285 |
[fx, 0, cx],
|
| 286 |
[0, fy, cy],
|
| 287 |
[0, 0, 1]
|
| 288 |
-
], dtype=np.
|
| 289 |
|
| 290 |
return K
|
| 291 |
|
|
|
|
| 285 |
[fx, 0, cx],
|
| 286 |
[0, fy, cy],
|
| 287 |
[0, 0, 1]
|
| 288 |
+
], dtype=np.float64)
|
| 289 |
|
| 290 |
return K
|
| 291 |
|