gapseg / README.md
haeing's picture
Upload README.md with huggingface_hub
c859fbf verified
|
Raw History Blame Contribute Delete
2.58 kB
---
license: mit
tags:
- robotics
- 3d-reconstruction
- shape-completion
- point-cloud
- perception-for-manipulation
library_name: gapseg
---
<p align="center">
<img src="mascot.png" width="240" alt="GapSeg mascot"/>
</p>
<h1 align="center">🦎 GapSeg</h1>
<p align="center"><b>Diagnosis-Gated Learned Shape Completion</b></p>
<p align="center"><i>One RGB-D photo in β†’ a complete 3D shape out ✨</i></p>
---
A single photo of an object gives a **broken, half-there 3D shape** 🫠 β€” hidden
sides are just missing. GapSeg is a little chameleon πŸ¦ŽπŸ” that **looks at each
object, guesses which ones came out distorted, and re-grows only those** with a
learned network. The result beats stitching many camera angles together.
<p align="center">
<img src="gallery.gif" width="620" alt="single RGB-D to completed 3D across 6 scenes"/>
</p>
<p align="center"><sub>one RGB-D frame β†’ completed 3D, across 6 GraspNet scenes πŸŒ€</sub></p>
## ✨ Why it's neat
- πŸ” **Diagnose first** β€” predict per-object distortion from a single frame
- 🧩 **Complete only what's broken** β€” learned shape completion, gated by the diagnosis
- πŸ† **Beats geometric multi-view fusion** β€” with just one view + completion
## πŸ“Š Results (GraspNet, 278 objects, chamfer mm ↓ lower = better)
| method | chamfer | vs single |
|---|--:|--:|
| πŸ“· single view | 6.60 | β€” |
| 🧡 geometric fusion | 5.64 | 88% βœ… |
| 🧩 **single + completion** | **2.75** | 95% βœ… |
| 🦎 **diagnosis-gated completion** | **2.84** | 94% βœ… |
> 🎯 **One photo + learned completion (2.75 mm) beats fusing many views (5.64 mm).**
> Gating it by the diagnoser keeps the gain while only completing the hard objects.
## πŸš€ Usage
```python
from gapseg.pipeline import GapSegPipeline
pipe = GapSegPipeline.from_pretrained("haeing/gapseg", device="cuda")
# rgb: HxWx3 uint8 Β· depth_m: HxW float (metres) Β· K: 3x3
# instances: [{"inst_id": 1, "mask": HxW bool, "R": 3x3, "t": (3,)}, ...]
out = pipe.infer(rgb, depth_m, K, instances)
for o in out:
print(o["inst_id"], o["dims_cm"], "completed:", o["completed"])
```
🧭 `R`/`t` (object pose) drive completion; objects with no pose or below the
diagnosis threshold return their single-view cloud.
## πŸ“¦ Contents
- 🧠 `sq2_gview/best.pt` β€” the G_view diagnoser (RGB-D β†’ distortion / conditions)
- 🧩 `sq3_completion/best.pt` β€” the PCN shape-completion network
- πŸ–ΌοΈ `gallery.gif` β€” rotating demo across 6 scenes
<p align="center"><sub>made with 🦎 + πŸ” Β· single view, whole shape</sub></p>