data_preparation.md

February 3, 2026 · View on GitHub

Download COLMAP Results

For COLMAP, we recommend to directly use our generated results:

Suppose that you have downloaded and unzip the COLMAP results to ./data folder like

├── data
│   ├── colmap_results
│   │   ├── matrix_city_aerial
│   │   │   ├── train
│   │   │   │   ├── sparse
│   │   │   │   │   ├── 0
│   │   │   │   │   │   ├── cameras.bin
│   │   │   │   │   │   ├── points3D.bin
│   │   │   │   │   │   ├── images.bin
│   │   │   ├── test
│   │   │   │   ├── sparse
│   │   │   │   │   ├── 0
│   │   │   │   │   │   ├── cameras.bin
│   │   │   │   │   │   ├── images.bin
│   │   │   │   │   │   ├── points3D.bin
│   │   ├── matrix_city_street
│   │   │   ├── train
│   │   │   ├── val
│   │   ├── building
│   │   │   ├── train
│   │   │   ├── val
│   │   ├── residence
│   │   │   ├── train
│   │   │   ├── val
│   │   ├── rubble
│   │   │   ├── train
│   │   │   ├── val
│   │   ├── sciart
│   │   │   ├── train
│   │   │   ├── val

Prepare for Tanks and Temple style geometry evaluation

To evaluate surface reconstruction accuracy, please first down load the ground truth point cloud (.ply) and crop volume file (.json) to the ./data. The transform.txt is used to coarsely align target points to gt points. The links are:

Note that Mill19 and UrbanScene3D doesn't provide ground-truth point cloud, thus they are not included. In ./scripts/gt_generate.sh, we provide the script about how we downsample the ground truth point cloud and generate the crop volume. If you need to process the custom dataset, please refer to the script.

Prepare GauU-Scene dataset

For GauU-Scene dataset, please follow instruction here to download. The data includes RGB images and COLMAP results.

Prepare MatrixCity dataset

  1. Download small_city version of aerial data of MatricCity and save to data/matrix_city/aerial.

  2. Unzip the data to input folder for each block in train and test set. You can take scripts/untar_matrixcity_train.sh and scripts/untar_matrixcity_test.sh as reference.

  3. Run following command to prepare data with generated COLMAP results.

    bash scripts/data_proc_mc.sh
    
  4. [Optional] Run following command to prepare data from scratch (The COLMAP step make take a long time for over 5000 images ).

    bash scripts/data_proc_mc_scratch.sh
    
  5. The process above also applies to the street view of MatrixCity's small_city version. The mentioned scripts also contains the required steps for street view data preparation.

Prepare Mill19 & UrbanScene3D datasets

  1. Download data of Mill19 and UrbanScene3D according to instruction from MegaNeRF. Save the data to data/mill19 and data/urban_scene_3d respectively. It is worth noticing that the used UrbanScene3D-V1 should be downloaded from here.

  2. Run following command to prepare data of Mill19 with generated COLMAP results.

    bash scripts/data_proc_mill19.sh
    
  3. [Optional] Run following command to prepare data of Mill19 from scratch (The COLMAP step make take a long time for large amount of images ).

    bash scripts/data_proc_mill19_scratch.sh
    
  4. Run following command to prepare data of UrbanScene3D with generated COLMAP results.

    bash scripts/data_proc_us3d.sh
    
  5. [Optional] Run following command to prepare data of UrbanScene3D from scratch (The COLMAP step make take a long time for large amount of images ).

    bash scripts/data_proc_us3d_scratch.sh
    

Data Preprocessing

The desried dataset folder structure is:

├── data
│   ├── your_scene
│   │   ├── images
│   │   ├── sparse
│   │   │   ├── 0
│   │   │   │   ├── cameras.bin
│   │   │   │   ├── points3D.bin
│   │   │   │   ├── images.bin
│   ├── geometry_gt
│   │   ├── your_scene
│   │   │   ├── your_gt_pcd.ply
│   │   │   ├── your_gt_pcd.json
│   │   │   ├── transform.txt [optional]

Firstly, downsample the images to desired size:

python utils/image_downsample.py data/your_scene/images --factor $DOWNSAMPLE_RATIO

The $DOWNSAMPLE_RATIO is 3.4175 for GauU-Scene, 1.2 for aerial view of MatrixCity, 1.0 for street view of MatrixCity (no downsample), and 4.0 for Mill19 and UrbanScene3D.

Secondly, prepare MoGe-2 for depth regularization:

The depth and mask can be generated with:

python utils/estimate_mask_dataset_depths.py data/your_scene -d $DOWNSAMPLE_RATIO

And generate multi-view information:

python utils/multi_view_filter.py data/your_scene --split_mode {expirement(default) | reconstruction}

Thirdly, prepare pointmap ply file.

# 1. Segment all images into K clusters
#    --split_mode:
#        expirement   (default) → split a ratio of images as validation set
#        reconstruction          → use all images for reconstruction
#    -k: number of segments (clusters)
#    -r: validation split ratio (default: 0.1)
#
python pointmap/scene_images_segment.py data/your_scene_path \
  --split_mode {expirement(default) | reconstruction} \
  -k 4 -r 0.1 \


# 2. Generate PointMap in parallel (multi-GPU)
#    -g: GPU IDs (space-separated, quoted)
#    -k: number of segments (must match Step 1)
#    -b: base directory of the scene data
#    -c: configuration file (choose one preset):
#        gauuscene / matrixcity / mill19
#
bash pointmap/run_para.sh \
  -g "0 1 2 3" -k 4 \
  -b data/your_scene_path \
  -c ./configs/{gauuscene|matrixcity|mill19}.yaml


# 3. Merge all outputs into a single PLY file
mkdir add_ply
python pointmap/merge_all.py \
  --base_dir data/your_scene_path \
  --output add_ply/your_add_name.ply