Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
col14m committed Feb 6, 2023
0 parents commit a39b1d9
Show file tree
Hide file tree
Showing 673 changed files with 111,498 additions and 0 deletions.
135 changes: 135 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.ipynb

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/en/_build/
docs/zh_cn/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# cython generated cpp
data
.vscode
.idea

# custom
*.pkl
*.pkl.json
*.log.json
work_dirs/
exps/
*~
mmdet3d/.mim

# Pytorch
*.pth

# demo
*.jpg
*.png
data/s3dis/Stanford3dDataset_v1.2_Aligned_Version/
data/scannet/scans/
data/sunrgbd/OFFICIAL_SUNRGBD/
*.obj
*.ply

# Waymo evaluation
mmdet3d/core/evaluation/waymo_utils/compute_detection_metrics_main
50 changes: 50 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
repos:
- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0
hooks:
- id: yapf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: double-quote-string-fixer
- id: check-merge-conflict
- id: fix-encoding-pragma
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.14
hooks:
- id: mdformat
args: [ "--number" ]
additional_dependencies:
- mdformat-gfm
- mdformat_frontmatter
- linkify-it-py
- repo: https://github.com/myint/docformatter
rev: v1.3.1
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.2.0 # Use the ref you want to point at
hooks:
- id: check-algo-readme
- id: check-copyright
args: ["mmdet3d"] # replace the dir_to_check with your expected directory to check
10 changes: 10 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2

formats: all

python:
version: 3.7
install:
- requirements: requirements/docs.txt
- requirements: requirements/runtime.txt
- requirements: requirements/readthedocs.txt
159 changes: 159 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include mmdet3d/.mim/model-index.yml
include requirements/*.txt
recursive-include mmdet3d/.mim/ops *.cpp *.cu *.h *.cc
recursive-include mmdet3d/.mim/configs *.py *.yml
recursive-include mmdet3d/.mim/tools *.sh *.py
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
## Top-Down Beats Bottom-Up in 3D Instance Segmentation

**News**:
* :fire: February, 2023. Source code has been published.

This repository contains an implementation of TD3D, a 3D instance segmentation method introduced in our paper:

> **Top-Down Beats Bottom-Up in 3D Instance Segmentation**<br>
> [Maksim Kolodiazhnyi](https://github.com/col14m),
> [Danila Rukhovich](https://github.com/filaPro),
> [Anna Vorontsova](https://github.com/highrut),
> [Anton Konushin](https://scholar.google.com/citations?user=ZT_k-wMAAAAJ)
> <br>
> Samsung AI Center Moscow <br>
>
### Installation
For convenience, we provide a [Dockerfile](docker/Dockerfile).

Alternatively, you can install all required packages manually. This implementation is based on [mmdetection3d](https://github.com/open-mmlab/mmdetection3d) framework.

Please refer to the original installation guide [getting_started.md](docs/getting_started.md), including MinkowskiEngine installation, replacing open-mmlab/mmdetection3d with samsunglabs/td3d.

Most of the `TD3D`-related code locates in the following files:
[detectors/td3d_instance_segmentor.py](mmdet3d/models/detectors/td3d_instance_segmentor.py),
[necks/ngfc_neck.py](mmdet3d/models/necks/ngfc_neck.py),
[decode_heads/td3d_instance_head.py](mmdet3d/models/decode_heads/td3d_instance_head.py).

### Getting Started

Please see [getting_started.md](docs/getting_started.md) for basic usage examples.
We follow the `mmdetection3d` data preparation protocol described in [scannet](data/scannet), [s3dis](data/s3dis).


**Training**

To start training, run [train](tools/train.py) with `TD3D` [configs](configs/td3d_is):
```shell
python tools/train.py configs/td3d_is/td3d_is_scannet-3d-18class.py
```

**Testing**

Test pre-trained model using [test](tools/test.py) with `TD3D` [configs](configs/td3d_is). For best quality on Scannet and S3DIS, set `score_thr` to `0.1` and `nms_pre` to `1200` in configs. For best quality on Scannet200, set `score_thr` to `0.07` and `nms_pre` to `300`:
```shell
python tools/test.py configs/td3d_is/td3d_is_scannet-3d-18class.py \
work_dirs/td3d_is_scannet-3d-18class/latest.pth --eval mAP
```

**Visualization**

Visualizations can be created with [test](tools/test.py) script.
For better visualizations, you may set `score_thr` to `0.20` and `nms_pre` to `200` in configs:
```shell
python tools/test.py configs/td3d_is/td3d_is_scannet-3d-18class.py \
work_dirs/td3d_is_scannet-3d-18class/latest.pth --eval mAP --show \
--show-dir work_dirs/td3d_is_scannet-3d-18class
```

### Models (quality on validation subset)

| Dataset | [email protected] | [email protected] | mAP | Download |
|:-------:|:--------:|:-------:|:--------:|:--------:|
| ScanNet | 81.3 | 71.1 | 46.2 | [model]() &#124; [config]() |
| S3DIS (5 area) | 82.8 | 66.5 | 47.4 | [model]() &#124; [config]() |
| S3DIS (5 area) <br /> (ScanNet pretrain) | 85.6 | 75.5 | 61.1 | [model]() &#124; [config]() |
| Scannet200 | 39.7 | 33.3 | 22.2 | [model]() &#124; [config]() |

<!-- ### Example Detections
<p align="center"><img src="./resources/github.png" alt="drawing" width="90%"/></p> -->

<!-- ### Citation
If you find this work useful for your research, please cite our paper:
```
``` -->
Loading

0 comments on commit a39b1d9

Please sign in to comment.