Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile and Documentation for ISBNet Project #67

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions Docker Setup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-devel

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub \
&& apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub \
&& apt-get update \
&& apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6

# Install MinkowskiEngine
# Feel free to skip nvidia-cuda-dev if minkowski installation is fine
RUN apt-get update \
&& apt-get -y install libopenblas-dev nvidia-cuda-dev


# Install torch-scatter
RUN pip install torch-scatter==2.1.2 -f https://data.pyg.org/whl/torch-1.13.0+cu116.html --no-deps

# Install remaining python packages
RUN pip install --no-deps \
munch \
pyyaml \
six \
tensorboard \
tensorboardX \
tqdm \
imageio \
setuptools \
protobuf \
spconv-cu116==2.3.6 \
addict==2.4.0 \
yapf==0.33.0 \
termcolor==2.3.0 \
packaging==23.1 \
numpy==1.24.1 \
rich==13.3.5 \
opencv-python==4.7.0.72 \
pycocotools==2.0.6 \
Shapely==1.8.5 \
scipy==1.10.1 \
terminaltables==3.1.10 \
numba==0.57.0 \
llvmlite==0.40.0 \
pccm==0.4.7 \
ccimport==0.4.2 \
pybind11==2.10.4 \
ninja==1.11.1 \
lark==1.1.5 \
cumm-cu116==0.4.9 \
pyquaternion==0.9.9 \
lyft-dataset-sdk==0.0.8 \
pandas==2.0.1 \
python-dateutil==2.8.2 \
matplotlib==3.5.2 \
pyparsing==3.0.9 \
cycler==0.11.0 \
kiwisolver==1.4.4 \
scikit-learn==1.2.2 \
joblib==1.2.0 \
threadpoolctl==3.1.0 \
cachetools==5.3.0 \
nuscenes-devkit==1.1.10 \
trimesh==3.21.6 \
open3d==0.17.0 \
plotly==5.18.0 \
dash==2.14.2 \
plyfile==1.0.2 \
flask==3.0.0 \
werkzeug==3.0.1 \
click==8.1.7 \
blinker==1.7.0 \
itsdangerous==2.1.2 \
importlib_metadata==2.1.2 \
zipp==3.17.0
73 changes: 73 additions & 0 deletions Docker Setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# ISBNet Setup Using Docker

Follow the steps below to set up ISBNet with Docker, including pulling the necessary Docker image, cloning the repository, and installing required dependencies.

## 1. Pull the Docker Image

First, pull the Docker image `rayyoh/oneformer3d`:

```bash

docker pull rayyoh/oneformer3d
```

## 2. Clone ISBNet Repository

```bash
git clone https://github.com/VinAIResearch/ISBNet/tree/master
```

## 3. Run Docker Container

```bash
docker run --gpus all -it --shm-size=8g --cpus=4 -e PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128 -v C:\Users\Perception-Team\ISBNet:/workspace -p 6008:6008 --name isnbet check
```

## 4. Install Python Requirements Inside the container:

```bash
pip3 install -r requirements.txt
```
## 5. Build Segmentator Again Inside Docker

```bash
git clone https://github.com/Karbo123/segmentator.git
cd segmentator/csrc
mkdir build && cd build
cmake .. \
-DCMAKE_PREFIX_PATH=`python -c 'import torch; print(torch.utils.cmake_prefix_path)'` \
-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \
-DCMAKE_INSTALL_PREFIX=`python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
make && make install
```

## 6. Install libsparsehash-dev

```bash
apt-get install libsparsehash-dev
```
## 7. Setup PointNet2

```bash

cd isbnet/pointnet2
python3 setup.py bdist_wheel
cd ./dist
pip3 install pointnet2-0.0.0-cp310-cp310-linux_x86_64.whl
```
## 8. Final Build

```bash
cd ../../..
python3 setup.py build_ext develop
```

## Todo
### Explanation:
- The **Alternative Method** section provides the user an option to directly download the Dockerfile and skip the manual image pull process.
- You can link to the Dockerfile in your GitHub repository [link](https://github.com/Smith-S-S/ISBNet/blob/master/Docker%20Setup/Dockerfile) and indicate to the user that they can skip the manual `docker pull` command if they choose this method.