datasets
Loads TUM, ICL-NUIM, and ScanNet RGB-D sequences into deterministic batched tensors, with preprocessing, pose association, semantic labels, and RGBDImages handoff guidance.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- datasets
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Loads TUM, ICL-NUIM, and ScanNet RGB-D sequences into deterministic batched tensors, with preprocessing, pose association, semantic labels, and RGBDImages handoff guidance.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md7.6 KB
- 参考文档references/data-formats.md4.5 KB
- 参考文档references/troubleshooting.md7.2 KB
- 参考文档references/workflows.md7.0 KB
- 脚本scripts/dataset_layout_check.py7.7 KB
03 SKILL.md 正文
Dataset adapters operating guide
Use this sub-skill when a task needs one of the repository's dataset adapters,
its file/sequence conventions, RGB-D preprocessing, trajectory association,
semantic labels, or a DataLoader batch ready for RGBDImages. The adapters
consume data already present on disk. They do not download, extract, or repair
datasets.
Keep the detailed contracts in the bundled references:
- API reference — constructors, utility functions, option gates, and output ordering.
- Workflows — preflight, sequence slicing, pose
normalization, and
DataLoaderhandoff. - Data formats — directory trees, metadata line layouts, units, shapes, and label encodings.
- Troubleshooting — actionable diagnosis for missing files, malformed associations, empty sequences, and external-data limits.
- Layout checker — a deterministic, read-only checker for user-supplied dataset paths.
Route the request
- Identify the adapter from the data contract, not from a directory name:
TUMexpects timestamp lists and optional quaternion ground truth,ICLexpects TUM-compatible associations plus a block-matrix trajectory, andScannetexpects sequence-association metadata that points into scene extraction directories. - Confirm the external-data boundary before constructing the dataset. The package does not include these datasets, and the repository's TUM, ICL, and ScanNet native tests are data-gated. A missing local root is a precondition failure, not a reason to invent a substitute path or download data.
- Run the layout checker against paths supplied by the caller. It only reads directory entries, metadata text, and selected path references; it never downloads, writes, renames, deletes, or mutates input data. A nonzero result means the adapter's expected structure is incomplete, not that the dataset itself is corrupt.
- Choose
seqlen,dilation,stride,start,end, output resolution, image layout, color normalization, and return flags deliberately. RecordB,L,H,W, whether labels are requested, and whether poses are available before handing the batch to a structure.
Construct an adapter
Import directly from the dataset modules:
from gradslam.datasets.tum import TUM
from gradslam.datasets.icl import ICL
from gradslam.datasets.scannet import Scannet
The default return configuration asks for every output that the adapter can
provide. That means TUM returns color, depth, intrinsics, normalized poses,
relative transforms, names, and timestamps; ICL returns the same except for
TUM timestamps; ScanNet returns those RGB-D/pose fields plus names and labels.
Return flags remove fields from the tuple rather than inserting None values,
so unpack only the fields enabled by the configuration. See the API reference
for exact order.
Use a tuple for an explicit selection of sequences, trajectories, or scenes.
A string is interpreted as a split-file path only when it exists; it is not a
single sequence name. None means all discoverable items for TUM and ICL; for
ScanNet it means all sequence metadata files. Lists are rejected by the
adapter constructors.
For a first inspection, prefer a small seqlen and reduced height/width,
keep shuffle=False, and request only fields needed by the next operation.
DataLoader is ordinary PyTorch collation: with batch_size=B, each image
field gains a leading batch dimension and names/timestamps are collated as a
sequence of strings (commonly a list).
Preserve preprocessing contracts
- Color is resized with bilinear interpolation. By default it remains in its
source-like
[0, 255]scale;normalize_color=Trueconverts it to approximately[0, 1]. - Depth is resized with nearest-neighbor interpolation, gains a singleton
channel, and is divided by the dataset scale:
5000.0for TUM and ICL,1000.0for ScanNet. The resulting depth is in the adapter's meter-like convention. channels_first=Falseyields(L,H,W,3)color and(L,H,W,1)depth;channels_first=Trueyields(L,3,H,W)and(L,1,H,W). A collated batch therefore has(B,L,...). Intrinsics and poses remain(B,1,4,4)and(B,L,4,4).- Intrinsics are scaled independently by
height/480andwidth/640. Scalefxandcxby the width ratio, andfyandcyby the height ratio. Do not rescale a matrix twice. - Pose and transform fields are only loaded when
return_poseorreturn_transformrequires them. Each sequence is normalized to the first pose; its first normalized pose and first relative transform are identity.
Handoff into RGBDImages
For an ordinary channels-last batch with all required fields:
from torch.utils.data import DataLoader
from gradslam.structures.rgbdimages import RGBDImages
loader = DataLoader(dataset, batch_size=2, shuffle=False)
colors, depths, intrinsics, poses, transforms, names = next(iter(loader))[:6]
rgbd = RGBDImages(colors, depths, intrinsics, poses, channels_first=False)
The exact slice above is appropriate for ICL; TUM has a seventh timestamp
field and ScanNet has a seventh label field. The transforms, names,
timestamps, and labels are not constructor arguments for RGBDImages; retain
them separately. If channels_first=True, pass that same flag to
RGBDImages. Do not silently omit intrinsics or replace absent poses with an
identity tensor: a caller that needs geometry must request/provide them.
For ScanNet labels, keep the label tensor separate from RGB-D geometry. Labels
are resized with nearest-neighbor interpolation and returned with a singleton
last channel by the implementation, so a collated batch is typically
(B,L,H,W,1) even when channels_first=True; older prose may describe it as
(L,H,W). Use seg_classes="nyu40" to retain the source indexing, or
seg_classes="scannet20" to remap the supported source ids to the contiguous
20-class palette. Use get_color_encoding and
datautils.create_label_image only when a visualization or colorized label
image is explicitly needed, and verify the palette representation against the
installed release.
Boundaries and verification
This skill does not promise that any external dataset is present, that a split
file names valid items, or that all referenced image/pose files are readable.
The checker reports path existence only; adapter construction and one small
__getitem__ are the next data-dependent verification step. Do not run
network downloads, full native dataset tests, GPU flows, GUI visualization, or
notebook execution while drafting or when only a layout check was requested.
The deterministic CPU utility coverage is the strongest data-independent signal. TUM, ICL, and ScanNet adapter tests/examples are not guaranteed without their external data and prepared extraction metadata. Keep that status explicit in reports and handoffs.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).