InstanceRefer
InstanceRefer: Cooperative Holistic Understanding for Visual Grounding on Point Clouds through Instance Multi-level Contextual Referring
This repository is for the 1st method on ScanRefer benchmark [arxiv paper].
Zhihao Yuan, Xu Yan, Yinghong Liao, Ruimao Zhang, Zhen Li*, Shuguang Cui
If you find our work useful in your research, please consider citing:
@InProceedings{yuan2021instancerefer,
title={InstanceRefer: Cooperative Holistic Understanding for Visual Grounding on Point Clouds through Instance Multi-level Contextual Referring},
author={Zhihao Yuan, Xu Yan, Yinghong Liao, Ruimao Zhang, Zhen Li, Shuguang Cui},
journal={arXiv preprint},
year={2021}
}
News
- 2021-03-31 We release InstanceRefer v1
π ! - 2021-03-18 We achieve 1st place in ScanRefer leaderboard
π₯ .
Getting Started
Setup
The code is tested on Ubuntu 16.04 LTS & 18.04 LTS with PyTorch 1.3.0 CUDA 10.1 installed.
conda install pytorch==1.3.0 cudatoolkit=10.1 -c pytorch
Install the necessary packages listed out in requirements.txt
:
pip install -r requirements.txt
After all packages are properly installed, please run the following commands to compile the torchsaprse:
cd lib/torchsparse/
python setup.py install
Before moving on to the next step, please don't forget to set the project root path to the CONF.PATH.BASE
in lib/config.py
.
Data preparation
- Download the ScanRefer dataset and unzip it under
data/
. - Downloadand the preprocessed GLoVE embeddings (~990MB) and put them under
data/
. - Download the ScanNetV2 dataset and put (or link)
scans/
under (or to)data/scannet/scans/
(Please follow the ScanNet Instructions for downloading the ScanNet dataset). After this step, there should be folders containing the ScanNet scene data under thedata/scannet/scans/
with names likescene0000_00
- Used official and pre-trained PointGroup generate panoptic segmentation in
PointGroupInst/
. We provide pre-processed data in Baidu Netdisk [password: 0nxc]. - Pre-processed instance labels, and new data should be generated in
data/scannet/pointgroup_data/
cd data/scannet/
python prepare_data.py --split train --pointgroupinst_path [YOUR_PATH]
python prepare_data.py --split val --pointgroupinst_path [YOUR_PATH]
python prepare_data.py --split test --pointgroupinst_path [YOUR_PATH]
Finally, the dataset folder should be organized as follows.
InstanceRefer
βββ data
β βββ scannet
β β βββ meta_data
β β βββ pointgroup_data
β β β βββ scene0000_00_aligned_bbox.npy
β β β βββ scene0000_00_aligned_vert.npy
β β ββββββ ... ...
Training
Train the InstanceRefer model. You can change hyper-parameters in config/InstanceRefer.yaml
:
python scripts/train.py --log_dir instancerefer
TODO
- Updating to the best version.
- Release codes for prediction on benchmark.
- Release pre-trained model.
- Merge PointGroup in an end-to-end manner.
Acknowledgement
This project is not possible without multiple great opensourced codebases.
License
This repository is released under MIT License (see LICENSE file for details).