Spaces:
Sleeping
Sleeping
Georg commited on
Commit ·
3db9095
1
Parent(s): 7cef22c
Update RGB image format from JPG to PNG and enhance Gradio UI with troubleshooting tips
Browse files
app.py
CHANGED
|
@@ -24,12 +24,10 @@ from masks import generate_naive_mask
|
|
| 24 |
|
| 25 |
DEFAULT_DATA_DIR = Path("/app/tests/reference/t_shape")
|
| 26 |
DEFAULT_MESH = DEFAULT_DATA_DIR / "t_shape.obj"
|
| 27 |
-
DEFAULT_RGB = DEFAULT_DATA_DIR / "rgb_001.
|
| 28 |
DEFAULT_DEPTH = DEFAULT_DATA_DIR / "depth_001.png"
|
| 29 |
DEFAULT_REF_IMAGES = [
|
| 30 |
-
DEFAULT_DATA_DIR / "rgb_001.
|
| 31 |
-
DEFAULT_DATA_DIR / "rgb_002.jpg",
|
| 32 |
-
DEFAULT_DATA_DIR / "rgb_003.jpg",
|
| 33 |
]
|
| 34 |
|
| 35 |
_slimsam_model = None
|
|
@@ -523,6 +521,7 @@ def gradio_estimate(
|
|
| 523 |
# Gradio UI
|
| 524 |
with gr.Blocks(title="FoundationPose Inference", theme=gr.themes.Soft()) as demo:
|
| 525 |
gr.Markdown("# 🎯 FoundationPose 6D Object Pose Estimation")
|
|
|
|
| 526 |
|
| 527 |
mode_indicator = gr.Markdown(
|
| 528 |
"**Mode:** 🟢 Real FoundationPose with GPU",
|
|
@@ -599,6 +598,12 @@ with gr.Blocks(title="FoundationPose Inference", theme=gr.themes.Soft()) as demo
|
|
| 599 |
Upload a query image containing the initialized object.
|
| 600 |
The model will estimate the 6D pose (position + orientation).
|
| 601 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 602 |
|
| 603 |
with gr.Row():
|
| 604 |
with gr.Column():
|
|
|
|
| 24 |
|
| 25 |
DEFAULT_DATA_DIR = Path("/app/tests/reference/t_shape")
|
| 26 |
DEFAULT_MESH = DEFAULT_DATA_DIR / "t_shape.obj"
|
| 27 |
+
DEFAULT_RGB = DEFAULT_DATA_DIR / "rgb_001.png"
|
| 28 |
DEFAULT_DEPTH = DEFAULT_DATA_DIR / "depth_001.png"
|
| 29 |
DEFAULT_REF_IMAGES = [
|
| 30 |
+
DEFAULT_DATA_DIR / "rgb_001.png"
|
|
|
|
|
|
|
| 31 |
]
|
| 32 |
|
| 33 |
_slimsam_model = None
|
|
|
|
| 521 |
# Gradio UI
|
| 522 |
with gr.Blocks(title="FoundationPose Inference", theme=gr.themes.Soft()) as demo:
|
| 523 |
gr.Markdown("# 🎯 FoundationPose 6D Object Pose Estimation")
|
| 524 |
+
gr.Markdown("Project page: https://nvlabs.github.io/FoundationPose/")
|
| 525 |
|
| 526 |
mode_indicator = gr.Markdown(
|
| 527 |
"**Mode:** 🟢 Real FoundationPose with GPU",
|
|
|
|
| 598 |
Upload a query image containing the initialized object.
|
| 599 |
The model will estimate the 6D pose (position + orientation).
|
| 600 |
""")
|
| 601 |
+
gr.Markdown("""
|
| 602 |
+
**Troubleshooting**
|
| 603 |
+
- **Camera intrinsics**: make sure `fx`, `fy`, `cx`, `cy` match the query RGB resolution. If you resize the RGB image, scale intrinsics by the same factor.
|
| 604 |
+
- **Depth values**: verify units. 16-bit PNG is usually millimeters (converted to meters here). If values look clipped or too small/large, confirm the sensor's depth scale.
|
| 605 |
+
- **Image scales**: RGB and depth must be the same size. If they differ, depth is resized to match RGB (nearest-neighbor). Prefer exporting aligned pairs from the same stream.
|
| 606 |
+
""")
|
| 607 |
|
| 608 |
with gr.Row():
|
| 609 |
with gr.Column():
|
tests/reference/t_shape/depth_001.png
CHANGED
|
|
tests/reference/t_shape/rgb_001.jpg
DELETED
|
Binary file (4.62 kB)
|
|
|
tests/reference/t_shape/rgb_001.png
ADDED
|