Welcome to this guide on LiDAR-based 3D Object Detection using the OpenPCDet codebase. In this tutorial, we will explore the OpenPCDet framework in detail and demonstrate how to implement an object detection algorithm across three different levels.
STEP 6: OpenPCDet
a) Download
git clone https://github.com/open-mmlab/OpenPCDet.git
cd OpenPCDet
D) open vs code
code .
STEP 7: Create Environment
In VS CODE --> View --> Terminal
b) Create Environment
conda create --name OpenPCDetEnv python=3.10
Press 'y' to proceed
c) Activate environment
If base environment is automaticlly updated then
Disable auto-activation of the base environment: (optional)
conda config --set auto_activate_base false
after that activate openPCDetEnv
conda activate OpenPCDetEnv
If Enviroment name is not displayed on the bottom right side of status bar despite being activated
Then click on this 'Select Interpetor' on the status bar
Or
Press "CTRL+SIFT+P'
Click on the 'Python: Select Interpreter' --> and the name of the environment 'OpenPCDetEnv'
if still it shows 'Select Interpreter' instead of the environment name then close the 'VS Code' and open it again
It will show the envirnment name 'OpenPCDetEnv' instead of 'Select Interpretor'
STEP 8: Install PyTorch 2.3.1 (inside Environment)
We will isntall PyTorch compatible with CUDA 11.8.
https://pytorch.org/get-started/previous-versions/
b) In the terminal
# CUDA 11.8
conda install pytorch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 pytorch-cuda=11.8 -c pytorch -c nvidia
2) Check pytorch version
python3 -c "import torch; print(torch.__version__)"
3) Check Cuda Version
python3 -c "import torch; print(torch.version.cuda)"
or
python3
import torch
print("PyTorch version:", torch.__version__)
print("CUDA version:", torch.version.cuda)
STEP 9: Install SpConv: Spatially Sparse Convolution Library (inside Environment)
install The OpenPCDet asked us to install SpConv, so you can visit the repository and find the version and choose that matches with the cuda
pip install spconv-cu118
https://github.com/traveller59/spconv
For CUDA 11.8
pip install spconv-cu118
Step 10:
In the openpcdet environment, we will install the required packages listed in the requirements.txt file:
pip install -r requirements.txt
At the end of installation of 'requrieent.txt' get the following message
This output shows the installation of various Python packages
It also shows Dependency Conflicts:
ipykernel requires psutil, which is not installed.
ultralytics requires:
matplotlib>=3.3.0 (not installed).
psutil (not installed).
These are warnings indicating that these packages might not work correctly until their dependencies are resolved.
a) pip upldate
pip install --upgrade pip
pip --version
24.3.1
b) Install Missing Dependencies:
To resolve the dependency issues for ipykernel and ultralytics, install the missing packages:
pip install psutil matplotlib
c) Update Pip (Optional):
Keeping pip up to date ensures you have the latest features and bug fixes:
pip install --upgrade pip
Step 11:
pip install -r requirements.txt
After succefful build, get the following output
Yongin-si, South Korea
sumairamanzoorpk@gmail.com