This repository contains visualization tools for 3D semantic scene completion and training analysis.
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 mitsubaCreate 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 PillowValidate 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()To test the visualization tools, download example data from OneDrive:
- All Data (Recommended): Download All
- Includes: RGB, Gaussian, and Voxel data
-
Gaussian Data: Download
- For:
gaussian/vis_gs.shandgaussian/vis_gs_glob.sh
- For:
-
Voxel Data: Download
- For:
voxels/vis_occ.shandvoxels/vis_occ_rot.sh
- For:
-
RGB Data: Download
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 nameFor 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 nameTypical 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_ROOTorPCD_ROOTvariable at the top of each script.
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 plots3D 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 + GIFQuick mode: Auto-generate with defaults - only select method/scene/frame.
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.shMatplotlib (lightweight):
cd gaussian/matplotlib
conda activate renderpy
bash vis_gs.sh Miscellaneous Figures (pictures/)
Utilities for generating paper figures, color bars, and point flow visualizations.
cd pictures
conda activate renderpy
bash <script_name>.sh 💡 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 usesxvfb-runfor offscreen rendering. Install if needed:sudo apt-get install xvfb