TianhangCheng7's picture
gather gt from full dataset (part 3)
46f479f verified
|
Raw
History Blame Contribute Delete
6.7 kB
---
pretty_name: Fire3D Single-Image Data
size_categories: n<1K
tags:
- 3d
- scene-reconstruction
- single-image-3d
- point-cloud
- 3d-front
- depth
---
# Fire3D Single-Image Data
20 indoor scenes rendered from [3D-FRONT](https://tianchi.aliyun.com/specials/promotion/alibaba-3d-scene-dataset).
Each scene is one RGB view with metric depth, an empty-room depth map, ground-truth object
meshes, and per-object 3D boxes — for single-image 3D scene reconstruction and evaluation.
19 of the 20 scenes additionally ship a **full-resolution instance mask** and **complete
per-object / whole-scene meshes** recovered from the source 3D-FRONT room (see
[Instance-level GT](#instance-level-gt-from-3d-front)). ~305 MiB.
```
<index>/ # e.g. 3025, index06 = 003025
├── rgb_<index06>.jpeg # 1296x968 RGB
├── depth_<index06>.npy # (968, 1296) float64, metric z-depth
├── bgdepth_<index06>.npy # (484, 648) float64, depth of the empty room (half res)
├── annotation_<index06>.json # intrinsics, extrinsics, per-object boxes + labels
├── sceneobjgt_<index06>.ply # partial GT object meshes (as shipped), OpenCV camera frame
│ # instance-level GT aligned from 3D-FRONT (19/20 scenes; absent for 3966):
├── instance_<index06>.png # (968, 1296) uint16 instance-id mask (0 = background)
├── instance_<index06>.json # id -> {label, obj_id, model_uuid, n_pixels, ...} + match/similarity
├── instance_overlay_<index06>.png # RGB with the coloured mask blended in, for eyeballing
├── sceneobjfull_<index06>.ply # all objects merged, OpenCV camera frame
└── objects_<index06>/ # per-object meshes: <instid:03d>_<label>.ply
lift_3d_pcd.py # reference loader: depth -> point cloud, + viewer
build_gt_from_3dfront.py # regenerates the instance-level GT from 3D-FRONT
gt_3dfront_summary.json # per-scene match report (room, depth-agreement stats)
```
Scenes: `3025 3084 3126 3200 3266 3277 3376 3392 3401 3431 3454 3477 3844 3847 3966 4033 4087 4091 4124 4135`
## Download
```bash
pip install -U "huggingface_hub[cli]"
hf download TianhangCheng7/Fire3DSingleImageData --repo-type dataset --local-dir single_image
# one scene
hf download TianhangCheng7/Fire3DSingleImageData --repo-type dataset \
--local-dir single_image --include "3025/*"
```
Resumable — re-run if interrupted. In Python: `snapshot_download("TianhangCheng7/Fire3DSingleImageData", repo_type="dataset")`.
## Conventions
- `depth` is **z-depth** (along the optical axis), in metres. Windows / sky are stored as
~9e3 — mask with `depth < 100`.
- `bgdepth` is the same view without objects, at **half resolution**; upsample before
comparing with `depth`.
- `camera_intrinsics` is a pinhole `K` for the **full** 968×1296 image, with integer pixel
indices (`u` = column, `v` = row).
- `camera_extrinsics` = `[R|t]` maps world → **OpenGL** camera (x right, y up, z back) and
is the frame of `bbox3d_camera`. `camera_pose_rot` / `camera_pose_tran` are its inverse.
- `sceneobjgt_*.ply` is in the **OpenCV** camera frame (x right, y down, z forward) — the
frame you get by unprojecting `depth` with `K`, so it overlays the lifted cloud directly.
- World frame is 3D-FRONT: z up, floor at z = 0.
- 2D boxes (`bbox_2d`, `bbox_2d_from_3d`, `render_box`) are at **half resolution**
multiply by 2 for full-res pixels.
Each `obj_dict` entry has `label` / `cls_id`, `obj_id` / `model_file_name`,
`obj_tran` / `obj_rot` (local→world) / `obj_scale`, `bbox3d_world` (3, 8) corners,
`bbox3d_world_center` + `half_length`, `bbox3d_camera`, the 2D boxes, and `occ_iou`.
## Instance-level GT (from 3D-FRONT)
Because `single_image` is a subset of 3D-FRONT, each view is re-aligned to its source
3D-FRONT room to recover a **complete** instance mask and object meshes (the shipped
`sceneobjgt_*.ply` is only a partial merge). `build_gt_from_3dfront.py` does this:
1. index each furniture model UUID → the 3D-FRONT rooms containing it (from the
`*_full.glb` scene graphs);
2. shortlist rooms whose models cover the annotation and RANSAC-fit the glb→world
similarity transform from object-centroid correspondences;
3. disambiguate the room by ray-casting the placed objects through the annotation
intrinsics and comparing the rendered z-depth against the metric `depth`;
4. write the outputs above into the scene folder.
Objects only — walls / floor / ceiling are excluded. The meshes are in the **OpenCV**
camera frame (same as `sceneobjgt_*` / the lifted cloud), so `sceneobjfull_*.ply` overlays
`depth` directly. `instance_*.png` is full resolution and aligned to `rgb_*`; ids `1..N`
index the `objects_<index06>/` meshes and the `instances` list in `instance_*.json`.
Coverage: **19/20 scenes** align to < 1.5 mm median depth error (> 87 % of object pixels
within 5 mm; see `gt_3dfront_summary.json`). **3966 is intentionally omitted** — its
objects are near-coplanar (six identical chairs) so the room could not be recovered
reliably; it keeps only the originally shipped files.
Regenerate (needs `pip install trimesh embreex pillow`; uses a model-UUID index built from
the local 3D-FRONT copy):
```bash
python build_gt_from_3dfront.py # all scenes
python build_gt_from_3dfront.py --scenes 3025 # one scene
```
## Point clouds and visualization
`lift_3d_pcd.py` sits in the dataset root and finds the scenes next to itself, so it runs
with no configuration:
```bash
pip install numpy open3d pillow
cd single_image
```
**1. Point cloud only** (no window, writes files):
```bash
python lift_3d_pcd.py --scene 3025 --save --no-viz --no-gt --no-boxes
```
Writes to `out/lift_3d_pcd/003025/`: `points_world.ply`, `points_world.npz`
(`xyz`, `rgb`, `uv`, `xyz_cam`), `meta_world.json`.
**2. Visualize everything** (cloud + GT meshes + 3D boxes + camera frustum):
```bash
python lift_3d_pcd.py --scene 3025
```
Drag = rotate, scroll = zoom, shift+drag = pan, `q` = quit.
**3. All scenes, foreground only** (no window, object pixels only — uses `bgdepth`):
```bash
python lift_3d_pcd.py --scene all --mask fg --save --no-viz --no-gt --no-boxes
```
One folder per scene under `out/lift_3d_pcd/` (`003025/`, `003084/`, …).
Run `python lift_3d_pcd.py --help` for the remaining flags.
## License
Derived from **3D-FRONT** / **3D-FUTURE** (Alibaba); conventions cross-checked against
[Gen3DSR](https://github.com/AndreeaDogaru/Gen3DSR). Use is subject to the original
3D-FRONT license terms (non-commercial research) — please also cite the 3D-FRONT papers.