File size: 9,891 Bytes
25a49bc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | # NAVI Eval Dataset
This directory contains the curated NAVI evaluation dataset for streaming image-to-3D generation.
Dataset root:
```text
/root/autodl-tmp/data/navi/navi_eval
```
Source code:
```text
/root/autodl-tmp/data/navi/navi_code
```
The loader in `navi_code/data_util.py` is prepared for this dataset layout.
## Subsets
There are two benchmark subsets:
| subset | objects | videos | total frames | purpose |
|---|---:|---:|---:|---|
| `normal` | 31 | 31 | 4333 | standard setting |
| `hard` | 31 | 31 | 4274 | challenging setting |
Both subsets contain the same 31 objects in the same order. Each object has exactly one selected video stream.
## Directory Structure
```text
navi_eval/
README.md
normal/
subset_info.json
3d_dollhouse_sink/
model.glb
info.json
video/
annotations.json
video.mp4
images/
frame_00000.jpg
frame_00015.jpg
...
masks/
frame_00000.png
frame_00015.png
...
depth/
frame_00000.png
frame_00015.png
...
...
hard/
subset_info.json
3d_dollhouse_sink/
model.glb
info.json
video/
annotations.json
video.mp4
images/
masks/
depth/
...
```
Per object:
- `model.glb`: GT 3D model.
- `video/images/`: RGB video frames.
- `video/masks/`: binary object foreground masks.
- `video/depth/`: encoded GT depth maps.
- `video/annotations.json`: per-frame pose, intrinsics, filename, split, and occlusion metadata.
- `video/video.mp4`: original video file for quick visualization.
- `info.json`: object-level metadata, selected video name, frame count, camera model, and source/output paths.
Per subset:
- `subset_info.json`: stable object order and per-object frame counts.
## Quick Start
Use `navi_code/data_util.py` directly:
```python
from pathlib import Path
import sys
sys.path.insert(0, "/root/autodl-tmp/data/navi/navi_code")
import data_util
ROOT = Path("/root/autodl-tmp/data/navi/navi_eval")
objects = data_util.list_eval_objects(ROOT, "hard")
print(objects[:5])
sample = data_util.load_eval_object(
ROOT,
subset="hard",
object_id=objects[0],
max_num_images=4,
load_images=True,
load_depths=True,
load_masks=True,
)
print(sample["object_id"])
print(sample["model_path"])
print(sample["video_root"])
print(len(sample["annotations"]))
print(sample["images"][0].size)
print(sample["depths"][0].shape)
print(sample["masks"][0].size)
print(sample["camera_matrices"][0][0].shape) # object_to_world
print(sample["camera_matrices"][0][1].shape) # intrinsics
```
The returned dictionary contains:
```python
{
"subset": "hard",
"object_id": "...",
"index": 0,
"record": ..., # entry from subset_info.json
"subset_info": ..., # full subset_info.json
"object_root": Path(...),
"video_root": Path(...),
"model_path": Path(...),
"info_path": Path(...),
"annotations_path": Path(...),
"info": ..., # info.json
"annotations": [...],
"camera_matrices": [...], # list of (object_to_world, intrinsics)
"images": [...], # PIL images, if load_images=True
"depths": [...], # numpy arrays, if load_depths=True
"masks": [...], # PIL images, if load_masks=True
"mesh": ..., # trimesh object, if load_mesh=True
"video": ..., # mediapy video array, if load_video=True
}
```
## Iterate Through A Benchmark
```python
from pathlib import Path
import sys
sys.path.insert(0, "/root/autodl-tmp/data/navi/navi_code")
import data_util
ROOT = Path("/root/autodl-tmp/data/navi/navi_eval")
for item in data_util.iter_eval_subset(
ROOT,
"hard",
max_num_images=64,
load_images=True,
load_depths=False,
load_masks=False,
):
object_id = item["object_id"]
model_path = item["model_path"]
images = item["images"]
annotations = item["annotations"]
# Feed images to your streaming image-to-3D model here.
print(object_id, model_path, len(images), annotations[0]["filename"])
```
## Frame Order
The loader sorts annotations by numeric video frame id by default:
```text
frame_00000.jpg
frame_00015.jpg
frame_00030.jpg
...
```
This means `load_eval_object(..., max_num_images=64)` returns the first 64 chronological frames. If you need the raw JSON order, pass:
```python
sample = data_util.load_eval_object(ROOT, "hard", sort_frames=False)
```
## Loading Meshes And Videos
Image/depth/mask/camera loading works with the lightweight dependencies already available in most Python environments:
- `pillow`
- `numpy`
- `torch`
For `load_mesh=True`, install `trimesh`.
For `load_video=True`, install `mediapy`.
The full dependency set is listed in:
```text
/root/autodl-tmp/data/navi/navi_code/requirements.txt
```
Install it with:
```bash
cd /root/autodl-tmp/data/navi/navi_code
pip install -r requirements.txt
```
Example:
```python
sample = data_util.load_eval_object(
ROOT,
"hard",
object_id="3d_dollhouse_sink",
load_mesh=True,
load_video=True,
)
mesh = sample["mesh"]
video = sample["video"]
```
## Camera Matrices
Each annotation contains:
```json
{
"camera": {
"q": [qw, qx, qy, qz],
"t": [tx, ty, tz],
"focal_length": 3024.0,
"camera_model": "pixel_5"
},
"filename": "frame_00000.jpg",
"image_size": [1920, 1080]
}
```
Use:
```python
object_to_world, intrinsics = data_util.camera_matrices_from_annotation(annotation)
```
`load_eval_object` already computes these for every returned annotation:
```python
object_to_world, intrinsics = sample["camera_matrices"][0]
```
## Depth Maps
Depth PNGs are encoded disparity images. Do not read raw PNG values as depth.
Use:
```python
depth = data_util.read_depth_from_png(depth_path)
```
or load all selected depths through:
```python
sample = data_util.load_eval_object(ROOT, "hard", load_depths=True)
depths = sample["depths"]
```
The decoder is:
```python
disparity = uint16_png.astype(np.float32) / (((2**16) - 1) * 10.0)
disparity[disparity == 0] = np.inf
depth = 1.0 / disparity
```
## Masks
Mask PNGs are binary foreground masks. Foreground pixels are nonzero:
```python
import numpy as np
mask = np.array(sample["masks"][0]) > 0
```
Use masks for foreground-only appearance and geometry metrics.
## Suggested Evaluation Loop
For each object:
1. Load the object with `data_util.load_eval_object`.
2. Use the first `N` chronological RGB frames as streaming input.
3. Generate a predicted 3D model.
4. Render the predicted model using the annotation cameras.
5. Compare rendered RGB/depth with GT `images`, `depths`, and `masks`.
Example skeleton:
```python
ROOT = "/root/autodl-tmp/data/navi/navi_eval"
for item in data_util.iter_eval_subset(
ROOT,
"hard",
max_num_images=64,
load_images=True,
load_depths=True,
load_masks=True,
):
object_id = item["object_id"]
images = item["images"]
gt_depths = item["depths"]
masks = item["masks"]
annotations = item["annotations"]
camera_matrices = item["camera_matrices"]
gt_model = item["model_path"]
# pred_model = your_model.generate(images)
# rendered_rgb, rendered_depth = render(pred_model, camera_matrices)
# compute PSNR/SSIM/LPIPS and depth metrics on mask foreground.
```
## Metric Notes
Appearance metrics:
- PSNR
- SSIM
- LPIPS
Geometry metrics:
- Depth MAE
- Depth RMSE
- Acc@5cm
- RelAcc@5
Foreground-only depth metric example:
```python
import numpy as np
valid = (mask > 0) & np.isfinite(gt_depth) & np.isfinite(pred_depth)
err = np.abs(pred_depth - gt_depth)
depth_mae = err[valid].mean()
depth_rmse = np.sqrt((err[valid] ** 2).mean())
acc_5cm = (err[valid] < 5.0).mean()
relacc_5 = ((err[valid] / gt_depth[valid]) < 0.05).mean()
```
## Validation
The dataset and loader were checked after preparation:
- `normal`: 31 objects, 31 videos, 4333 frames.
- `hard`: 31 objects, 31 videos, 4274 frames.
- Every object has `model.glb`, `video/`, and `info.json`.
- For every object, `len(images) == len(masks) == len(depth) == len(annotations)`.
- First image/mask/depth dimensions match for every object.
- No symlinks were found under `navi_eval`.
- `data_util.load_eval_object` successfully loaded RGB images, depth maps, masks, and camera matrices.
- `model.glb` files were loaded with `trimesh`.
- GT mesh surface points were projected into RGB frames using the annotation camera poses.
- Projected mesh bounding boxes were compared with GT mask bounding boxes on first/middle/last frames for all 62 subset entries.
- Alignment check result: 186 frame checks, 0 failures, minimum bbox IoU `0.9583`, mean per-object minimum bbox IoU `0.9926`.
## Validation Notebook
The validation notebook is:
```text
/root/autodl-tmp/data/navi/navi_eval/src_code/NAVI Dataset Tutorial.ipynb
```
A rendered HTML preview is available at:
```text
/root/autodl-tmp/data/navi/navi_eval/src_code/NAVI Dataset Tutorial.html
```
The notebook demonstrates:
- loading `hard` and `normal` with `data_util.py`
- loading RGB frames, masks, decoded depth maps, camera poses, and `model.glb`
- visualizing RGB / mask / depth
- projecting sampled GT mesh surface points onto the RGB image
- overlaying projected mesh points with the GT foreground mask
- validating mesh-camera-mask alignment across all entries
The mesh alignment example image is saved at:
```text
/root/autodl-tmp/data/navi/navi_eval/src_code/mesh_alignment_overlay_example.png
```
To rerun the notebook:
```bash
cd /root/autodl-tmp/data/navi/navi_eval/src_code
jupyter nbconvert --to notebook --execute --inplace "NAVI Dataset Tutorial.ipynb" --ExecutePreprocessor.timeout=600
jupyter nbconvert --to html "NAVI Dataset Tutorial.ipynb" --output "NAVI Dataset Tutorial.html"
```
|