• Stars
    star
    119
  • Rank 296,048 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created almost 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DyCo3d

DyCo3d: Robust Instance Segmentation of 3D Point Clouds through Dynamic Convolution (CVPR 2021)

overview

Code for the paper DyCo3D: Robust Instance Segmentation of 3D Point Clouds through Dynamic Convolution, CVPR 2021.

Authors: Tong He, Chunhua Shen, Anton van den Hengel

[arxiv]

Introduction

Previous top-performing approaches for point cloud instance segmentation involve a bottom-up strategy, which often includes inefficient operations or complex pipelines, such as grouping over-segmented components, introducing additional steps for refining, or designing complicated loss functions. The inevitable variation in the instance scales can lead bottom-up methods to become particularly sensitive to hyper-parameter values. To this end, we propose instead a dynamic, proposal-free, data-driven approach that generates the appropriate convolution kernels to apply in response to the nature of the instances. To make the kernels discriminative, we explore a large context by gathering homogeneous points that share identical semantic categories and have close votes for the geometric centroids. Instances are then decoded by several simple convolutional layers. Due to the limited receptive field introduced by the sparse convolution, a small light-weight transformer is also devised to capture the long-range dependencies and high-level interactions among point samples. The proposed method achieves promising results on both ScanetNetV2 and S3DIS, and this performance is robust to the particular hyper-parameter values chosen. It also improves inference speed by more than 25% over the current state-of-the-art.

Installation

Requirements

  • Python 3.7.0
  • Pytorch 1.1.0
  • CUDA 10.1

Virtual Environment

conda create -n dyco3d python==3.7
conda activate dyco3d

Install DyCo3d (Follow the installation steps of PointGroup)

(1) Clone the DyCo3d repository.

git clone https://github.com/aim-uofa/DyCo3D.git
cd DyCo3D

(2) Install the dependent libraries.

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

(3) For the SparseConv, we use the repo from PointGroup

  • To compile spconv, firstly install the dependent libraries.
conda install libboost
conda install -c daleydeng gcc-5 # need gcc-5.4 for sparseconv

Add the $INCLUDE_PATH$ that contains boost in lib/spconv/CMakeLists.txt. (Not necessary if it could be found.)

include_directories($INCLUDE_PATH$)
  • Compile the spconv library.
cd lib/spconv
python setup.py bdist_wheel
  • Run cd dist and pip install the generated .whl file.

(4) Compile the pointgroup_ops library.

cd lib/pointgroup_ops
python setup.py develop

If any header files could not be found, run the following commands.

python setup.py build_ext --include-dirs=$INCLUDE_PATH$
python setup.py develop

$INCLUDE_PATH$ is the path to the folder containing the header files that could not be found.

Data Preparation

(1) Download the ScanNet v2 dataset.

(2) Put the data in the corresponding folders.

  • Copy the files [scene_id]_vh_clean_2.ply, [scene_id]_vh_clean_2.labels.ply, [scene_id]_vh_clean_2.0.010000.segs.json and [scene_id].aggregation.json into the dataset/scannetv2/train and dataset/scannetv2/val folders according to the ScanNet v2 train/val split.

  • Copy the files [scene_id]_vh_clean_2.ply into the dataset/scannetv2/test folder according to the ScanNet v2 test split.

  • Put the file scannetv2-labels.combined.tsv in the dataset/scannetv2 folder.

The dataset files are organized as follows.

DyCo3D
โ”œโ”€โ”€ 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 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

You can also download the data here (about 13G). The dataset files are organized as

DyCo3D
โ”œโ”€โ”€ dataset
โ”‚   โ”œโ”€โ”€ scannetv2
โ”‚   โ”‚   โ”œโ”€โ”€ train
โ”‚   โ”‚   โ”œโ”€โ”€ val
โ”‚   โ”‚   โ”œโ”€โ”€ test
โ”‚   โ”‚   โ”œโ”€โ”€ val_gt

Training

CUDA_VISIBLE_DEVICES=0,1,2 python -m torch.distributed.launch --nproc_per_node=3 --master_port=$((RANDOM + 10000)) train.py --config config/dyco3d_multigpu_scannet.yaml  --output_path OUTPUT_DIR  --use_backbone_transformer

Inference and Evaluation

To test with a pretrained model, run

CUDA_VISIBLE_DEVICES=0 python test.py --config config/dyco3d_multigpu_scannet.yaml --output_path exp/model --resume MODEL --use_backbone_transforme

Pretrained Model

We provide a pretrained model trained on ScanNet v2 dataset. Download it here. Its performance on ScanNet v2 validation set is 35.5/57.6/72.9 in terms of mAP/mAP50/mAP25. (with a masking head size of 16)

Results on ScanNet Benchmark

Quantitative results on ScanNet test set at the submisison time. scannet_result

Citation

If you find this work useful in your research, please cite:

@inproceedings{He2021dyco3d,
  title     =   {{DyCo3d}: Robust Instance Segmentation of 3D Point Clouds through Dynamic Convolution},
  author    =   {Tong He and Chunhua Shen and Anton van den Hengel},
  booktitle =   {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      =   {2021}
}

Acknowledgement

This repo is built upon PointGroup, spconv, condinst.

Contact

If you have any questions or suggestions about this repo, please feel free to contact me ([email protected]).

More Repositories

1

AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.
Python
3,349
star
2

AdelaiDepth

This repo contains the projects: 'Virtual Normal', 'DiverseDepth', and '3D Scene Shape'. They aim to solve the monocular depth estimation, 3D scene reconstruction from single image problems.
Python
1,051
star
3

Matcher

[ICLR'24] Matcher: Segment Anything with One Shot Using All-Purpose Feature Matching
Python
401
star
4

StyleDrop-PyTorch

This is an unofficial PyTorch implementation of StyleDrop: Text-to-Image Generation in Any Style.
Python
203
star
5

Poseur

[ECCV 2022] The official repo for the paper "Poseur: Direct Human Pose Regression with Transformers".
Python
176
star
6

AutoStory

143
star
7

GenPercept

GenPercept: Diffusion Models Trained with Large Data Are Transferable Visual Models
Python
112
star
8

FrozenRecon

[ICCV2023] ๐ŸงŠFrozenRecon: Pose-free 3D Scene Reconstruction with Frozen Depth Models
Python
108
star
9

SegPrompt

Official Implementation of ICCV 2023 Paper - SegPrompt: Boosting Open-World Segmentation via Category-level Prompt Learning
Python
108
star
10

FreeCustom

[CVPR 2024] Official PyTorch implementation of FreeCustom: Tuning-Free Customized Image Generation for Multi-Concept Composition
Python
69
star
11

OIR

[ICLR 2024] Official PyTorch/Diffusers implementation of "Object-aware Inversion and Reassembly for Image Editing"
Python
69
star
12

RGM

68
star
13

GeoBench

A toolbox for benchmarking SOTA discriminative and generative geometry estimation models.
Python
42
star
14

GenDeF

38
star
15

DiverGen

DiverGen (CVPR 2024) & BSGAL (ICML 2024)
Python
32
star
16

partially-labelled

Learning to segment multi-organ and tumorsfrom multiple partially labeled datasets
19
star
17

FreeCompose

13
star
18

VFN

[ICLR 2024 Spotlight] The official repo for the paper "De novo Protein Design using Geometric Vector Field Networks".
Python
12
star
19

VLModel

Repo of HawkLlama.
Python
8
star
20

Depth3D

Python
7
star
21

FADiff

[ICML 2024] Floating Anchor Diffusion Model for Multi-motif Scaffolding
Python
6
star
22

STORY

4
star
23

LoRAPrune

Python
4
star
24

MovieDreamer

4
star
25

OIR-Diffusion

JavaScript
1
star