Giter Club home page Giter Club logo

jchibane / box2mask Goto Github PK

View Code? Open in Web Editor NEW
48.0 6.0 5.0 3.44 MB

Box2Mask: Weakly Supervised 3D Semantic Instance Segmentation Using Bounding Boxes

Python 75.31% CMake 0.04% Makefile 1.29% C++ 23.36%
3d-instance-segmentation 3d-semantic-segmentation bounding-box bounding-box-annotations bounding-boxes instance-segmentation semantic-segmentation weakly-supervised-learning weakly-supervised-segmentation box2mask 3d-scanning 3d-scene-understanding scene-understanding

box2mask's Introduction

Box2Mask

Julian Chibane, Francis Engelmann, Tuan Anh Tran, Gerard Pons-Moll
Box2Mask: Weakly Supervised 3D Semantic Instance Segmentation Using Bounding Boxes
In European Conference on Computer Vision (ECCV), 2022

Teaser

Paper - Video - Project Website - Arxiv - Citation (Bibtex)

Installations

A linux system with python environment manager conda is required for the project. Follow the instructions here to setup the environment

Data Setup

Scannet: Download the Scannet dataset here. Download the preprocessed ground truth data (gt_instance_data_txt.tar.gz) and extract it to data/scannet/ Each scene is stored with the name of format scene%04d_%02d (see Scannet). The data should be organized as follows for our project.

box2mask/data/scannet/
└── scans/                        # contains 1513 train/valid scences
    ├── scene0383_02/             # each scene has the name in format `scene%04d_%02d`
        ├── scene0383_02_vh_clean.ply
        ├── scene0383_02.sens
        ├── scene0383_02_vh_clean_2.0.010000.segs.json
        ├── scene0383_02.aggregation.json, _vh_clean.aggregation.json
        ├── scene0383_02_vh_clean_2.0.010000.segs.json, _vh_clean.segs.json
        ├── scene0383_02_vh_clean_2.labels.ply
        ├── scene0383_02_2d-label.zip
        ├── scene0383_02_2d-instance.zip
        ├── scene0383_02_2d-label-filt.zip  
        ├── scene0383_02_2d-instance-filt.zip
    ├── scene0515_02/
    ├── scene0643_00/
    ...
└── scans_test/                   # contains 100 test scenes
    ├── scene0731_00/
        ├── scene0731_00.sens
        ├── scene0731_00.txt
        ├── scene0731_00_vh_clean_2.ply
        ├── scene0731_00_vh_clean.ply
    ├── scene0739_00/
    ├── scene0747_00/
    ...
└── scannetv2_official_split.npz  # contains data splits info
└── gt_instance_data_txt/         # contains GT segmentations as txt files
    ├── scene0383_02.txt
    ├── scene0643_00.txt
    ...

Arkit: See Arkitscenes instruction.

S3DIS: See S3DIS instruction.

Quick Start with Pretrained Model

We provide a pretrained checkpoint for a quick start with the method. First, from the folder where you clone the project, run the following command to download the pretrained checkpoint:

cd box2mask # Navigate to the root folder
mkdir -p experiments/scannet/checkpoints/
cd experiments/scannet/checkpoints/
wget https://datasets.d2.mpi-inf.mpg.de/box2mask/checkpoint_101h:54m:35s_366875.3242661953.tar
cd ../../../

Next, to predict a scene in the train set or test set, run the prediction from the project home folder:

python models/evaluation.py --config configs/scannet.txt --predict_specific_scene scene0293_00

where --predict_specific_scene specifies the name of the scene that will be processed. The result of the prediction is saved in experiments/scannet/results/checkpoint_101h:54m:35s_366875.3242661953/viz/scene0293_00/ as pred_instances.ply and pred_semantics.ply. To visualize the result using interactive web server, run:

cd experiments/scannet/results/checkpoint_101h:54m:35s_366875.3242661953/viz/scene0293_00/
python -m http.server 6008

and follow the on-screen instructions.

Training

Start to train a model with a specific configuration file using:

python models/training.py --config configs/scannet.txt

The command above will train with the Scannet dataset. You can use a different config file to train with a different dataset. To train with the Arkitscenes dataset use configs/arkitscenes.txt or to train with the S3DIS dataset with area 1 as the validation set use config/s3dis_fold1 (the data needs to be setup first, see Sec. 'Data Setup')

Note: The above configuration uses a batch of 8 scenes, which assumes ~48GB GPURAM. RAM usage can be decreased via a smaller batch size, see parameter --batch_size.

Prediction and visualization

The following command makes a prediction for the validation set and computes the validation score (reproducing the results from table 1 in our paper).

python models/evaluation.py --config configs/scannet.txt --fixed_seed 10

To visualize the prediction for the validation set, add option --produce_visualizations [scene_name] to the above command, where [scene_name] is the name of the scene (eg. scene0293_00 in Scannet or 6667847 in Arkitscenes or Area_5.office_13 in S3DIS). The visualization files will be stored in ./experiments/[config_name]/results/[checkpoint]/viz/ where [checkpoint] is the name of the checkpoint used for prediction and [config_name] is the name of the config (scannet in this example). The interactive visualization server can be started using the command bellow.

cd ./experiments/scannet/results/[checkpoint]
python -m http.server 6008

Follow the on-screen instructions to find the visualizations in your browser.

Prediction on the ScanNet test set

The oversegmentations of scannet test scenes are needed for our project. Oversegmentations are already included for the train and validation scenes. For test scenes, see the instruction to compile the oversegmentation program.

Next, the following script will produce the oversegmentations for test scenes. The oversegmentations results will be stored at ./data/scannet/scans_test_segmented

mkdirs -p ./data/scannet/scans_test_segmented
cd dataprocessing/oversegmentation/
python run_segmentator.py

To run the ScanNet evaluation on the test set, we need to add the parameter --submission_write_out_testset. Without this parameter the validation set is evaluated as seen in the previous section.

python models/evaluation.py --config configs/scannet.txt --submission_write_out_testset --fixed_seed 100

Resulting predictions files will be stored in ./experiments/scannet/results/[checkpoint]. Our results are formatted into Scannet submission format (see documentation). --fixed_seed specifies a seed for test time augmentation. Results can be visualized interactively, in the same fashion as shown in the previous section.

Augmented Data

This instruction shows how to reproduce the augmented bounding box labels experiments and how to get the data.

Arkitscenes Data

See instruction to reproduce the results of arkitscenes.

S3DIS Data

See instruction to reproduce the results of S3DIS.

Code structure

The code structure can be found here.

License

Copyright (c) 2022 Julian Chibane, Max-Planck-Gesellschaft

By using this code you agree to the terms in the LICENSE.

Moreover, you agree to cite the Box2Mask: Weakly Supervised 3D Semantic Instance Segmentation Using Bounding Boxes paper in any documents that report on research using this software or the manuscript.

Show LICENSE (click to expand) Please read carefully the following terms and conditions and any accompanying documentation before you download and/or use this software and associated documentation files (the "Software").

The authors hereby grant you a non-exclusive, non-transferable, free of charge right to copy, modify, merge, publish, distribute, and sublicense the Software for the sole purpose of performing non-commercial scientific research, non-commercial education, or non-commercial artistic projects.

Any other use, in particular any use for commercial purposes, is prohibited. This includes, without limitation, incorporation in a commercial product, use in a commercial service, or production of other artefacts for commercial purposes. For commercial inquiries, please see above contact information.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You understand and agree that the authors are under no obligation to provide either maintenance services, update services, notices of latent defects, or corrections of defects with regard to the Software. The authors nevertheless reserve the right to update, modify, or discontinue the Software at any time.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

box2mask's People

Contributors

anhtuanhsgs avatar jchibane 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

box2mask's Issues

Annotations for ARKitScenes dataset

Hi,
Thanks a lot for your great work. I am really interested in your predictions for the ARKitScenes dataset. Is it possible to release these annotations?

Missing function definition

Where is the definition of "get_sparse2dense()" called in method Evaluater.s3dis_eval() in file "models/evaluation.py"?

Pretrained for ArkitScenes3D

I would like to express my appreciation for your notable work in the field of weakly supervised 3D object instance segmentation (3DIS). Your contributions have been significant.
I am interested in reproducing the results you have achieved on ArkitScenes3D. However, it appears that, at present, only the ScannetV2 weights are available.
I eagerly anticipate your response and guidance in this matter.

Thank you for your time and assistance.
Sincerely,
PhucNDA.

Missing gt_instance_data_txt folder can't evaluation

Hi, thanks for sharing this great work, I can't run evaluation during training because I don;t have the gt_instance_data_txt dir in scannet and seems the script utils/gt2eval.py is not working for me as well, could you give some instructions for that? thanks

The code might has memory leak

Hi, thanks for sharing this work, seems the training can't stand for several epoches, it can cause oom on a 48GB RAM machine even, seems the code would result in host memory leak

Pretrained model for ARKitScene dataset

Hi, thanks for this new approach in 3D instance segmentation. I'm interested in replicating your results for the ARKitScene dataset. Would you be able to release a pretrained model on the ARKitScene dataset? Thanks!

Windows support

First of all, congratulations for your great work. I currently use softgroup to perform instance detection and want to replace it with your work. I only need to make the inference with a 3d scene obtained by Bundlefusion. I am a windows user and have installed all the python packages with no problem. The only problem I have found is the use of MinkowskiEngine since it is not compatible with Windows. My question is if you know if I can make the Box2Mask method compatible with Windows, taking into account that I am only going to perform the inference of the model and that the MinkowskiEngine only works on Linux. Thanks for your attention

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.