Skip to content

Sycamore-Ma/SIGGRAPH-GS-ColorVis

Repository files navigation

SIGGRAPH-GS-ColorVis

SIGGRAPH-GS-COLORVIS is a lightweight color utility designed to assist with consistent and visually appealing SIGGRAPH-style color assignments for multi-class data visualization, particularly in .ply point cloud segmentation tasks.

The core module is color_generator.py, which can be integrated into any project requiring high-quality category-wise color generation. Other scripts serve as optional testing and demonstration tools.


🎨 1. color_generator.py: Consistent Color Generation

📥 Installation

Clone the repository:

git clone git@github.com:Sycamore-Ma/SIGGRAPH-GS-ColorVis.git
cd SIGGRAPH-GS-ColorVis

Prepare the environment:

conda create -n colorvis python=3.10
conda activate colorvis
pip install -e .

💡 Tip for Windows users:
If you prefer not to use conda, you can use your system-wide Python and install dependencies with:

pip install matplotlib numpy open3d plyfile

Usage

Simply copy the file to your project directory:

cp color_generator.py path_to_your_project/

Don't forget to switch the conda environment to your_env if you want to keep working on your own project.

In your Python script where you want to use the color generator, import the class and create an instance:

from color_generator import generate_colors

# Example usage
num_classes = 10  # Number of classes
color_list = generate_colors(num_classes)
print(color_list)
Print(type(color_list))

The return value is a list of RGB tuples, each representing a color for a class. The RGB values are in the range of 0.0 to 1.0.

Example of the output

Circle Stripe Cluster Cluster 3D Bar Plot
Matplotlib Point Open3D Point Open3D (No Light) Gaussian 3D (No Light)

🧪 2. test_color_generator.py: Testing the Color Generator

This script is designed to test the functionality of the color_generator.py module. It generates a set of palettes, point clusters, plots, or others with a specified number of classes and visualizes them using matplotlib.

Testing with different counts of colors

The first argument is the number of colors to generate:

cd SIGGRAPH-GS-ColorVis
python colors_test.py 10
python colors_test.py 20
python colors_test.py 60

Testing with different palettes

... and the second argument is the palette type. The palette type can be one of the following:

python colors_test.py 30 all
python colors_test.py 30 circle
python colors_test.py 30 stripe
python colors_test.py 30 cluster
python colors_test.py 30 cluster3d
python colors_test.py 5 plot

🧪 3. render_ply_matplotlib.py and render_ply_open3d.py: Testing the Gaussian Rendering

These scripts are designed to test the Gaussian rendering of point clouds using matplotlib and open3d. They load a .ply file, extract the point cloud data, and visualize it using the specified library. The header format of the .ply file is as follows:

ply
format ascii 1.0
element vertex 63720
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
property int seg_id_l1
property int seg_id_l2
property int seg_id_l3
property int seg_id_l4
property float qw
property float qx
property float qy
property float qz
property float sx
property float sy
property float sz
property float alpha
end_header

Usage

To run the scripts, use the following commands:

python render_ply_matplotlib.py ply/gaussian.ply
python render_ply_open3d.py ply/gaussian.ply

📜 4. Blender Pathway

The Blender pathway enables advanced rendering of point clouds and 3DGS spheres with realistic lighting and shading effects inside the Blender environment.
(Blender version: 4.1 used in testing)

⚙️ Setup (Windows OS for example)

  1. Download and install Blender on your Windows machine.
  2. Add the Blender executable to your system environment variables (so it can be called directly from the command line as blender ... through python scripts).

🚀 Usage

  • Batch Rendering
    Configure the paths in blender/run_render_multi.py and adjust the rendering parameters in blender/render_multi.py. Then execute:
    python ./blender/run_render_multi.py
  • Transparent Rendering Modify the parameters in blender/render_overlap.py as needed, then run:
    python ./blender/render_overlap.py

This pathway provides high-quality rendering with advanced lighting effects, supporting both batch workflows and transparent outputs for publication-ready visualizations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages