Mix3D: Out-of-Context Data Augmentation for 3D Scenes (3DV 2021)

Overview

Mix3D: Out-of-Context Data Augmentation for 3D Scenes (3DV 2021)

Alexey Nekrasov*, Jonas Schult*, Or Litany, Bastian Leibe, Francis Engelmann

Mix3D is a data augmentation technique for 3D segmentation methods that improves generalization.

PWC

PyTorch Lightning Config: Hydra Code style: black

teaser



[Project Webpage] [arXiv]

News

  • 12. October 2021: Code released.
  • 6. October 2021: Mix3D accepted for oral presentation at 3DV 2021. Paper on [arXiv].
  • 30. July 2021: Mix3D ranks 1st on the ScanNet semantic labeling benchmark.

Learderboard

Running the code

This repository contains the code for the analysis experiments of section 4.2. Motivation and Analysis Experiments from the paper For the ScanNet benchmark and Table 1 (main paper) we use the original SpatioTemporalSegmentation-Scannet code. To add Mix3D to the original MinkowskiNet codebase, we provide the patch file SpatioTemporalSegmentation.patch. Check the supplementary for more details.

Code structure

├── mix3d
│   ├── __init__.py
│   ├── __main__.py     <- the main file
│   ├── conf            <- hydra configuration files
│   ├── datasets
│   │   ├── outdoor_semseg.py       <- outdoor dataset
│   │   ├── preprocessing       <- folder with preprocessing scripts
│   │   ├── semseg.py       <- indoor dataset
│   │   └── utils.py        <- code for mixing point clouds
│   ├── logger
│   ├── models      <- MinkowskiNet models
│   ├── trainer
│   │   ├── __init__.py
│   │   └── trainer.py      <- train loop
│   └── utils
├── data
│   ├── processed       <- folder for preprocessed datasets
│   └── raw     <- folder for raw datasets
├── scripts
│   ├── experiments
│   │   └── 1000_scene_merging.bash
│   ├── init.bash
│   ├── local_run.bash
│   ├── preprocess_matterport.bash
│   ├── preprocess_rio.bash
│   ├── preprocess_scannet.bash
│   └── preprocess_semantic_kitti.bash
├── docs
├── dvc.lock
├── dvc.yaml        <- dvc file to reproduce the data
├── poetry.lock
├── pyproject.toml      <- project dependencies
├── README.md
├── saved       <- folder that stores models and logs
└── SpatioTemporalSegmentation-ScanNet.patch        <- patch file for original repo

Dependencies

The main dependencies of the project are the following:

python: 3.7
cuda: 10.1

For others, the project uses the poetry dependency management package. Everything can be installed with the command:

poetry install

Check scripts/init.bash for more details.

Data preprocessing

After the dependencies are installed, it is important to run the preprocessing scripts. They will bring scannet, matterport, rio, semantic_kitti datasets to a single format. By default, the scripts expect to find datsets in the data/raw/ folder. Check scripts/preprocess_*.bash for more details.

dvc repro scannet # matterport, rio, semantic_kitti

This command will run the preprocessing for scannet and will save the result using the dvc data versioning system.

Training and testing

Train MinkowskiNet on the scannet dataset without Mix3D with a voxel size of 5cm:

poetry run train

Train MinkowskiNet on the scannet dataset with Mix3D with a voxel size of 5cm:

poetry run train data/collation_functions=voxelize_collate_merge

BibTeX

@inproceedings{Nekrasov213DV,
  title     = {{Mix3D: Out-of-Context Data Augmentation for 3D Scenes}},
  author    = {Nekrasov, Alexey and Schult, Jonas and Litany, Or and Leibe, Bastian and Engelmann, Francis},
  booktitle = {{International Conference on 3D Vision (3DV)}},
  year      = {2021}
}
Comments
  • about reproducing the result mIoU 78.1

    about reproducing the result mIoU 78.1

    Hello, thank you for the nice work! If I want to reproduce your result in your paper, I just need to change 'voxel_size=0.02'. Is it right? Anything else should be changed?

    opened by LordLiang 3
  • Augmentation policies forming mix3d

    Augmentation policies forming mix3d

    Hi,

    Thanks for your work. I am having hard time matching the Data Augmentation pipeline described in the paper with the augmentations policies in volumentations_aug.yaml . The two does not seem to be the same, for example I can't see flip, elastic distortion etc... described in the paper . Am I missing something?

    With Regards,

    opened by hadilou 3
  • Scannet pre-preocess error

    Scannet pre-preocess error

    Hi,

    Thank you for the excellent work. I run the preprocess code in scannet according to the instruction, but it raised an error, and i couldn't find the bug (T-T). I will very appreciate if you could give me some hint. Thanks Here is the terminal output `Running stage 'scannet':

    poetry run python mix3d/datasets/preprocessing/scannet_preprocessing.py preprocess --git_repo=./data/raw/scannet/ScanNet --data_dir=/media/zebai/T7/Datasets/ScannetV2/ScanNet --save_dir=./data/processed/scannet 2021-10-22 11:15:24.771 | INFO | mix3d.datasets.preprocessing.base_preprocessing:preprocess:45 - Tasks for train: 1201 [Parallel(n_jobs=12)]: Using backend LokyBackend with 12 concurrent workers. [Parallel(n_jobs=12)]: Done 1 tasks | elapsed: 4.7s [Parallel(n_jobs=12)]: Done 8 tasks | elapsed: 6.5s [Parallel(n_jobs=12)]: Done 17 tasks | elapsed: 14.1s [Parallel(n_jobs=12)]: Done 26 tasks | elapsed: 18.1s [Parallel(n_jobs=12)]: Done 37 tasks | elapsed: 24.1s [Parallel(n_jobs=12)]: Done 48 tasks | elapsed: 30.2s [Parallel(n_jobs=12)]: Done 61 tasks | elapsed: 37.2s [Parallel(n_jobs=12)]: Done 74 tasks | elapsed: 44.2s [Parallel(n_jobs=12)]: Done 89 tasks | elapsed: 51.4s [Parallel(n_jobs=12)]: Done 104 tasks | elapsed: 1.1min [Parallel(n_jobs=12)]: Done 121 tasks | elapsed: 1.2min [Parallel(n_jobs=12)]: Done 138 tasks | elapsed: 1.3min [Parallel(n_jobs=12)]: Done 157 tasks | elapsed: 1.4min [Parallel(n_jobs=12)]: Done 176 tasks | elapsed: 1.6min [Parallel(n_jobs=12)]: Done 197 tasks | elapsed: 1.8min [Parallel(n_jobs=12)]: Done 218 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 219 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 220 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 221 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 222 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 223 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 224 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 225 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 226 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 227 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 228 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 229 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 230 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 231 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 232 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 233 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 234 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 235 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 236 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 237 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 238 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 239 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 240 tasks | elapsed: 2.0min [Parallel(n_jobs=12)]: Done 241 tasks | elapsed: 2.0min 2021-10-22 11:17:25.204 | ERROR | fire.core:_CallAndUpdateTrace:681 - An error has been caught in function '_CallAndUpdateTrace', process 'MainProcess' (136997), thread 'MainThread' (139858255038272): Traceback (most recent call last):

    File "mix3d/datasets/preprocessing/scannet_preprocessing.py", line 212, in Fire(ScannetPreprocessing) │ └ <class 'main.ScannetPreprocessing'> └ <function Fire at 0x7f3325018d30>

    File "/home/zebai/.conda/envs/predator/lib/python3.8/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) │ │ │ │ │ └ 'scannet_preprocessing.py' │ │ │ │ └ {} │ │ │ └ Namespace(completion=None, help=False, interactive=False, separator='-', trace=False, verbose=False) │ │ └ ['preprocess', '--git_repo=./data/raw/scannet/ScanNet', '--data_dir=/media/zebai/T7/Datasets/ScannetV2/ScanNet', '--save_dir=... │ └ <class 'main.ScannetPreprocessing'> └ <function _Fire at 0x7f3324b12c10> File "/home/zebai/.conda/envs/predator/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( │ └ <function _CallAndUpdateTrace at 0x7f3324b12d30> └ <bound method BasePreprocessing.preprocess of <main.ScannetPreprocessing object at 0x7f3323679fa0>>

    File "/home/zebai/.conda/envs/predator/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) │ │ └ {} │ └ [] └ <bound method BasePreprocessing.preprocess of <main.ScannetPreprocessing object at 0x7f3323679fa0>>

    File "/home/zebai/mix3d/mix3d/datasets/preprocessing/base_preprocessing.py", line 46, in preprocess parallel_results = Parallel(n_jobs=self.n_jobs, verbose=10)( │ │ └ 12 │ └ <main.ScannetPreprocessing object at 0x7f3323679fa0> └ <class 'joblib.parallel.Parallel'>

    File "/home/zebai/.conda/envs/predator/lib/python3.8/site-packages/joblib/parallel.py", line 1054, in call self.retrieve() │ └ <function Parallel.retrieve at 0x7f332493fa60> └ Parallel(n_jobs=12) File "/home/zebai/.conda/envs/predator/lib/python3.8/site-packages/joblib/parallel.py", line 933, in retrieve self._output.extend(job.get(timeout=self.timeout)) │ │ │ │ │ │ └ None │ │ │ │ │ └ Parallel(n_jobs=12) │ │ │ │ └ functools.partial(<function LokyBackend.wrap_future_result at 0x7f332493c670>, <Future at 0x7f33234898b0 state=finished raise... │ │ │ └ <Future at 0x7f33234898b0 state=finished raised TerminatedWorkerError> │ │ └ <method 'extend' of 'list' objects> │ └ [{'filepath': 'data/processed/scannet/train/0000_00.npy', 'scene': 0, 'sub_scene': 0, 'raw_filepath': '/media/zebai/T7/Datase... └ Parallel(n_jobs=12) File "/home/zebai/.conda/envs/predator/lib/python3.8/site-packages/joblib/_parallel_backends.py", line 542, in wrap_future_result return future.result(timeout=timeout) │ │ └ None │ └ <function Future.result at 0x7f3324d9d1f0> └ <Future at 0x7f33234898b0 state=finished raised TerminatedWorkerError> File "/home/zebai/.conda/envs/predator/lib/python3.8/concurrent/futures/_base.py", line 439, in result return self.__get_result() └ <Future at 0x7f33234898b0 state=finished raised TerminatedWorkerError> File "/home/zebai/.conda/envs/predator/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result raise self._exception │ └ TerminatedWorkerError('A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmen... └ <Future at 0x7f33234898b0 state=finished raised TerminatedWorkerError>

    joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker.

    The exit codes of the workers are {SIGSEGV(-11)} ERROR: failed to reproduce 'dvc.yaml': output 'data/processed/scannet/color_mean_std.yaml' does not exist`

    opened by Gilgamesh666666 3
  • Which are the specific codes of mix3d to apply to another dataset or model?

    Which are the specific codes of mix3d to apply to another dataset or model?

    Hi @kumuji @JonasSchult @francisengelmann

    Which are the specific codes of mix3d to apply to anther dataset or model? Could you please help me out? Thanks a lot.

    Best regards. Xiaobing

    opened by whuhxb 2
  • Does Mix3D also works for cubical (or spherical) chunks?

    Does Mix3D also works for cubical (or spherical) chunks?

    Hi,

    Thanks for sharing the code. In your paper, you apply Mix3D to MinkowskiNets, which takes the whole scene directly as input. I am wondering if mix3d also works for chunked scene input, which pointnet uses? (I guess it works as well as it essentially mixes two complete (or incomplete) scenes )

    opened by Pixie412 2
  • Applying data augmentation to another model

    Applying data augmentation to another model

    Thank you very much for your work. When I apply data augmentation to another model using semantickitti, which module(file) should I use? I am sorry. The paper says that it is easy to incorporate into existing code bases, but I did not understand it.

    opened by MasatoSaeki 2
  • several error in MinkowskiEngineBackend and in code

    several error in MinkowskiEngineBackend and in code

    • AttributeError: type object 'MinkowskiEngineBackend._C.RegionType' has no attribute 'HYBRID'
    • int_to_region_type = {m.value: m for m in ME.RegionType},TypeError: 'pybind11_type' object is not iterable
      
    opened by 4DVLab 1
  • how to find the centroid of the point cloud?

    how to find the centroid of the point cloud?

    Hi,

    Thanks for releasing the code! I have a question regarding how to find the centroid of the point cloud. In your path file for semantickitti, Why do you treat the mean of coordinates as the centroid? image

    Additionally, I want to apply mix3d to my own dataset. In this case, how to find the centroid of a point cloud?

    opened by Pixie412 1
  • Performance improvement gap between val and test set on ScanNet

    Performance improvement gap between val and test set on ScanNet

    Hi, thanks for your job. I have a question about the performance on the ScanNet dataset.

    I find that Mix3D augmentation applied on MinkowskiNet improves 1.2% (73.6 vs 72.4) mIoU on the ScanNet validation set reported in Table1. However, on the test set, Mix3D is 4.5% higher (78.1 vs 73.6). Do you know why Mix3D's performance is much better than MinkowskiNet on the test set?

    Another question is about test time augmentation mentioned in Part 4.1 of the paper. What is test time augmentation? Do you mean augmenting one scene multiple times and averaging the semantic predictions to get a better result in the test time?

    Looking forward to your reply! Thanks!

    opened by xiaodongww 1
  • Question about the visualization

    Question about the visualization

    Hi @kumuji ,

    Thanks for sharing your excellent work! May i ask how you draw the point cloud as the graph showed in the readme? I think that is beatiful, but i don't know how to draw it. I'll be ver grateful if you can give me some hints.Thank you!

    opened by hhr293 1
  • ‘kpconv_pytorch_mix3d.patch’ for S3DIS dataset

    ‘kpconv_pytorch_mix3d.patch’ for S3DIS dataset

    Hello, Mix3d is a great project ! Could you Upload patch file ‘kpconv_pytorch_mix3d.patch’ for S3DIS dataset in recently ? Look forward your prompt reply !

    opened by blank-track 0
  • poetry install fails to install open3d

    poetry install fails to install open3d

    Anyone came across this issue: "Because mix3d depends on open3d (0.9.0) which doesn't match any versions, version solving failed."? Can't make the installation work because of this

    opened by ero1311 4
  • Fixes to get MinkowskiEngine 0.5.4 to work

    Fixes to get MinkowskiEngine 0.5.4 to work

    • updated installation steps in the README
    • replace neptune with wandb, because the old neptune client no longer works
    • kept the same versions in the poetry.lock file, large diff is only because of formatting
    opened by kabouzeid 1
  • How to solve the error

    How to solve the error " AssertionError: repo is dirty, commit first"

    After the data process , i run the command "poetry run train" , meet the error "AssertionError: repo is dirty, commit first" . And I have connected the project to my own git repository.

    opened by feiqiu-cyber 1
Owner
Alexey Nekrasov
computer vision researcher
Alexey Nekrasov
Semantic Segmentation for Real Point Cloud Scenes via Bilateral Augmentation and Adaptive Fusion (CVPR 2021)

Semantic Segmentation for Real Point Cloud Scenes via Bilateral Augmentation and Adaptive Fusion (CVPR 2021) This repository is for BAAF-Net introduce

null 90 Dec 29, 2022
The source code for the Cutoff data augmentation approach proposed in this paper: "A Simple but Tough-to-Beat Data Augmentation Approach for Natural Language Understanding and Generation".

Cutoff: A Simple Data Augmentation Approach for Natural Language This repository contains source code necessary to reproduce the results presented in

Dinghan Shen 49 Dec 22, 2022
Public repository of the 3DV 2021 paper "Generative Zero-Shot Learning for Semantic Segmentation of 3D Point Clouds"

Generative Zero-Shot Learning for Semantic Segmentation of 3D Point Clouds Björn Michele1), Alexandre Boulch1), Gilles Puy1), Maxime Bucher1) and Rena

valeo.ai 15 Dec 22, 2022
RGBD-Net - This repository contains a pytorch lightning implementation for the 3DV 2021 RGBD-Net paper.

[3DV 2021] We propose a new cascaded architecture for novel view synthesis, called RGBD-Net, which consists of two core components: a hierarchical depth regression network and a depth-aware generator network.

Phong Nguyen Ha 4 May 26, 2022
Shape Matching of Real 3D Object Data to Synthetic 3D CADs (3DV project @ ETHZ)

Real2CAD-3DV Shape Matching of Real 3D Object Data to Synthetic 3D CADs (3DV project @ ETHZ) Group Member: Yue Pan, Yuanwen Yue, Bingxin Ke, Yujie He

null 24 Jun 22, 2022
Context Decoupling Augmentation for Weakly Supervised Semantic Segmentation

Context Decoupling Augmentation for Weakly Supervised Semantic Segmentation The code of: Context Decoupling Augmentation for Weakly Supervised Semanti

null 54 Dec 12, 2022
[3DV 2020] PeeledHuman: Robust Shape Representation for Textured 3D Human Body Reconstruction

PeeledHuman: Robust Shape Representation for Textured 3D Human Body Reconstruction International Conference on 3D Vision, 2020 Sai Sagar Jinka1, Rohan

Rohan Chacko 39 Oct 12, 2022
PyTorch implementation of paper "Neural Scene Flow Fields for Space-Time View Synthesis of Dynamic Scenes", CVPR 2021

Neural Scene Flow Fields PyTorch implementation of paper "Neural Scene Flow Fields for Space-Time View Synthesis of Dynamic Scenes", CVPR 20

Zhengqi Li 585 Jan 4, 2023
Human POSEitioning System (HPS): 3D Human Pose Estimation and Self-localization in Large Scenes from Body-Mounted Sensors, CVPR 2021

Human POSEitioning System (HPS): 3D Human Pose Estimation and Self-localization in Large Scenes from Body-Mounted Sensors Human POSEitioning System (H

Aymen Mir 66 Dec 21, 2022
This repository contains the code for the CVPR 2021 paper "GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields"

GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields Project Page | Paper | Supplementary | Video | Slides | Blog | Talk If

null 1.1k Dec 30, 2022
Official PyTorch Implementation of paper "Deep 3D Mask Volume for View Synthesis of Dynamic Scenes", ICCV 2021.

Deep 3D Mask Volume for View Synthesis of Dynamic Scenes Official PyTorch Implementation of paper "Deep 3D Mask Volume for View Synthesis of Dynamic S

Ken Lin 17 Oct 12, 2022
git git《Transformer Meets Tracker: Exploiting Temporal Context for Robust Visual Tracking》(CVPR 2021) GitHub:git2] 《Masksembles for Uncertainty Estimation》(CVPR 2021) GitHub:git3]

Transformer Meets Tracker: Exploiting Temporal Context for Robust Visual Tracking Ning Wang, Wengang Zhou, Jie Wang, and Houqiang Li Accepted by CVPR

NingWang 236 Dec 22, 2022
Data augmentation for NLP, accepted at EMNLP 2021 Findings

AEDA: An Easier Data Augmentation Technique for Text Classification This is the code for the EMNLP 2021 paper AEDA: An Easier Data Augmentation Techni

Akbar Karimi 81 Dec 9, 2022
“Data Augmentation for Cross-Domain Named Entity Recognition” (EMNLP 2021)

Data Augmentation for Cross-Domain Named Entity Recognition Authors: Shuguang Chen, Gustavo Aguilar, Leonardo Neves and Thamar Solorio This repository

RiTUAL@UH 18 Sep 10, 2022
[ICCV 2021] A Simple Baseline for Semi-supervised Semantic Segmentation with Strong Data Augmentation

[ICCV 2021] A Simple Baseline for Semi-supervised Semantic Segmentation with Strong Data Augmentation

CodingMan 45 Dec 12, 2022
[NeurIPS 2021] Deceive D: Adaptive Pseudo Augmentation for GAN Training with Limited Data

Deceive D: Adaptive Pseudo Augmentation for GAN Training with Limited Data (NeurIPS 2021) This repository provides the official PyTorch implementation

Liming Jiang 155 Nov 30, 2021
Official PyTorch implementation of the ICRA 2021 paper: Adversarial Differentiable Data Augmentation for Autonomous Systems.

Adversarial Differentiable Data Augmentation This repository provides the official PyTorch implementation of the ICRA 2021 paper: Adversarial Differen

Manli 3 Oct 15, 2022
Team nan solution repository for FPT data-centric competition. Data augmentation, Albumentation, Mosaic, Visualization, KNN application

FPT_data_centric_competition - Team nan solution repository for FPT data-centric competition. Data augmentation, Albumentation, Mosaic, Visualization, KNN application

Pham Viet Hoang (Harry) 2 Oct 30, 2022