This software is a python wrapper for the Compute Rasterizer project. It provides a python interface to the Compute Rasterizer, and also provides a viewer to visualize the point clouds (currently supporting NetCDF and LAS formats). The viewer is based on OpenGL and GLFW.
Running this software needs the following dependencies:
- CUDA 12.1
- OpenGL 4.6
- Python 3.10
- LibTorch 2.1.1+cu121 (native installations both debug and release modes)
- GLM
- GLFW
- GLEW
- Pybind11 (could be installed from
vcpkg) - NetCDF-C
- PyCuda
All of the above external libraries are provided in the libs folder. The CUDA and OpenGL versions are the ones used for development. The software may work with other versions of CUDA and OpenGL, but it is not tested.
Both the debug and release versions of PyTorch are not included in the libs folder. You can download them from here. Refer to this blog for more details on how to setup LibTorch in Visual Studio.
To install PyCuda, run the following command in the command prompt (assuming you are in the project root directory):
git clone https://github.com/inducer/pycuda
cd pycuda
git submodule update --init
export PATH=$PATH:/usr/local/cuda/bin
./configure.py --cuda-enable-gl
python setup.py install
cd ..- Open
pycr->pycr.slnin Visual Studio (tested on VS2022) - Build the
pycrproject in the solution (in Release-x64 mode) - Run the solution
pycr provides the following python modules:
pycr.compute_loop: Compute loop implementation of Compute Rasterizer. Currently supports only vanilla version of thecompute_loop. It provides the following classes:pycr.LasLoader(lfname -> str): LAS file loader. lfname: LAS file pathpycr.NCLoader(ncfname -> str): NetCDF file loader. ncfname: NetCDF file pathpycr.compute_loop.ComputeLoopLas: Compute loop implementation for handling LAS files. (CheckoutcomputeLoop_wrap.cppfor the exposed APIs)pycr.compute_loop.ComputeLoopNC: Compute loop implementation for handling NetCDF files. (CheckoutcomputeLoop_wrap.cppfor the exposed APIs)
pycr.globj: OpenGL object implementation of Compute Rasterizer. It provides the following classes:pycr.globj.Framebuffer: OpenGL framebuffer object. (Checkoutglobj_wrap.cppfor the exposed APIs)pycr.globj.Texture: OpenGL texture object. (Checkoutglobj_wrap.cppfor the exposed APIs)
pycr provides the following python functions:
pycr.init_GL(): Initializes OpenGL context
Also checkout the render_app.py for a sample usage of the above modules and functions.
On running the software, it opens up a viewer to visualize the point cloud of your choice. You can set the point cloud to visualize by changing the --inpf flag of the python script render_app.py. The viewer has the following controls:
Left Mouse Button+Mouse Movement: Rotate the cameraMouse Wheel: Zoom in/outS: Save the current view torender_app/data/screenshot
Also check out the --help flag of the python script render_app.py for more options. The flags could be added in the property pages of the python project in Visual Studio.