Yezixiao's picture
Upload folder using huggingface_hub
84d92e1 verified

1. preprocess

This section outlines the initial steps required to prepare the raw ScanNet data for further processing. It involves converting the raw scan data into usable formats like point clouds with labels and extracting video frames.

1.1. process scannet200 to get ply with label and instance id

This step processes the raw ScanNet scans (using the ScanNet200 benchmark annotations) to generate .ply files. These files contain the 3D point cloud data for each scene, along with semantic labels (what each point represents, e.g., 'wall', 'chair') and instance IDs (which specific object instance a point belongs to). This is crucial for tasks involving 3D scene understanding.

python ScanNet200/preprocess_scannet200.py \
        --dataset_root ../data/raw_data/scannet/scans \
        --output_root ../data/processed_data/scannet/point_cloud \
        --label_map_file ../data/raw_data/scannet/scannetv2-labels.combined.tsv \
        --train_val_splits_path ScanNet200/Tasks \
        --num_workers 4 \
        --voxel_size 0.01 \
        --normalize_pointcloud

voxel_size=0.001 会显著增加体素化计算量和输出点数,通常仅在需要极高几何细节时才使用;预处理阶段建议先用 0.020.01

1.3. sample frame data and camera intrinsics

From the extracted videos or raw sensor data, this step samples individual frames. Along with the image data for each sampled frame, it also extracts the corresponding camera pose (position and orientation) and camera intrinsics (focal length, principal point). This information is vital for linking the 2D frame content back to the 3D scene structure.

这是一个用于预处理 ScanNet 数据集的 Python 脚本。它的核心任务是从 ScanNet 原始的、经过压缩的传感器数据文件(.sens)中,均匀采样出指定数量的关键帧,并将这些帧相关的各类 2D/3D 视觉信息解耦并导出为标准格式的文件。具体操作看代码

python src/metadata_generation/ScanNet/preprocess/export_sampled_frames.py \
    --scans_dir data/raw_data/scannet/scans \
    --output_dir data/processed_data/ScanNet \
    --train_val_splits_path datasets/ScanNet/Tasks/Benchmark \
    --num_frames 32 \
    --max_workers 32 \
    --image_size 480 640