{"id":22395831,"url":"https://github.com/Natsu-Akatsuki/RangeNet-TensorRT","last_synced_at":"2025-07-31T12:30:46.351Z","repository":{"id":42159800,"uuid":"458163278","full_name":"Natsu-Akatsuki/RangeNet-TensorRT","owner":"Natsu-Akatsuki","description":"Rangenet++ with high-version TensorRT (e.g.8~10), libtorch, CUDA programming.","archived":false,"fork":false,"pushed_at":"2024-12-04T07:58:23.000Z","size":5987,"stargazers_count":54,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T03:12:45.109Z","etag":null,"topics":["cuda","libtorch","semantic-segmentation","tensorrt"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Natsu-Akatsuki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-11T11:42:52.000Z","updated_at":"2025-03-17T04:51:51.000Z","dependencies_parsed_at":"2024-11-28T03:17:43.681Z","dependency_job_id":"8a66b75d-f5ab-4d40-825c-c9e9f4561ce2","html_url":"https://github.com/Natsu-Akatsuki/RangeNet-TensorRT","commit_stats":null,"previous_names":["natsu-akatsuki/rangenettrt8"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Natsu-Akatsuki/RangeNet-TensorRT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natsu-Akatsuki%2FRangeNet-TensorRT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natsu-Akatsuki%2FRangeNet-TensorRT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natsu-Akatsuki%2FRangeNet-TensorRT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natsu-Akatsuki%2FRangeNet-TensorRT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Natsu-Akatsuki","download_url":"https://codeload.github.com/Natsu-Akatsuki/RangeNet-TensorRT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natsu-Akatsuki%2FRangeNet-TensorRT/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268039843,"owners_count":24185807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","libtorch","semantic-segmentation","tensorrt"],"created_at":"2024-12-05T06:02:09.124Z","updated_at":"2025-07-31T12:30:46.341Z","avatar_url":"https://github.com/Natsu-Akatsuki.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# [RangeNet-TensorRT](https://github.com/Natsu-Akatsuki/RangeNet-TensorRT)\n\n🎉 This project has been a pleasure, allowing me to repay technical debt, learn how to locate bugs during model deployment, gain experience with GitHub Actions, and explore CUDA programming. I greatly appreciate the valuable feedback from others that has contributed to improving the project. I hope that this project will be of use to you.\n\n\u003cdiv align=\"center\"\u003e\n\n[English](README.md) | [简体中文](README_cn.md)\n\n\u003c/div\u003e\n\n## 1. Purpose\n\n1. **Use more newer dependencies and APIs**. Specifically, we deploy the [RangeNet repository](https://github.com/PRBonn/rangenet_lib) in an environment with TensorRT 8+, Ubuntu 20.04+, remove Boost dependency, manage TensorRT objects and GPU memory with smart pointers, and provide ROS demo.\n\n2. \u003cb\u003eFaster Performance\u003c/b\u003e. Resolve the issue of reduced segmentation accuracy when using FP16 ([issue#9](https://github.com/PRBonn/rangenet_lib/issues/9)), achieving a significant speed boost without sacrificing accuracy. Preprocess data using CUDA. Perform KNN post-processing with libtorch (\n   refer to [here](https://github.com/PRBonn/lidar-bonnetal/blob/master/train/tasks/semantic/postproc/KNN.py)).\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"assets/000000.png\" alt=\"img\" width=50% height=50% /\u003e\n\u003c/p\u003e\n\n## 2. Installation\n\n### 2.1 Docker installation\n\nWe provide a Docker installation, please see more in [docker/README.md](docker/README.md)\n\n### 2.2 Source installation\n\nStep 1: Download and Extract libtorch\n\n\u003e [!note]\n\u003e Using the Torch library from Conda was observed to slow down the post-processing stage from 6 ms to 30 ms.\n\n```bash\n$ wget -c https://download.pytorch.org/libtorch/cu113/libtorch-cxx11-abi-shared-with-deps-1.10.2%2Bcu113.zip -O libtorch.zip\n$ unzip libtorch.zip\n```\n\nStep 2: Set up the deep learning environment (install NVIDIA driver, CUDA, TensorRT, cuDNN). The tested configurations are listed below. At least \u003cu\u003e3000 MB\u003c/u\u003e of GPU memory is required.\n\n| Ubuntu |                         GPU                          | TensorRT  |      CUDA       |      cuDNN       |         —          |\n|:------:|:----------------------------------------------------:|:---------:|:---------------:|:----------------:|:------------------:|\n| 20.04  |                      TITAN RTX                       |   8.2.3   | CUDA 11.4.r11.4 |   cuDNN 8.2.4    | :heavy_check_mark: |\n| 20.04  |               NVIDIA GeForce RTX 3060                |  8.4.1.5  | CUDA 11.3.r11.3 |   cuDNN 8.0.5    | :heavy_check_mark: |\n| 20.04  | NVIDIA GeForce RTX 3060\u003cbr /\u003eNVIDIA GeForce RTX 4070 | 10.6.0.26 |  CUDA 11.1.105  | cuDNN  8.0.5.39  | :heavy_check_mark: |\n| 20.04  | NVIDIA GeForce RTX 3060\u003cbr /\u003eNVIDIA GeForce RTX 4070 | 10.6.0.26 | CUDA 12.4.r12.4 | cuDNN 9.1.0.70-1 | :heavy_check_mark: |\n| 22.04  |               NVIDIA GeForce RTX 3060                |  8.2.5.1  | CUDA 11.3.r11.3 |   cuDNN 8.8.0    | :heavy_check_mark: |\n| 22.04  |               NVIDIA GeForce RTX 3060                |  8.4.1.5  | CUDA 11.3.r11.3 |   cuDNN 8.8.0    | :heavy_check_mark: |\n| 22.04  |               NVIDIA GeForce RTX 3060                |  8.4.3.1  | CUDA 11.3.r11.3 |   cuDNN 8.8.0    | :heavy_check_mark: |\n| 22.04  |               NVIDIA GeForce RTX 3060                |  8.6.1.6  | CUDA 11.3.r11.3 |   cuDNN 8.8.0    | :heavy_check_mark: |\n| 22.04  |               NVIDIA GeForce RTX 3060                | 10.6.0.26 | CUDA 11.3.r11.3 |   cuDNN 8.8.0    | :heavy_check_mark: |\n\n\u003e [!note]\n\u003e\n\u003e You must choose the appropriate version of CUDA based on your Compute Capability. For example, if your want to use Compute Capability 89, you must choose CUDA 11.8+.\n\u003e\n\u003e You can see  `Compute Capability` in https://developer.nvidia.com/cuda-gpus#compute.\n\n| GPU Hardware Architecture | Compute Capability |           Relevant GPUs            | Minimum CUDA Version |\n|:-------------------------:|:------------------:|:----------------------------------:|:--------------------:|\n|    Ampere Architecture    |         86         | RTX 3060，RTX3070，RTX 3080，RTX 3090 |      CUDA 11.1       |\n| Ada Lovelace Architecture |         89         |         RTX 4090, RTX 4080         |      CUDA 11.8       |\n\n\u003e [!note]\n\u003e\n\u003e You must choose the appropriate version of CUDA based on your nvidia-driver.\n\n| nvidia-driver Version | Maximum CUDA Version |\n|:---------------------:|:--------------------:|\n|          545          |      CUDA 12.3       |\n|          550          |      CUDA 12.4       |\n\nAdd the following environment variables to ~/.bashrc:\n\n```bash\n# Example configuration:\n\n# \u003e\u003e\u003e Deep Learning Configuration \u003e\u003e\u003e\n# Import CUDA environment\nCUDA_PATH=/usr/local/cuda/bin\nCUDA_LIB_PATH=/usr/local/cuda/lib64\n\n# Import TensorRT environment\nexport TENSORRT_DIR=${HOME}/Application/TensorRT-8.4.1.5/\nTENSORRT_PATH=${TENSORRT_DIR}/bin\nTENSORRT_LIB_PATH=${TENSORRT_DIR}/lib\n\n# Import libtorch environment\nexport Torch_DIR=${HOME}/Application/libtorch/share/cmake/Torch\n\nexport PATH=${PATH}:${CUDA_PATH}:${TENSORRT_PATH}\nexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CUDA_LIB_PATH}:${TENSORRT_LIB_PATH}\n```\n\nStep 3: (Optional, if ROS components are needed). Please install ROS1 (Noetic) or ROS2 (Humble).\n\n```bash\n# Install ROS\n$ ...\n# Install extra dependency\n$ sudo apt install ros-${ROS_DISTRO}-pcl-ros\n```\n\nStep 4: Install apt-related and Python packages\n\n```bash\n$ sudo apt install build-essential python3-dev python3-pip apt-utils git cmake libboost-all-dev libyaml-cpp-dev libopencv-dev python3-empy libfmt-dev\n$ pip install catkin_tools trollius numpy\n```\n\nStep 5: Clone the Repository\n\n```bash\n$ git clone https://github.com/Natsu-Akatsuki/RangeNet-TensorRT ~/rangenet/src/rangenet/\n```\n\nStep 6: Import model files and datasets.\n\n```bash\n# Download model files\n$ wget -c https://github.com/Natsu-Akatsuki/RangeNet-TensorRT/releases/download/v0.0.0-alpha/model.onnx -O ~/rangenet/src/rangenet/model/model.onnx\n```\n\nDownload datasets: see [Baidu Cloud](https://pan.baidu.com/s/1iXSWaEfZsfpRps1yvqMOrA?pwd=9394).\n\n\u003cdetails\u003e\n    \u003csummary\u003eDirectory Structure\u003c/summary\u003e\n\n```bash\n.\n├── model\n│   ├── arch_cfg.yaml\n│   ├── data_cfg.yaml\n│   └── model.onnx\n├── data\n└── ├── 000000.pcd\n    ├── kitti_2011_09_30_drive_0027_synced\n    └── kitti_2011_09_30_drive_0027_synced.bag\n    \n```\n\n\u003c/details\u003e\n\n## 3. Usage\n\n\u003e [!note]\n\u003e\n\u003e The first run may take some time to generate the TensorRT optimized engine.\n\n\u003e [!note]\n\u003e\n\u003e Since we use set(CMAKE_CUDA_STANDARD 17), a feature introduced in [CMake 3.18](https://cmake.org/cmake/help/latest/prop_tgt/CUDA_STANDARD.html), it requires at least version 3.18. Unfortunately, the default CMake version in Ubuntu 20.04 is 3.16.3. Therefore, we provide a workaround to use a higher version of CMake with minimal effort.\n\u003e ```bash\n\u003e $ pip3 install --user cmake==3.18\n\u003e $ echo 'export PATH=${HOME}/.local/bin:${PATH}' \u003e\u003e ~/.bashrc\n\n\u003cdetails\u003e\n    \u003csummary\u003e:wrench: \u003cb\u003eUsage 1：\u003c/b\u003e\n        Run data in ROS1 or ROS2\n    \u003c/summary\u003e\n\n\u003cp align=\"center\"\u003e \n  \u003cimg src=\"assets/ros.gif\" alt=\"img\" width=50% height=50% /\u003e\n\u003c/p\u003e\n\n```bash\n# \u003e\u003e\u003e ROS1 \u003e\u003e\u003e\n$ cd ~/rangetnet/\n# USE -Wno-dev to suppress PCL WARNING\n$ catkin build --cmake-args -Wno-dev\n$ source devel/setup.bash\n$ roslaunch rangenet_pp ros1_rangenet.launch\n$ roslaunch rangenet_pp ros1_bag.launch\n\n# \u003e\u003e\u003e ROS2 \u003e\u003e\u003e\n$ cd ~/rangetnet/\n$ colcon build --symlink-install\n$ source install/setup.bash\n$ ros2 launch rangenet_pp ros2_rangenet.launch\n$ ros2 launch rangenet_pp ros2_bag.launch\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e:wrench: \u003cb\u003eUsage 2：\u003c/b\u003e\n        Predict single-frame point clouds (PCD format)\n    \u003c/summary\u003e\n\n\u003e [!note]\n\u003e PCD point cloud fields must be xyzi, and the intensity field should be normalized (0-1).\n\n```bash\n# Modify the parameters in config/infer.yaml\n$ cd ~/rangenet/src/rangenet/\n$ mkdir build\n$ cd build\n\n# To display inference time: cmake -DPERFORMANCE_LOG=ON .. \u0026\u0026 make\n$ unset ROS_VERSION \u0026\u0026 cmake -Wno-dev .. \u0026\u0026 make -j4\n$ ./demo\n```\n\n|      Step      |    Time    |\n|:--------------:|:----------:|\n| Preprocessing  | 1.51363 ms |\n|   Inference    | 21.8513 ms |\n| Postprocessing | 4.98176 ms |\n\n\u003c/details\u003e\n\n## 4. FAQ\n\n\u003cdetails\u003e \n    \u003csummary\u003e:question: \u003cb\u003eIssue 1:\u003c/b\u003e \n        [libprotobuf ERROR google/protobuf/text_format.cc:298] Error parsing text-format onnx2trt_onnx.ModelProto: 1:1:\n    \u003c/summary\u003e\n\nThe ONNX model is incomplete. Please Re-download the model.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e \n    \u003csummary\u003e:question: \u003cb\u003eIssue 2:\u003c/b\u003e \n        Segmentation fault [Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)] when visualizing single point cloud frames in Ubuntu 22.04 using PCL.\n    \u003c/summary\u003e\n\nUse PCL library version 1.13.0+. Please provide variable `PCL_DIR` in `cmake/ThirdParty.cmake`. See more in [Here](https://github.com/PointCloudLibrary/pcl/pull/5252).\n\n\u003c/details\u003e\n\n## Roadmap\n\n- [x] Test ROS1 demo\n- [x] Resolve [issue#8](https://github.com/Natsu-Akatsuki/RangeNetTrt8/issues/8) (2023.07.01)\n- [x] Add English documentation (2024.11.19)\n- [x] Explain why using FP16 leads to precision degradation [See more in [Here](docs/the_reason_for_why_using__FP16_can_cause_accuracy_degradation.md)] (2024.11.28)\n- [x] Provide a Docker environment (2024.11.30)\n- [ ] Add Pybind11 implementation\n- [ ] Resolve non-reproducibility\n- [ ] Refactor code to follow coding standards and improve readability","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNatsu-Akatsuki%2FRangeNet-TensorRT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNatsu-Akatsuki%2FRangeNet-TensorRT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNatsu-Akatsuki%2FRangeNet-TensorRT/lists"}