Skip to content

Made-Gpt/visualization_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tools for Visualization

This repository contains visualization tools for 3D semantic scene completion and training analysis.

🦉 Environment Setup

Base Environment (renderpy)

Create a base environment for general visualization tasks:

# Create environment
conda create -n renderpy python=3.9
conda activate renderpy

# Install required packages
pip install matplotlib numpy Pillow seaborn pandas open3d plyfile scipy tqdm mitsuba

Mayavi Environment (mayavi_clean)

Create a dedicated environment for 3D voxel visualization with Mayavi:

# Create clean environment
conda create -n mayavi_clean python=3.9 -c conda-forge
conda activate mayavi_clean

# Install Mayavi and dependencies
conda install -c conda-forge mayavi
conda install -c conda-forge open3d

# Install additional packages
pip install Pillow

🐦 Testing Your Installation

Test Mayavi Environment

Validate your Mayavi installation with these tests:

(a) Test Qt Backend

from PyQt5.QtWidgets import QApplication, QLabel
import sys
app = QApplication(sys.argv)
label = QLabel("Hello from Qt")
label.show()
app.exec_()

(b) Test TraitsUI

import os
os.environ["ETS_TOOLKIT"] = "qt"
os.environ["QT_API"] = "pyqt5"

from traits.api import HasTraits, Str
from traitsui.api import View, Item

class Person(HasTraits):
    name = Str() 
    traits_view = View(Item('name')) 
 
p = Person(name="ChatGPT") 
p.configure_traits() 

(c) Test Mayavi

import os
os.environ["ETS_TOOLKIT"] = "qt"
os.environ["QT_API"] = "pyqt5"

from mayavi import mlab 
mlab.test_plot3d() 
mlab.show()

📦 Demo Data

To test the visualization tools, download example data from OneDrive:

Quick Links

  • All Data (Recommended): Download All
    • Includes: RGB, Gaussian, and Voxel data

Individual Downloads

  • Gaussian Data: Download

    • For: gaussian/vis_gs.sh and gaussian/vis_gs_glob.sh
  • Voxel Data: Download

    • For: voxels/vis_occ.sh and voxels/vis_occ_rot.sh
  • RGB Data: Download

Setup Instructions

After downloading, extract the data and update the paths in the scripts:

For Gaussian visualization:

# Edit gaussian/vis_gs.sh or gaussian/vis_gs_glob.sh
PLY_ROOT="/path/to/your/downloaded/data"  # Update this path
PLY_FOLD="vis_occ_da_gaussian_cam"  # Or your data folder name

For Voxel visualization:

# Edit voxels/vis_occ.sh
PCD_ROOT="/path/to/your/downloaded/data"  # Update this path
PCD_FOLD="vis_occ_semantic"  # Or your data folder name

Typical structure after extraction:

/path/to/your/downloaded/data/
├── vis_occ_da_gaussian_cam/        # Gaussian data with camera projection
│   ├── scene0000_00/
│   │   ├── pcd_00012.ply
│   │   ├── pcd_00033.ply
│   │   └── pcd_00076.ply
│   └── scene0031_00/
│       └── pcd_00053.ply
|       └── ...
│
├── vis_occ_semantic/               # Voxel occupancy with semantic labels
│   ├── scene0000_00/
│   │   ├── pcd_00012.ply
│   │   ├── pcd_00033.ply
│   │   └── pcd_00076.ply
│   └── scene0031_00/
│       └── pcd_00053.ply
|       └── ... 
│ 
└── rgb_images/                     # RGB images
    └── ...

💡 Tip: The scripts will prompt you if the data path is incorrect. Simply update the PLY_ROOT or PCD_ROOT variable at the top of each script.


🦚 Usage

Training & Efficiency Analysis (experiment/)

Visualize training metrics, efficiency comparisons, and latency analysis.

cd experiment
conda activate renderpy
bash vis_train.sh      # Training loss & mIoU curves
bash vis_effect.sh     # Efficiency metrics (anchors, features, memory)
bash vis_latency.sh    # Latency and parameter scatter plots

→ See detailed documentation


3D Voxel Visualization (voxels/)

Render static and rotating 3D voxel occupancy with Mayavi.

cd voxels
conda activate mayavi_clean
bash vis_occ.sh        # Static visualization
bash vis_occ_rot.sh    # Rotating animation + GIF

Quick mode: Auto-generate with defaults - only select method/scene/frame.

→ See detailed documentation


Gaussian Splatting Rendering (gaussian/)

High-quality Gaussian splatting visualization with Mitsuba or matplotlib.

Mitsuba (recommended):

conda activate renderpy
bash vis_gs.sh
bash vis_gs_glob.sh

Matplotlib (lightweight):

cd gaussian/matplotlib
conda activate renderpy
bash vis_gs.sh 

→ See detailed documentation


Miscellaneous Figures (pictures/)

Utilities for generating paper figures, color bars, and point flow visualizations.

cd pictures
conda activate renderpy
bash <script_name>.sh 

→ See detailed documentation


📝 Important Notes

💡 When using Mayavi, you must set the ETS environment variables at the beginning of your scripts to ensure it correctly uses the Qt backend:

import os
os.environ['ETS_TOOLKIT'] = 'qt'
os.environ['QT_API'] = 'pyqt5'

# Import other modules after setting environment
import open3d as o3d
import numpy as np
from mayavi import mlab
from pathlib import Path
# ...

⚠️ Offscreen Rendering: The rotation tool uses xvfb-run for offscreen rendering. Install if needed:

sudo apt-get install xvfb

About

Tools for visuatization (Gaussian ellipsoids, Semantic Voxels, data analysis, ...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors