Code Monkey home page Code Monkey logo

sole's Introduction

Segment Any 3D Object with Language

Seungjun Lee1* · Yuyang Zhao2* · Gim Hee Lee2
1Korea University · 2National University of Singapore
*equal contribution

arXiv 2024

PyTorch Lightning Config: Hydra

Logo

SOLE is highly generalizable and can segment corresponding instances with various language instructions, including but not limited to visual questions, attributes description, and functional description.


Table of Contents
  1. TODO
  2. Installation
  3. Data Preparation
  4. Weights
  5. Download data and weight
  6. Training and Testing
  7. Acknowledgement
  8. Citation

News:

  • [2024/04/20] Code is released 💡.
  • [2024/05/02] Pre-processed data and weights are released. Now you can train and evaluate our SOLE 👏🏻.

TODO

  • Release the code
  • Release the preprocessed data and weights
  • Release the evaluation code for Replica dataset
  • Release the pre-processed data and precomputed features for Replica dataset

Installation

Dependencies 📝

The main dependencies of the project are the following:

python: 3.10.9
cuda: 11.3

You can set up a conda environment as follows

export TORCH_CUDA_ARCH_LIST="6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6"

conda env create -f environment.yml

conda activate sole

pip3 install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
pip3 install torch-scatter -f https://data.pyg.org/whl/torch-1.12.1+cu113.html
pip3 install 'git+https://github.com/facebookresearch/detectron2.git@710e7795d0eeadf9def0e7ef957eea13532e34cf' --no-deps

mkdir third_party
cd third_party

git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd MinkowskiEngine
git checkout 02fc608bea4c0549b0a7b00ca1bf15dee4a0b228
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas

cd ../../pointnet2
python setup.py install

cd ../../
pip3 install pytorch-lightning==1.7.2
pip3 install open-clip-torch

Data Preparation

We provide the pre-processed 3D data and precomputed features for the training and evaluation which are listed below:

  • Pre-processed 3D data
  • Precomputed per-point CLIP features
  • Precomputed features of MCA and MEA

You can download above data with following Download data and weight. We also provide the specific data configuration in here to help your understanding for our pre-processed data.

Weights

For the stable training, we employ a two-stage training process:

  1. Pretrain the backbone with only using mask-annotations.
  2. Train the mask decoder while backbone is fixed. Mask annotations and three types of associations are used for the training. (See the original paper for the details.)

For the training, we provide pretrained backbone weights for ScanNet and ScanNet200 datasets listed below:

For the evaluation, we provide the official weight of SOLE for ScanNet and ScanNet200 datasets listed below:

You can download all of the weights for the pretrained backbone and SOLE with following Download data and weight.

Download data and weight

We provide the python script that download all of the pre-processed data and weights we mentioned above. You can run the command below:

python download_data.py

Once you run the above command, the downloaded files must be automatically located to the corresponding path. Refer to the file structure below.

├── backbone_checkpoint
│   ├── backbone_scannet.ckpt        <- Backbone weights for ScanNet
│   └── backbone_scannet200.ckpt     <- Backobne weights for ScanNet200
│
├── checkpoint
│   ├── scannet.ckpt        <- Official weights for ScanNet
│   └── scannet200.ckpt     <- Official weights for ScanNet200
│ 
├── data
│   └── preprocessed
│       ├── scannet                   <- Preprocessed ScanNet data
│       └── scannet200                <- Preprocessed ScanNet200 data
│   
├── openvocab_supervision
│   ├── openseg     
│   │   └── scannet                   <- Precomputed per-point CLIP features for ScanNet
│   │       ├── scene0000_00_0.pt
│   │       ├── scene0000_01_0.pt
│   │       └── ...
│   ├── scannet_mca                   <- Precomputed features of MCA for ScanNet
│   │   ├── scene0000_00.pickle
│   │   ├── scene0000_01.pickle
│   │   └── ...
│   ├── scannet_mea                   <- Precomputed features of MEA for ScanNet
│   │   ├── scene0000_00.pickle
│   │   ├── scene0000_01.pickle
│   │   └── ...
│   ├── scannet200_mca                <- Precomputed features of MCA for ScanNet200
│   │   ├── scene0000_00.pickle
│   │   ├── scene0000_01.pickle
│   │   └── ...
│   └── scannet200_mea                <- Precomputed features of MEA for ScanNet200
│       ├── scene0000_00.pickle
│       ├── scene0000_01.pickle
│       └── ...

If you successfully download all of the given files, you are now ready to train and evaluate the model. Check the training and evaluation command in Training and Testing section to run the SOLE.

Training and Testing

Train the SOLE on the ScanNet dataset.

bash scripts/scannet/scannet_train.sh

Train the SOLE on the ScanNet200 dataset.

bash scripts/scannet200/scannet200_train.sh

Evaluate the SOLE on the ScanNet dataset.

bash scripts/scannet/scannet_val.sh

Evaluate the SOLE on the ScanNet200 dataset.

bash scripts/scannet200/scannet200_val.sh

If you want to use wandb during the training, set the workspace in conf/config_base_instance_segmentation.yaml file to your wandb workspace name. And run the command below before running the training/testing command:

wandb enabled

If you want to turn off the wandb, run the command below before running the training/testing command:

wandb disabled

Acknowledgement

We build our code on top of the Mask3D. We sincerely thank to Mask3D team for the amazing work and well-structured code. Furthermore, our work is inspired a lot from the following works:

We express our gratitude for their exceptional contributions.

Citation

If you find our code or paper useful, please cite

@article{lee2024segment,
      title = {Segment Any 3D Object with Language}, 
      author = {Lee, Seungjun and Zhao, Yuyang and Lee, Gim Hee},
      year = {2024},
      journal   = {arXiv preprint arXiv:2404.02157},
}

sole's People

Contributors

0nandon avatar cvrp-sole avatar helioszhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sole's Issues

About result on Scannet

I select 20 scenes in scannet and evaluate them but get a bad result:

average : 0.002 0.003 0.006

I don't modify the code and the precomputed featrue, and I use the scripts in the SOLE to process the scannet.

Configuration and instantiation issues when executing `bash scripts/scannet/scannet_val.sh.`

I'm very grateful for your contributions and the code you have uploaded for our learning. After configuring the relevant environment and downloading the data (due to network issues, I only downloaded the complete .ckpt file and the scannet dataset, and I am not sure if this will cause the following issues), I encountered the following problems when executing bash scripts/scannet/scannet_val.sh for evaluation. Could you please explain the cause of these issues and which file parameters I might need to modify?

(sole) ubuntu@DESKTOP-J38NOS5:~/workspace/SOLE$ bash scripts/scannet/scannet_val.sh
/home/ubuntu/workspace/SOLE/main_instance_segmentation.py:65: UserWarning: 
The version_base parameter is not specified.
Please specify a compatability version level, or None.
Will assume defaults for version 1.1
  @hydra.main(
/home/ubuntu/workspace/SOLE/main_instance_segmentation.py:87: UserWarning: 
The version_base parameter is not specified.
Please specify a compatability version level, or None.
Will assume defaults for version 1.1
  @hydra.main(
/home/ubuntu/workspace/SOLE/main_instance_segmentation.py:103: UserWarning: 
The version_base parameter is not specified.
Please specify a compatability version level, or None.
Will assume defaults for version 1.1
  @hydra.main(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/_internal/defaults_list.py:251: UserWarning: In 'config_base_instance_segmentation.yaml': Defaults list is missing `_self_`. See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/default_composition_order for more information
  warnings.warn(msg, UserWarning)
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'loss/set_criterion': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'matcher/hungarian_matcher': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'callbacks/callbacks_instance_segmentation': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'trainer/trainer600': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'scheduler/onecyclelr': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'optimizer/adamw': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'metrics/miou': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'model/sole': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'logging/full': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/core/default_element.py:124: UserWarning: In 'data/indoor': Usage of deprecated keyword in package header '# @package _group_'.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header for more information
  deprecation_warning(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/hydra/_internal/hydra.py:119: UserWarning: Future Hydra versions will no longer change working directory at job runtime by default.
See https://hydra.cc/docs/1.2/upgrades/1.1_to_1.2/changes_to_job_working_dir/ for more information.
  ret = run_job(
/home/ubuntu/anaconda3/envs/sole/lib/python3.10/site-packages/pytorch_lightning/utilities/seed.py:55: UserWarning: No seed found, seed set to 541608002
  rank_zero_warn(f"No seed found, seed set to {seed}")
Global seed set to 541608002
EXPERIMENT ALREADY EXIST
{'_target_': 'pytorch_lightning.loggers.WandbLogger', 'project': '${general.project_name}', 'name': '${general.experiment_name}', 'save_dir': '${general.save_dir}', 'entity': 'onandon', 'resume': 'allow', 'id': '${general.experiment_name}'}
Error executing job with overrides: ['general.checkpoint=checkpoint/scannet.ckpt', 'data/datasets=scannet', 'model.backbone_weight=backbone_checkpoint/backbone_scannet.ckpt', 'model.class_embed=scannet', 'general.eval_on_segments=true', 'general.train_on_segments=false', 'general.train_mode=false', 'general.num_targets=19', 'data.num_labels=20', 'model.num_queries=150', 'general.topk_per_image=500', 'general.use_dbscan=true', 'general.dbscan_eps=0.95']
Error in call to target 'models.sole.SOLE':
InstantiationException('Cannot instantiate config of type Res16UNet34C.\nTop level config must be an OmegaConf DictConfig/ListConfig object,\na plain dict/list, or a Structured Config class or instance.')
full_key: model

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Thank you!!!

GPU memory overload

Due to limited GPU resources, my system experiences memory overload during training and testing. I would like to know if it's possible to reduce the number of Precomputed per-point CLIP features (.pt files) during training or testing, or if there are other effective methods to address this issue. If it's possible to reduce the number of files, where should I make the modifications in the code? I eagerly await your response!

Release for Replica Dataset Code and Features

Hi, thank you so much for this excellent work! Could you please let me know when the evaluation code, pre-processed data, and precomputed features for the Replica dataset will be released?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.