3dgsconverter

francescofugazziMIT活跃维护

命令行工具,用于在 3DGS、KSplat、SPZ、Splat 等十余种 3D 高斯泼溅模型格式间互转,并支持 GPU 加速的统计离群点与密度滤波。

A Python command-line utility for converting and processing 3D Gaussian Splatting models. Supports N-to-N conversion between 3DGS (.ply), KSplat, SOG, SPZ, Splat, CloudCompare, Parquet, and Compressed PLY. Includes GPU-accelerated filtering (SOR, Density).

0.9.1发布于 2026-08-01 10:35 UTC604star42fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
conda create -n gsconv python=3.10
conda activate gsconv
pip install git+https://github.com/francescofugazzi/3dgsconverter.git
硬件要求按 README 说明

GPU 加速依赖 Taichi,支持 NVIDIA CUDA、Apple Metal 及 Vulkan/集成 GPU;README 未给出具体显存要求,也未说明纯 CPU 运行方式。

支持 Apple Silicon需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在 3DGS、KSplat、SOG、SPZ 等格式间互转并做 GPU 加速滤波的命令行工具

命令行工具,用于在 3DGS、KSplat、SPZ、Splat 等十余种 3D 高斯泼溅模型格式间互转,并支持 GPU 加速的统计离群点与密度滤波。

核心能力

  • 任意支持格式之间 N-to-N 互转,输出名可自动推导
  • 用 Taichi 在 GPU 上并行做 K-Means 压缩与 SOR 离群点剔除
  • 按 BBox、透明度、密度、SOR 顺序链式过滤原始数据
  • 用 --compression_level 在质量与体积间调节压缩
  • 用 --extra_elements 保留 PLY 中的非标准属性

容易踩的坑

GPU 加速需确保已安装 taichi,否则只能走非加速路径;标准导出默认把 SH 截到 3 阶,要保留 SH4 需加 --preserve_sh4 或对 SPZ 用 spz_version=4;旧参数 --density_filter 和 --remove_flyers 已废弃,需改用 --density_sensitivity 和 --sor_intensity。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本0.9.1
  1. 0.9.1Release 0.9.1 - Changelog最新正式版2026-08-01 · 2026-08-01 10:35 UTC
    • Added legacy SOGS v1 read and write support alongside SOG v2.
    • Added support for both bundled .sog ZIP files and unpacked directory layouts for SOG v1 and v2.
    • Added direct meta.json input support for unpacked SOG datasets.
    • Added --sog_version to select legacy v1 output while keeping SOG v2 as the default.
    • Improved SOG auto-output, overwrite handling, and --info reporting for version and layout detection.
    • Corrected SOG quaternion decoding and aligned SOG v2 output with the required Morton ordering.
    • Fixed the --about command so it works without requiring an argument.
    • Updated the README with the SOG v1/v2 compatibility matrix, usage examples, and layout behavior.
  2. 0.9.0Release 0.9.0 - Changelog2026-05-22 · 2026-05-22 16:25 UTC
    查看更新说明
    • Added native support for SPZ v4 in both input and output.
    • Kept SPZ v3 as the default write target to preserve backward compatibility.
    • Extended SH handling up to degree 4, with correct inference, trimming, and roundtrip behavior.
    • Added --preserve_sh4 as an experimental opt-in for compatible formats that can carry SH4.
    • Updated format policies so standard exports remain capped at SH3 unless SH4 is explicitly preserved.
    • Improved --info output to report SPZ versions, legacy vs standard SPZ files, and SH4 as an extended non-standard schema where applicable.
    • Updated the format matrix and documentation to reflect native SPZ v4 support and the experimental SH4 preservation policy.
  3. 0.8.2Release 0.8.2 - Changelog2026-05-02 · 2026-05-02 08:56 UTC
    查看更新说明
    • Avoid importing gsconverter from setup.py before dependencies are installed.
  4. 0.8.1Release 0.8.1 - Changelog2026-05-02 · 2026-05-02 08:49 UTC
    查看更新说明
    • Merge PR #30: replace plyfile with built-in PLY reader/writer
    • @swell-d introduced a built-in PLY reader/writer to replace the GPL-licensed plyfile dependency, making the project truly MIT-compliant as requested in #29.
    • Added a minimal internal PLY implementation covering the exact API surface used by gsconverter.
    • Fixed PLY import handling so --info and other PLY paths work reliably with the built-in reader.
    • Improved canonical 3DGS roundtrips so cc -> 3dgs no longer carries RGB and the output stays aligned with the original 3DGS format.
    • Preserved extra PLY elements when explicitly requested, so supported metadata can survive conversion paths.
    • Thanks to @swell-d for the PR and for solving the licensing issue in a clean way.
  5. 0.8Release 0.8 - Changelog2026-01-13 · 2026-01-13 19:58 UTC
    查看更新说明
    • Significant Core Refactoring: Completely re-architected codebase into modular format handlers and processing pipelines
    • Universal Format Support: Implemented robust N-to-N conversion for 3DGS, KSplat, SPZ, SOG, Splat, CloudCompare, and Parquet
    • GPU-Accelerated Backend: Integrated Taichi Lang for high-performance parallel processing operations
    • Advanced SOR Filtering: Added Statistical Outlier Removal filter with configurable k-neighbors and sigma parameters
    • Density-Based Pruning: Implemented sensitivity-based multi-cluster density filtering for cleaner models
    • SOG Compression: Added native support for SOG format compression with adjustable codebook sizes
    • Vectorized KSplat Writer: Rewrote KSplat export logic using vectorized operations for massive speedup
    • Smart CLI Logic: Introduced intelligent auto-output naming and interactive overwrite protection
    • Extra Elements Handling: Added comprehensive system to detect, report, and preserve non-standard PLY attributes
    • Compressed PLY Support: Added specific handling for Web-optimized Compressed PLY format reading and writing
    • Spherical Harmonics Safety: Enforced strict SH degree validation to prevent artificial upscaling artifacts
    • Coordinate System Fixes: Standardized coordinate handling for SPZ and Parquet exports
    • CLI Aliases: Registered new gsconv and 3dgsconv entry points for streamlined workflow
    • Robust Error Handling: Improved exception management and user feedback across all conversion paths
    • Smart No-Op Detection: Added logic to prevent redundant processing loops during same-format operations
    • Metadata Inspection: Enhanced --info command to report detailed header data and extra element presence
    • Version Bump: Project updated to v0.8.0 reflecting major architecture changes

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    3D Gaussian Splatting Converter

    GitHub Sponsor Buy Me A Coffee

    A versatile, high-performance tool for converting between various 3D Gaussian Splatting formats. It supports advanced filtering, GPU acceleration, and universal N-to-N conversion between all supported formats.

    Key Features

    • Universal Conversion: Convert any supported format to any other format (e.g., .ply to .ksplat, .spz to .ply, .sog to .sog).
    • Cross-Platform: Fully compatible with Windows, Linux, and macOS (Apple Silicon & Intel).
    • GPU Acceleration: Built-in GPU support via Taichi Lang for extremely fast K-Means clustering (SOG/KSplat compression) and Statistical Outlier Removal (SOR). Supports NVIDIA CUDA, Apple Metal, and Vulkan/Integrated GPUs.
    • Advanced Filtering:
      • Region of Interest: Crop using Manual Bounding Box (Runs first for speed).
      • Alpha/Opacity: Remove transparent splats.
      • Density Control: Remove sparse areas while keeping dense clusters (Multi-cluster support).
      • Outlier Removal: Statistical Outlier Removal (SOR) to clean up "flyers".
    • Compression Control: Balance quality and file size with --compression_level (0 = Max Quality).
    • Format Agnostic: Filters apply to the intermediate raw data, so they work on ANY input format.
    • Custom Data Preservation: Use --extra_elements to maintain non-standard PLY properties (like camera parameters) when converting between PLY formats.

    Supported Formats & Peculiarities

    FormatExtensionDefault Max SHSH4 Opt-InFeatures & Parameters
    3DGS PLY.ply3--preserve_sh4 (experimental)Standard Format. Full float32. --sh_level: Caps SH degree.
    Cloud Compare.ply3--preserve_sh4 (experimental)Viewer Compatible. Forces RGB generation. --rgb: Auto-converts SH to RGB.
    Compressed PLY.ply3--preserve_sh4 (experimental)High Compression. Chunk-based quantization stored in standard PLY container.
    Splat.splat0-Legacy Web. RGB only (No SH).
    KSplat.ksplat2-Streaming/Web. Hierarchical quantization. compression_level 0 (F32), 1 (F16), =2 (Quantized)
    SPZ v3.spz3-Fast Loading. Default write target. Gzip-backed legacy stream format. spz_version=3: Standard v3 output. compression_level: Controls Gzip level.
    SPZ v4.spz4spz_version=4Fast Loading. Plaintext header + ZSTD streams. Native SH4 support. spz_version=4: Enables this path for writing.
    SOG v2.sog ZIP or directory3--preserve_sh4 (experimental)Web/Mobile Optimized. Default bundled output; unpacked layout supported for authoring. compression_level: Codebook size control.
    SOGS v1 (legacy).sog ZIP or directory3--preserve_sh4 (experimental)Read from a directory or ZIP bundle. Write with --sog_version 1; requires square textures and may retain highest-opacity splats to fit the legacy layout.
    Parquet.parquet3--preserve_sh4 (experimental)Data Analysis. Columnar storage. Pandas compatible.

    Installation

    It is recommended to use Conda to manage dependencies.

    1. Create and Activate Conda Environment:

      conda create -n gsconv python=3.10
      conda activate gsconv
      

      (Or use a local .venv if preferred)

    2. Install the Package:

      Option A: Quick Install (via pip)

      pip install git+https://github.com/francescofugazzi/3dgsconverter.git
      

      Option B: Manual Development Install (Clone)

      git clone https://github.com/francescofugazzi/3dgsconverter.git
      cd 3dgsconverter
      pip install -r requirements.txt
      

      Note: To enable GPU acceleration, ensure taichi is installed (pip install taichi). It is included in requirements.txt.

    Usage

    Basic syntax:

    3dgsconverter -i <input_file> -f <target_format> [-o <output_file>] [options]
    

    (Aliases: gsconverter, 3dgsconv, gsconv) Note: -o is optional. If omitted, the output filename is derived from the input with the correct extension. Use --force to overwrite existing files without confirmation.

    Common Examples

    1. Basic Conversion (PLY to KSplat)

    3dgsconverter -i input.ply -f ksplat
    # Creates input.ksplat automatically
    

    2. High-Quality Compression (SOG)

    # Level 1 = High Quality. Level 10 = High Compression.
    3dgsconverter -i input.ply -o output.sog -f sog --compression_level 1
    

    3. Legacy SOGS v1 Output

    # Bundled ZIP
    3dgsconverter -i input.ply -o output_sogs_v1.sog -f sog --sog_version 1
    
    # Unpacked directory
    3dgsconverter -i input.ply -o output_sogs_v1_dir -f sog --sog_version 1
    

    Both SOG versions write a ZIP bundle when the output ends in .sog; use a path without that extension to write an unpacked directory containing meta.json and WebP assets. SOG v1 is a legacy compatibility path, while SOG v2 remains the default. The historical v1 layout uses square textures, so a non-square point count is reduced to the highest-opacity splats.

    4. Cleaning a Point Cloud (Filters)

    # Remove invisible points and outliers
    3dgsconverter -i raw.ply -o clean.ply -f 3dgs --min_opacity 5 --sor_intensity 8
    

    5. Extracting a Region of Interest

    # Crop BEFORE filtering (Attributes: minX minY minZ maxX maxY maxZ)
    3dgsconverter -i scene.spz -o crop.ply -f 3dgs --bbox -2 -2 -2 2 2 2
    

    Parameter Reference

    General
    • -i, --input: Path to source file.
    • -o, --output: Path to destination file (Optional).
    • -f, --format: Target format (3dgs, cc, ksplat, splat, sog, spz, parquet, compressed_ply).
    • --force: Overwrite an existing output file or legacy SOGS directory without prompting.
    • --rgb: Force RGB generation from SH (for supported formats).
    • --extra_elements: Preserves non-standard PLY elements (like extrinsic, intrinsic) when converting between 3DGS/CC formats.
    • --sh_level: Target SH degree (0-4). Tool never upscales; keeps source degree if lower.
    • --crop_sh: Trims SH padding and only writes the coefficients actually present in the source. Useful when you want a tighter, non-canonical output.
    • --preserve_sh4: Experimental opt-in. Preserve SH4 on compatible non-SPZ-v4 formats when the source already contains SH4. Standard writes remain capped at SH3.
    • --spz_version: SPZ output version. Default 3; use 4 for the new plaintext-header format and native SH4 support.
    • --sog_version: SOG output version. Default 2; use 1 for legacy SOGS v1. For either version, a .sog output is bundled and a path without .sog is an unpacked directory.
    • --compression_level: 0-10. Controls quality/size ratio for supported formats (SOG, KSplat, SPZ v3/v4).
      • KSplat: Set to 2 for quantization (experimental levels >2 map to 2).
    Advanced Filters

    Filters run in this specific order for efficiency:

    1. Manual BBox (--bbox): Crops space first.
    2. Alpha Filter (--min_opacity <0-255>): Discards points with opacity < threshold.
    3. Density Filter:
      • --density_sensitivity <0.0-1.0>: Simple slider. 0.0 = Lazy (keeps more), 1.0 = Aggressive (removes sparse halos).
      • --keep_multicluster: If set, keeps all dense clusters. Default: keeps only the largest main cluster.
    4. SOR (Flyers):
      • --sor_intensity <1-10>: Simple slider. 1 = Weak (keeps more), 10 = Strong (removes all outliers).
    5. Auto BBox (--auto_bbox):
      • Calculates the minimal bounding box of the remaining valid points before saving, ensuring tight packing.

    Technical Details

    Built with Taichi Lang for high-performance GPU computing.

    • Parallelism: Voxels and SOR are processed in parallel on the GPU.
    • Differentiable Design: While currently used for conversion, the core is differentiable, allowing for future optimization and training applications.
    • No Upscale Rule: The converter never invents higher SH detail than the source contains. Standard exports remain capped at SH3 by default; use --preserve_sh4 to keep SH4 only on compatible formats, and spz_version=4 for native SPZ SH4 output.

    Credits

    This project builds upon the incredible work of the 3D Gaussian Splatting community. Special thanks to:

    • Inria (GraphDeco): The original 3D Gaussian Splatting paper and implementation.
    • Antimatter15: For the .splat format and the first WebGL viewer.
    • mkkellogg: For the .ksplat format and 3DGS-Three.js integration.
    • Niantic Labs: For the .spz format definition.
    • PlayCanvas: For the .sog format, .ply chunk-quantization schema, and SuperSplat viewer.

    Refactoring & Breaking Changes (Type-Check Safe)

    This project has undergone a complete refactoring to modularize the codebase and improve type safety. As a result, some legacy command-line arguments have been deprecated and replaced with more explicit or user-friendly alternatives.

    Replaced Commands

    Legacy CommandNew EquivalentDescription
    --density_filter [v, t]--density_sensitivity (Slider)Effect: Reduces file size by merging overlapping points.Practical: 0.1 keeps detail, 0.9 aggressively simplifies.
    --remove_flyers [k, s]--sor_intensity (Slider)Effect: Cleans up floating noise/artifacts.Practical: 1.0 is safe, 10.0 is aggressive.

    New Features

    • Format-Specific Compression: The --compression_level flag adapts to the target format:

      • KSplat:
        • 0: No compression (Float32 w/ SH). Max quality.
        • 1: Block compression (Uint16 Pos, Float16 Scale/Rot/SH). Good balance.
        • 2+: Aggressive Block compression (Uint16 Pos, Float16 Scale/Rot, Uint8 SH). Smallest size, lossy SH.
      • SPZ: Controls compression effort. spz_version=3 uses Gzip; spz_version=4 uses ZSTD. This is lossless for the data itself, affecting only file size and save time.
    • SH4 Output Policy: Standard exports stay at SH3 by default. Use --preserve_sh4 for experimental SH4 preservation on compatible formats (3dgs, cc, compressed_ply, parquet, sog) when the source already contains SH4. Older viewers may not support SH4. SPZ v4 is the separate native SH4 path.

      • SOG: Controls SH Palette Quality (0=Max Quality, 9=Min Quality). Note: Texture compression is always Lossless WebP.
      • SOG Versions: SOG v2 is the default and supports both directories and ZIP bundles. Legacy SOGS v1 is also read from either layout and is written with --sog_version 1. Legacy viewers may not support SH extensions.
    • User-Friendly Sliders: New --density_sensitivity (0.0-1.0) and --sor_intensity (1.0-10.0) abstract complex parameters away for easier use.

    • Modular Architecture: The monolith code has been split into formats/, processing/, and utils/ for better maintainability and extensibility.