Home

Awesome

<div align="center"> <h1> HAIS </h1> <span><font size="5", > Hierarchical Aggregation for 3D Instance Segmentation [ICCV 2021] </font></span> <br>

by <br>Shaoyu Chen, Jiemin Fang, Qian Zhang, Wenyu Liu, Xinggang Wang</a><sup><span></span></sup>. (<span></span>: corresponding author)

<div>Paper: <a href="https://arxiv.org/abs/2108.02350">[arXiv version] </a><a href="https://openaccess.thecvf.com/content/ICCV2021/papers/Chen_Hierarchical_Aggregation_for_3D_Instance_Segmentation_ICCV_2021_paper.pdf"> [ICCV21 version]</a></div> <div>Presentation: <a href="https://drive.google.com/file/d/1zDBqMBHrB077VbJUZdMY1D0LbtdjgpSi/view?usp=sharing">[ICCV21 presentation] </a></div> <div align="center"> <img src="docs/scene0249_00_output_2.gif" width="70%" /> <!-- <img src="docs/scene0430_00_output_2.gif" width="48%" /> --> </div> <br> </div>

PWC PWC

Update

2022.4.28:

<div align="center"> <div><span><font size="3", > <a href="https://www.stpls3d.com/"> STPLS3D: </a> &nbsp <a href="https://www.stpls3d.com/">[Dataset Website] </a> &nbsp <a href="https://arxiv.org/pdf/2203.09065.pdf">[Paper] </a> &nbsp <a href="https://github.com/meidachen/STPLS3D">[Github] </a> </span></div> </div>

STPLS3D_Learderboard

2021.9.30:

Introduction

Framework

Learderboard

MethodPer-frame latency on TITAN X
ASIS181913 ms
SGPN158439 ms
3D-SIS124490 ms
GSPN12702 ms
3D-BoNet9202 ms
GICN8615 ms
OccuSeg1904 ms
PointGroup452 ms
HAIS339 ms

Installation

1) Environment

Create a conda virtual environment and activate it.

conda create -n hais python=3.7
conda activate hais

2) Clone the repository.

git clone https://github.com/hustvl/HAIS.git --recursive

3) Install the requirements.

cd HAIS
pip install -r requirements.txt
conda install -c bioconda google-sparsehash 

4) Install spconv

git clone https://github.com/outsidercsy/spconv.git --recursive
  Note:  In the provided spconv 1.0 and 1.2, spconv\spconv\functional.py is modified to make grad_output contiguous. Make sure you use the modified spconv but not the original one. Or there would be some bugs of optimization.
conda install libboost
conda install -c daleydeng gcc-5 # (optional, install gcc-5.4 in conda env)
cd HAIS/lib/spconv
python setup.py bdist_wheel
cd HAIS/lib/spconv/dist
pip install {wheel_file_name}.whl

5) Compile the external C++ and CUDA ops.

cd HAIS/lib/hais_ops
export CPLUS_INCLUDE_PATH={conda_env_path}/hais/include:$CPLUS_INCLUDE_PATH
python setup.py build_ext develop

{conda_env_path} is the location of the created conda environment, e.g., /anaconda3/envs.

Data Preparation

1) Download the ScanNet v2 dataset.

2) Put the data in the corresponding folders.

The dataset files are organized as follows.

HAIS
├── dataset
│   ├── scannetv2
│   │   ├── train
│   │   │   ├── [scene_id]_vh_clean_2.ply & [scene_id]_vh_clean_2.labels.ply & [scene_id]_vh_clean_2.0.010000.segs.json & [scene_id].aggregation.json
│   │   ├── val
│   │   │   ├── [scene_id]_vh_clean_2.ply & [scene_id]_vh_clean_2.labels.ply & [scene_id]_vh_clean_2.0.010000.segs.json & [scene_id].aggregation.json
│   │   ├── test
│   │   │   ├── [scene_id]_vh_clean_2.ply 
│   │   ├── scannetv2-labels.combined.tsv

3) Generate input files [scene_id]_inst_nostuff.pth for instance segmentation.

cd HAIS/dataset/scannetv2
python prepare_data_inst.py --data_split train
python prepare_data_inst.py --data_split val
python prepare_data_inst.py --data_split test

Training

CUDA_VISIBLE_DEVICES=0 python train.py --config config/hais_run1_scannet.yaml 

Inference

1) To evaluate on validation set,

cd dataset/scannetv2
python prepare_data_inst_gttxt.py
CUDA_VISIBLE_DEVICES=0 python test.py --config config/hais_run1_scannet.yaml --pretrain $PATH_TO_PRETRAIN_MODEL$

Pretrained model: Google Drive / Baidu Cloud [code: sh4t]. mAP/mAP50/mAP25 is 44.1/64.4/75.7.

2) To evaluate on test set,

CUDA_VISIBLE_DEVICES=0 python test.py --config config/hais_run1_scannet.yaml --pretrain $PATH_TO_PRETRAIN_MODEL$

Visualization

We provide visualization tools based on Open3D (tested on Open3D 0.8.0).

pip install open3D==0.8.0
python visualize_open3d.py --data_path {} --prediction_path {} --data_split {} --room_name {} --task {}

Please refer to visualize_open3d.py for more details.

Demo:

<div align="center"> <!-- <img src="docs/scene0249_00_output_2.gif" width="48%" /> --> <img src="docs/scene0430_00_output_2.gif" width="70%" /> </div>

Acknowledgement

The code is based on PointGroup and spconv. And thank STPLS3D for extending HAIS.

Contact

If you have any questions or suggestions about this repo, please feel free to contact me (shaoyuchen@hust.edu.cn).

Citing HAIS

If you find HAIS is useful in your research or applications, please consider giving us a star 🌟 and citing HAIS by the following BibTeX entry.

@InProceedings{Chen_HAIS_2021_ICCV,
    author    = {Chen, Shaoyu and Fang, Jiemin and Zhang, Qian and Liu, Wenyu and Wang, Xinggang},
    title     = {Hierarchical Aggregation for 3D Instance Segmentation},
    booktitle = {ICCV},
    year      = {2021},
}