Compact3D (CompGS)

repository·main·Indexed 42 days ago

https://github.com/ucdvision/compact3d

A method for reducing storage and memory requirements of 3D Gaussian Splatting models using vector quantization. CompGS applies K-Means quantization to covariance and color parameters to achieve 10-20x compression, and up to 50x with opacity regularization.

Tokens
730
Snippets
4
Records
4
Agent score
3%

What's inside Compact3D

  1. Train a CompGS model

    main

    Training is performed using the run.sh script located in the gaussian-splatting directory.

    Steps:

    1. Open run.sh and modify the paths for your dataset and the output folder.
    2. Execute the training script:
      cd gaussian-splatting
      bash run.sh

    Optimization Tips: To reduce training time by 30%-50% at the cost of a minor performance reduction, you can:

    • Decrease kmeans_iters (e.g., from 10 to 5).
    • Increase kmeans_freq (e.g., to 200).

    Opacity Regularization: By default, run.sh includes the opacity_reg argument. This regularizes opacity values and prunes highly transparent Gaussians, leading to further compression (up to 40-50x total) and faster rendering. To disable this, remove opacity_reg from the arguments list in run.sh.

    cd gaussian-splatting
    bash run.sh
  2. Render and Evaluate CompGS models

    main

    Once training is complete, use the standard 3D Gaussian Splatting rendering and evaluation scripts.

    Important: When working with quantized models, you must use the --load_quant flag. To evaluate an original non-quantized model, omit this flag.

    Generate Renderings:

    python render.py -m <path to trained model> --skip_train --load_quant
    • --skip_train: Avoids rendering images from the training set camera viewpoints.
    • --load_quant: Required to load the quantized model parameters.

    Compute Metrics:

    python metrics.py -m <path to trained model>
    python render.py -m <path to trained model> --skip_train --load_quant
    python metrics.py -m <path to trained model>
  3. Convert quantized models to PLY for visualization

    main

    Standard 3D Gaussian Splat viewers cannot directly open quantized models. To visualize a trained model in an off-the-shelf viewer, you must first decompress it into a standard .ply file.

    Run the following command to generate a file named point_cloud_decompressed.ply in the project's save path:

    python decompress_to_ply.py -m <path to trained model>
  4. Install and Setup CompGS (Compact3D)

    main

    CompGS is based on the official 3D Gaussian Splatting repository. To set up the environment, follow these steps:

    1. Clone the CompGS repository:
      git clone https://github.com/UCDvision/compact3d
      cd compact3d
    2. Install the official 3D Gaussian Splatting repository following its specific instructions.
    3. Install the bitarray package to handle K-Means indices efficiently:
      pip install bitarray
    4. After installing 3D Gaussian Splatting, ensure you have a gaussian-splatting directory inside your compact3d folder. Move the downloaded files from the CompGS repo to the appropriate locations within that folder using the provided script:
      bash move_files_to_gsplat.sh
    git clone https://github.com/UCDvision/compact3d
    cd compact3d
    pip install bitarray
    bash move_files_to_gsplat.sh