mpark commited on
Commit
9f5a9c5
β€’
1 Parent(s): 9da80c7

agnostic and densepose

Browse files
This view is limited to 50 files because it contains too many changes. Β  See raw diff
Files changed (50) hide show
  1. .gitignore +213 -0
  2. README.md +3 -3
  3. app.py +149 -0
  4. examples/garment/00055_00.jpg +0 -0
  5. examples/garment/00126_00.jpg +0 -0
  6. examples/garment/00151_00.jpg +0 -0
  7. examples/model/model_1.png +0 -0
  8. examples/model/model_2.png +0 -0
  9. examples/model/model_3.png +0 -0
  10. preprocess/detectron2/.circleci/config.yml +271 -0
  11. preprocess/detectron2/.circleci/import-tests.sh +16 -0
  12. preprocess/detectron2/.clang-format +85 -0
  13. preprocess/detectron2/.flake8 +15 -0
  14. preprocess/detectron2/.github/CODE_OF_CONDUCT.md +5 -0
  15. preprocess/detectron2/.github/CONTRIBUTING.md +68 -0
  16. preprocess/detectron2/.github/Detectron2-Logo-Horz.svg +1 -0
  17. preprocess/detectron2/.github/ISSUE_TEMPLATE.md +5 -0
  18. preprocess/detectron2/.github/ISSUE_TEMPLATE/bugs.md +38 -0
  19. preprocess/detectron2/.github/ISSUE_TEMPLATE/config.yml +17 -0
  20. preprocess/detectron2/.github/ISSUE_TEMPLATE/documentation.md +14 -0
  21. preprocess/detectron2/.github/ISSUE_TEMPLATE/feature-request.md +31 -0
  22. preprocess/detectron2/.github/ISSUE_TEMPLATE/unexpected-problems-bugs.md +44 -0
  23. preprocess/detectron2/.github/pull_request_template.md +10 -0
  24. preprocess/detectron2/.github/workflows/check-template.yml +86 -0
  25. preprocess/detectron2/.github/workflows/levenshtein.js +44 -0
  26. preprocess/detectron2/.github/workflows/needs-reply.yml +98 -0
  27. preprocess/detectron2/.github/workflows/remove-needs-reply.yml +25 -0
  28. preprocess/detectron2/.github/workflows/workflow.yml +81 -0
  29. preprocess/detectron2/.gitignore +53 -0
  30. preprocess/detectron2/GETTING_STARTED.md +79 -0
  31. preprocess/detectron2/INSTALL.md +261 -0
  32. preprocess/detectron2/LICENSE +202 -0
  33. preprocess/detectron2/MODEL_ZOO.md +1052 -0
  34. preprocess/detectron2/README.md +68 -0
  35. preprocess/detectron2/configs/Base-RCNN-C4.yaml +18 -0
  36. preprocess/detectron2/configs/Base-RCNN-DilatedC5.yaml +31 -0
  37. preprocess/detectron2/configs/Base-RCNN-FPN.yaml +42 -0
  38. preprocess/detectron2/configs/Base-RetinaNet.yaml +25 -0
  39. preprocess/detectron2/configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml +17 -0
  40. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml +9 -0
  41. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml +9 -0
  42. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml +9 -0
  43. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml +6 -0
  44. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml +9 -0
  45. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml +6 -0
  46. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml +9 -0
  47. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml +6 -0
  48. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml +9 -0
  49. preprocess/detectron2/configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml +13 -0
  50. preprocess/detectron2/configs/COCO-Detection/fcos_R_50_FPN_1x.py +11 -0
.gitignore ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /checkpoints
2
+ /tmp
3
+
4
+ # Created by https://www.toptal.com/developers/gitignore/api/linux,visualstudiocode,python
5
+ # Edit at https://www.toptal.com/developers/gitignore?templates=linux,visualstudiocode,python
6
+
7
+ ### Linux ###
8
+ *~
9
+
10
+ # temporary files which can be created if a process still has a handle open of a deleted file
11
+ .fuse_hidden*
12
+
13
+ # KDE directory preferences
14
+ .directory
15
+
16
+ # Linux trash folder which might appear on any partition or disk
17
+ .Trash-*
18
+
19
+ # .nfs files are created when an open file is removed but is still being accessed
20
+ .nfs*
21
+
22
+ ### Python ###
23
+ # Byte-compiled / optimized / DLL files
24
+ __pycache__/
25
+ *.py[cod]
26
+ *$py.class
27
+
28
+ # C extensions
29
+ *.so
30
+
31
+ # Distribution / packaging
32
+ .Python
33
+ build/
34
+ develop-eggs/
35
+ dist/
36
+ downloads/
37
+ eggs/
38
+ .eggs/
39
+ lib/
40
+ lib64/
41
+ parts/
42
+ sdist/
43
+ var/
44
+ wheels/
45
+ share/python-wheels/
46
+ *.egg-info/
47
+ .installed.cfg
48
+ *.egg
49
+ MANIFEST
50
+
51
+ # PyInstaller
52
+ # Usually these files are written by a python script from a template
53
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
54
+ *.manifest
55
+ *.spec
56
+
57
+ # Installer logs
58
+ pip-log.txt
59
+ pip-delete-this-directory.txt
60
+
61
+ # Unit test / coverage reports
62
+ htmlcov/
63
+ .tox/
64
+ .nox/
65
+ .coverage
66
+ .coverage.*
67
+ .cache
68
+ nosetests.xml
69
+ coverage.xml
70
+ *.cover
71
+ *.py,cover
72
+ .hypothesis/
73
+ .pytest_cache/
74
+ cover/
75
+
76
+ # Translations
77
+ *.mo
78
+ *.pot
79
+
80
+ # Django stuff:
81
+ *.log
82
+ local_settings.py
83
+ db.sqlite3
84
+ db.sqlite3-journal
85
+
86
+ # Flask stuff:
87
+ instance/
88
+ .webassets-cache
89
+
90
+ # Scrapy stuff:
91
+ .scrapy
92
+
93
+ # Sphinx documentation
94
+ docs/_build/
95
+
96
+ # PyBuilder
97
+ .pybuilder/
98
+ target/
99
+
100
+ # Jupyter Notebook
101
+ .ipynb_checkpoints
102
+
103
+ # IPython
104
+ profile_default/
105
+ ipython_config.py
106
+
107
+ # pyenv
108
+ # For a library or package, you might want to ignore these files since the code is
109
+ # intended to run in multiple environments; otherwise, check them in:
110
+ # .python-version
111
+
112
+ # pipenv
113
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
114
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
115
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
116
+ # install all needed dependencies.
117
+ #Pipfile.lock
118
+
119
+ # poetry
120
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
121
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
122
+ # commonly ignored for libraries.
123
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
124
+ #poetry.lock
125
+
126
+ # pdm
127
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
128
+ #pdm.lock
129
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
130
+ # in version control.
131
+ # https://pdm.fming.dev/#use-with-ide
132
+ .pdm.toml
133
+
134
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
135
+ __pypackages__/
136
+
137
+ # Celery stuff
138
+ celerybeat-schedule
139
+ celerybeat.pid
140
+
141
+ # SageMath parsed files
142
+ *.sage.py
143
+
144
+ # Environments
145
+ .env
146
+ .venv
147
+ env/
148
+ venv/
149
+ ENV/
150
+ env.bak/
151
+ venv.bak/
152
+
153
+ # Spyder project settings
154
+ .spyderproject
155
+ .spyproject
156
+
157
+ # Rope project settings
158
+ .ropeproject
159
+
160
+ # mkdocs documentation
161
+ /site
162
+
163
+ # mypy
164
+ .mypy_cache/
165
+ .dmypy.json
166
+ dmypy.json
167
+
168
+ # Pyre type checker
169
+ .pyre/
170
+
171
+ # pytype static type analyzer
172
+ .pytype/
173
+
174
+ # Cython debug symbols
175
+ cython_debug/
176
+
177
+ # PyCharm
178
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
179
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
180
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
181
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
182
+ #.idea/
183
+
184
+ ### Python Patch ###
185
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
186
+ poetry.toml
187
+
188
+ # ruff
189
+ .ruff_cache/
190
+
191
+ # LSP config files
192
+ pyrightconfig.json
193
+
194
+ ### VisualStudioCode ###
195
+ .vscode/*
196
+ !.vscode/settings.json
197
+ !.vscode/tasks.json
198
+ !.vscode/launch.json
199
+ !.vscode/extensions.json
200
+ !.vscode/*.code-snippets
201
+
202
+ # Local History for Visual Studio Code
203
+ .history/
204
+
205
+ # Built Visual Studio Code Extensions
206
+ *.vsix
207
+
208
+ ### VisualStudioCode Patch ###
209
+ # Ignore all local history of files
210
+ .history
211
+ .ionide
212
+
213
+ # End of https://www.toptal.com/developers/gitignore/api/linux,visualstudiocode,python
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
  title: StableVITON
3
- emoji: πŸ¦€
4
- colorFrom: pink
5
- colorTo: red
6
  sdk: gradio
7
  sdk_version: 4.23.0
8
  app_file: app.py
 
1
  ---
2
  title: StableVITON
3
+ emoji: πŸ‘•πŸ‘”πŸ‘—
4
+ colorFrom: blue
5
+ colorTo: blue
6
  sdk: gradio
7
  sdk_version: 4.23.0
8
  app_file: app.py
app.py ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ import time
4
+ from pathlib import Path
5
+
6
+ import gradio as gr
7
+ import torch
8
+ from PIL import Image
9
+
10
+ from utils_stableviton import get_mask_location
11
+
12
+ PROJECT_ROOT = Path(__file__).absolute().parents[1].absolute()
13
+ sys.path.insert(0, str(PROJECT_ROOT))
14
+
15
+ from preprocess.detectron2.projects.DensePose.apply_net_gradio import DensePose4Gradio
16
+ from preprocess.humanparsing.run_parsing import Parsing
17
+ from preprocess.openpose.run_openpose import OpenPose
18
+
19
+ os.environ['GRADIO_TEMP_DIR'] = './tmp' # TODO: turn off when final upload
20
+
21
+
22
+ openpose_model_hd = OpenPose(0)
23
+ parsing_model_hd = Parsing(0)
24
+ densepose_model_hd = DensePose4Gradio(
25
+ cfg='preprocess/detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml',
26
+ model='https://dl.fbaipublicfiles.com/densepose/densepose_rcnn_R_50_FPN_s1x/165712039/model_final_162be9.pkl',
27
+ )
28
+ stable_viton_model_hd = ... # TODO: write down stable viton model
29
+
30
+ category_dict = ['upperbody', 'lowerbody', 'dress']
31
+ category_dict_utils = ['upper_body', 'lower_body', 'dresses']
32
+
33
+ # import spaces # TODO: turn on when final upload
34
+
35
+ # @spaces.GPU # TODO: turn on when final upload
36
+
37
+
38
+ def process_hd(vton_img, garm_img, n_samples, n_steps, guidance_scale, seed):
39
+ model_type = 'hd'
40
+ category = 0 # 0:upperbody; 1:lowerbody; 2:dress
41
+
42
+ with torch.no_grad():
43
+ openpose_model_hd.preprocessor.body_estimation.model.to('cuda')
44
+
45
+ stt = time.time()
46
+ print('load images... ', end='')
47
+ garm_img = Image.open(garm_img).resize((768, 1024))
48
+ vton_img = Image.open(vton_img).resize((768, 1024))
49
+ print('%.2fs' % (time.time() - stt))
50
+
51
+ stt = time.time()
52
+ print('get agnostic map... ', end='')
53
+ keypoints = openpose_model_hd(vton_img.resize((384, 512)))
54
+ model_parse, _ = parsing_model_hd(vton_img.resize((384, 512)))
55
+ mask, mask_gray = get_mask_location(model_type, category_dict_utils[category], model_parse, keypoints)
56
+ mask = mask.resize((768, 1024), Image.NEAREST)
57
+ mask_gray = mask_gray.resize((768, 1024), Image.NEAREST)
58
+ masked_vton_img = Image.composite(mask_gray, vton_img, mask) # agnostic map
59
+ print('%.2fs' % (time.time() - stt))
60
+
61
+ stt = time.time()
62
+ print('get densepose... ', end='')
63
+ vton_img = vton_img.resize((768, 1024)) # size for densepose
64
+ densepose = densepose_model_hd.execute(vton_img) # densepose
65
+ print('%.2fs' % (time.time() - stt))
66
+
67
+ # # stable viton here
68
+ # images = stable_viton_model_hd(
69
+ # vton_img,
70
+ # garm_img,
71
+ # masked_vton_img,
72
+ # densepose,
73
+ # n_samples,
74
+ # n_steps,
75
+ # guidance_scale,
76
+ # seed
77
+ # )
78
+
79
+ # return images
80
+
81
+
82
+ example_path = os.path.join(os.path.dirname(__file__), 'examples')
83
+ model_hd = os.path.join(example_path, 'model/model_1.png')
84
+ garment_hd = os.path.join(example_path, 'garment/00055_00.jpg')
85
+
86
+ with gr.Blocks(css='style.css') as demo:
87
+ gr.HTML(
88
+ """
89
+ <div style="display: flex; justify-content: center; align-items: center; text-align: center;">
90
+ <div>
91
+ <h1>StableVITON Demo πŸ‘•πŸ‘”πŸ‘—</h1>
92
+ <div style="display: flex; justify-content: center; align-items: center; text-align: center;">
93
+ <a href='https://arxiv.org/abs/2312.01725'>
94
+ <img src="https://img.shields.io/badge/arXiv-2312.01725-red">
95
+ </a>
96
+ &nbsp;
97
+ <a href='https://rlawjdghek.github.io/StableVITON/'>
98
+ <img src='https://img.shields.io/badge/page-github.io-blue.svg'>
99
+ </a>
100
+ &nbsp;
101
+ <a href='https://github.com/rlawjdghek/StableVITON'>
102
+ <img src='https://img.shields.io/github/stars/rlawjdghek/StableVITON'>
103
+ </a>
104
+ &nbsp;
105
+ <a href='https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode'>
106
+ <img src='https://img.shields.io/badge/license-CC_BY--NC--SA_4.0-lightgrey'>
107
+ </a>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ """
112
+ )
113
+ with gr.Row():
114
+ gr.Markdown("## Experience virtual try-on with your own images!")
115
+ with gr.Row():
116
+ with gr.Column():
117
+ vton_img = gr.Image(label="Model", type="filepath", height=384, value=model_hd)
118
+ example = gr.Examples(
119
+ inputs=vton_img,
120
+ examples_per_page=14,
121
+ examples=[
122
+ os.path.join(example_path, 'model/model_1.png'), # TODO more our models
123
+ os.path.join(example_path, 'model/model_2.png'),
124
+ os.path.join(example_path, 'model/model_3.png'),
125
+ ])
126
+ with gr.Column():
127
+ garm_img = gr.Image(label="Garment", type="filepath", height=384, value=garment_hd)
128
+ example = gr.Examples(
129
+ inputs=garm_img,
130
+ examples_per_page=14,
131
+ examples=[
132
+ os.path.join(example_path, 'garment/00055_00.jpg'),
133
+ os.path.join(example_path, 'garment/00126_00.jpg'),
134
+ os.path.join(example_path, 'garment/00151_00.jpg'),
135
+ ])
136
+ with gr.Column():
137
+ result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery", preview=True, scale=1)
138
+ with gr.Column():
139
+ run_button = gr.Button(value="Run")
140
+ # TODO: change default values (important!)
141
+ n_samples = gr.Slider(label="Images", minimum=1, maximum=4, value=1, step=1)
142
+ n_steps = gr.Slider(label="Steps", minimum=20, maximum=40, value=20, step=1)
143
+ guidance_scale = gr.Slider(label="Guidance scale", minimum=1.0, maximum=5.0, value=2.0, step=0.1)
144
+ seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, value=-1)
145
+
146
+ ips = [vton_img, garm_img, n_samples, n_steps, guidance_scale, seed]
147
+ run_button.click(fn=process_hd, inputs=ips, outputs=[result_gallery])
148
+
149
+ demo.launch()
examples/garment/00055_00.jpg ADDED
examples/garment/00126_00.jpg ADDED
examples/garment/00151_00.jpg ADDED
examples/model/model_1.png ADDED
examples/model/model_2.png ADDED
examples/model/model_3.png ADDED
preprocess/detectron2/.circleci/config.yml ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: 2.1
2
+
3
+ # -------------------------------------------------------------------------------------
4
+ # Environments to run the jobs in
5
+ # -------------------------------------------------------------------------------------
6
+ cpu: &cpu
7
+ machine:
8
+ image: ubuntu-2004:202107-02
9
+ resource_class: medium
10
+
11
+ gpu: &gpu
12
+ machine:
13
+ # NOTE: use a cuda version that's supported by all our pytorch versions
14
+ image: ubuntu-1604-cuda-11.1:202012-01
15
+ resource_class: gpu.nvidia.small
16
+
17
+ windows-cpu: &windows_cpu
18
+ machine:
19
+ resource_class: windows.medium
20
+ image: windows-server-2019-vs2019:stable
21
+ shell: powershell.exe
22
+
23
+ # windows-gpu: &windows_gpu
24
+ # machine:
25
+ # resource_class: windows.gpu.nvidia.medium
26
+ # image: windows-server-2019-nvidia:stable
27
+
28
+ version_parameters: &version_parameters
29
+ parameters:
30
+ pytorch_version:
31
+ type: string
32
+ torchvision_version:
33
+ type: string
34
+ pytorch_index:
35
+ type: string
36
+ # use test wheels index to have access to RC wheels
37
+ # https://download.pytorch.org/whl/test/torch_test.html
38
+ default: "https://download.pytorch.org/whl/torch_stable.html"
39
+ python_version: # NOTE: only affect linux
40
+ type: string
41
+ default: '3.8.6'
42
+
43
+ environment:
44
+ PYTORCH_VERSION: << parameters.pytorch_version >>
45
+ TORCHVISION_VERSION: << parameters.torchvision_version >>
46
+ PYTORCH_INDEX: << parameters.pytorch_index >>
47
+ PYTHON_VERSION: << parameters.python_version>>
48
+ # point datasets to ~/.torch so it's cached in CI
49
+ DETECTRON2_DATASETS: ~/.torch/datasets
50
+
51
+ # -------------------------------------------------------------------------------------
52
+ # Re-usable commands
53
+ # -------------------------------------------------------------------------------------
54
+ # install_nvidia_driver: &install_nvidia_driver
55
+ # - run:
56
+ # name: Install nvidia driver
57
+ # working_directory: ~/
58
+ # command: |
59
+ # wget -q 'https://s3.amazonaws.com/ossci-linux/nvidia_driver/NVIDIA-Linux-x86_64-430.40.run'
60
+ # sudo /bin/bash ./NVIDIA-Linux-x86_64-430.40.run -s --no-drm
61
+ # nvidia-smi
62
+
63
+ add_ssh_keys: &add_ssh_keys
64
+ # https://circleci.com/docs/2.0/add-ssh-key/
65
+ - add_ssh_keys:
66
+ fingerprints:
67
+ - "e4:13:f2:22:d4:49:e8:e4:57:5a:ac:20:2f:3f:1f:ca"
68
+
69
+ install_python: &install_python
70
+ - run:
71
+ name: Install Python
72
+ working_directory: ~/
73
+ command: |
74
+ # upgrade pyenv
75
+ cd /opt/circleci/.pyenv/plugins/python-build/../.. && git pull && cd -
76
+ pyenv install -s $PYTHON_VERSION
77
+ pyenv global $PYTHON_VERSION
78
+ python --version
79
+ which python
80
+ pip install --upgrade pip
81
+
82
+ setup_venv: &setup_venv
83
+ - run:
84
+ name: Setup Virtual Env
85
+ working_directory: ~/
86
+ command: |
87
+ python -m venv ~/venv
88
+ echo ". ~/venv/bin/activate" >> $BASH_ENV
89
+ . ~/venv/bin/activate
90
+ python --version
91
+ which python
92
+ which pip
93
+ pip install --upgrade pip
94
+
95
+ setup_venv_win: &setup_venv_win
96
+ - run:
97
+ name: Setup Virtual Env for Windows
98
+ command: |
99
+ pip install virtualenv
100
+ python -m virtualenv env
101
+ .\env\Scripts\activate
102
+ python --version
103
+ which python
104
+ which pip
105
+
106
+ install_linux_dep: &install_linux_dep
107
+ - run:
108
+ name: Install Dependencies
109
+ command: |
110
+ # disable crash coredump, so unittests fail fast
111
+ sudo systemctl stop apport.service
112
+ # install from github to get latest; install iopath first since fvcore depends on it
113
+ pip install --progress-bar off -U 'git+https://github.com/facebookresearch/iopath'
114
+ pip install --progress-bar off -U 'git+https://github.com/facebookresearch/fvcore'
115
+ # Don't use pytest-xdist: cuda tests are unstable under multi-process workers.
116
+ # Don't use opencv 4.7.0.68: https://github.com/opencv/opencv-python/issues/765
117
+ pip install --progress-bar off ninja opencv-python-headless!=4.7.0.68 pytest tensorboard pycocotools onnx
118
+ pip install --progress-bar off torch==$PYTORCH_VERSION -f $PYTORCH_INDEX
119
+ if [[ "$TORCHVISION_VERSION" == "master" ]]; then
120
+ pip install git+https://github.com/pytorch/vision.git
121
+ else
122
+ pip install --progress-bar off torchvision==$TORCHVISION_VERSION -f $PYTORCH_INDEX
123
+ fi
124
+
125
+ python -c 'import torch; print("CUDA:", torch.cuda.is_available())'
126
+ gcc --version
127
+
128
+ install_detectron2: &install_detectron2
129
+ - run:
130
+ name: Install Detectron2
131
+ command: |
132
+ # Remove first, in case it's in the CI cache
133
+ pip uninstall -y detectron2
134
+
135
+ pip install --progress-bar off -e .[all]
136
+ python -m detectron2.utils.collect_env
137
+ ./datasets/prepare_for_tests.sh
138
+
139
+ run_unittests: &run_unittests
140
+ - run:
141
+ name: Run Unit Tests
142
+ command: |
143
+ pytest -sv --durations=15 tests # parallel causes some random failures
144
+
145
+ uninstall_tests: &uninstall_tests
146
+ - run:
147
+ name: Run Tests After Uninstalling
148
+ command: |
149
+ pip uninstall -y detectron2
150
+ # Remove built binaries
151
+ rm -rf build/ detectron2/*.so
152
+ # Tests that code is importable without installation
153
+ PYTHONPATH=. ./.circleci/import-tests.sh
154
+
155
+
156
+ # -------------------------------------------------------------------------------------
157
+ # Jobs to run
158
+ # -------------------------------------------------------------------------------------
159
+ jobs:
160
+ linux_cpu_tests:
161
+ <<: *cpu
162
+ <<: *version_parameters
163
+
164
+ working_directory: ~/detectron2
165
+
166
+ steps:
167
+ - checkout
168
+
169
+ # Cache the venv directory that contains python, dependencies, and checkpoints
170
+ # Refresh the key when dependencies should be updated (e.g. when pytorch releases)
171
+ - restore_cache:
172
+ keys:
173
+ - cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
174
+
175
+ - <<: *install_python
176
+ - <<: *install_linux_dep
177
+ - <<: *install_detectron2
178
+ - <<: *run_unittests
179
+ - <<: *uninstall_tests
180
+
181
+ - save_cache:
182
+ paths:
183
+ - /opt/circleci/.pyenv
184
+ - ~/.torch
185
+ key: cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
186
+
187
+
188
+ linux_gpu_tests:
189
+ <<: *gpu
190
+ <<: *version_parameters
191
+
192
+ working_directory: ~/detectron2
193
+
194
+ steps:
195
+ - checkout
196
+
197
+ - restore_cache:
198
+ keys:
199
+ - cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
200
+
201
+ - <<: *install_python
202
+ - <<: *install_linux_dep
203
+ - <<: *install_detectron2
204
+ - <<: *run_unittests
205
+ - <<: *uninstall_tests
206
+
207
+ - save_cache:
208
+ paths:
209
+ - /opt/circleci/.pyenv
210
+ - ~/.torch
211
+ key: cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210827
212
+
213
+ windows_cpu_build:
214
+ <<: *windows_cpu
215
+ <<: *version_parameters
216
+ steps:
217
+ - <<: *add_ssh_keys
218
+ - checkout
219
+ - <<: *setup_venv_win
220
+
221
+ # Cache the env directory that contains dependencies
222
+ - restore_cache:
223
+ keys:
224
+ - cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210404
225
+
226
+ - run:
227
+ name: Install Dependencies
228
+ command: |
229
+ pip install certifi --ignore-installed # required on windows to workaround some cert issue
230
+ pip install numpy cython # required on windows before pycocotools
231
+ pip install opencv-python-headless pytest-xdist pycocotools tensorboard onnx
232
+ pip install -U git+https://github.com/facebookresearch/iopath
233
+ pip install -U git+https://github.com/facebookresearch/fvcore
234
+ pip install torch==$env:PYTORCH_VERSION torchvision==$env:TORCHVISION_VERSION -f $env:PYTORCH_INDEX
235
+
236
+ - save_cache:
237
+ paths:
238
+ - env
239
+ key: cache-{{ arch }}-<< parameters.pytorch_version >>-{{ .Branch }}-20210404
240
+
241
+ - <<: *install_detectron2
242
+ # TODO: unittest fails for now
243
+
244
+ workflows:
245
+ version: 2
246
+ regular_test:
247
+ jobs:
248
+ - linux_cpu_tests:
249
+ name: linux_cpu_tests_pytorch1.10
250
+ pytorch_version: '1.10.0+cpu'
251
+ torchvision_version: '0.11.1+cpu'
252
+ - linux_gpu_tests:
253
+ name: linux_gpu_tests_pytorch1.8
254
+ pytorch_version: '1.8.1+cu111'
255
+ torchvision_version: '0.9.1+cu111'
256
+ - linux_gpu_tests:
257
+ name: linux_gpu_tests_pytorch1.9
258
+ pytorch_version: '1.9+cu111'
259
+ torchvision_version: '0.10+cu111'
260
+ - linux_gpu_tests:
261
+ name: linux_gpu_tests_pytorch1.10
262
+ pytorch_version: '1.10+cu111'
263
+ torchvision_version: '0.11.1+cu111'
264
+ - linux_gpu_tests:
265
+ name: linux_gpu_tests_pytorch1.10_python39
266
+ pytorch_version: '1.10+cu111'
267
+ torchvision_version: '0.11.1+cu111'
268
+ python_version: '3.9.6'
269
+ - windows_cpu_build:
270
+ pytorch_version: '1.10+cpu'
271
+ torchvision_version: '0.11.1+cpu'
preprocess/detectron2/.circleci/import-tests.sh ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash -e
2
+ # Copyright (c) Facebook, Inc. and its affiliates.
3
+
4
+ # Test that import works without building detectron2.
5
+
6
+ # Check that _C is not importable
7
+ python -c "from detectron2 import _C" > /dev/null 2>&1 && {
8
+ echo "This test should be run without building detectron2."
9
+ exit 1
10
+ }
11
+
12
+ # Check that other modules are still importable, even when _C is not importable
13
+ python -c "from detectron2 import modeling"
14
+ python -c "from detectron2 import modeling, data"
15
+ python -c "from detectron2 import evaluation, export, checkpoint"
16
+ python -c "from detectron2 import utils, engine"
preprocess/detectron2/.clang-format ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AccessModifierOffset: -1
2
+ AlignAfterOpenBracket: AlwaysBreak
3
+ AlignConsecutiveAssignments: false
4
+ AlignConsecutiveDeclarations: false
5
+ AlignEscapedNewlinesLeft: true
6
+ AlignOperands: false
7
+ AlignTrailingComments: false
8
+ AllowAllParametersOfDeclarationOnNextLine: false
9
+ AllowShortBlocksOnASingleLine: false
10
+ AllowShortCaseLabelsOnASingleLine: false
11
+ AllowShortFunctionsOnASingleLine: Empty
12
+ AllowShortIfStatementsOnASingleLine: false
13
+ AllowShortLoopsOnASingleLine: false
14
+ AlwaysBreakAfterReturnType: None
15
+ AlwaysBreakBeforeMultilineStrings: true
16
+ AlwaysBreakTemplateDeclarations: true
17
+ BinPackArguments: false
18
+ BinPackParameters: false
19
+ BraceWrapping:
20
+ AfterClass: false
21
+ AfterControlStatement: false
22
+ AfterEnum: false
23
+ AfterFunction: false
24
+ AfterNamespace: false
25
+ AfterObjCDeclaration: false
26
+ AfterStruct: false
27
+ AfterUnion: false
28
+ BeforeCatch: false
29
+ BeforeElse: false
30
+ IndentBraces: false
31
+ BreakBeforeBinaryOperators: None
32
+ BreakBeforeBraces: Attach
33
+ BreakBeforeTernaryOperators: true
34
+ BreakConstructorInitializersBeforeComma: false
35
+ BreakAfterJavaFieldAnnotations: false
36
+ BreakStringLiterals: false
37
+ ColumnLimit: 80
38
+ CommentPragmas: '^ IWYU pragma:'
39
+ ConstructorInitializerAllOnOneLineOrOnePerLine: true
40
+ ConstructorInitializerIndentWidth: 4
41
+ ContinuationIndentWidth: 4
42
+ Cpp11BracedListStyle: true
43
+ DerivePointerAlignment: false
44
+ DisableFormat: false
45
+ ForEachMacros: [ FOR_EACH, FOR_EACH_R, FOR_EACH_RANGE, ]
46
+ IncludeCategories:
47
+ - Regex: '^<.*\.h(pp)?>'
48
+ Priority: 1
49
+ - Regex: '^<.*'
50
+ Priority: 2
51
+ - Regex: '.*'
52
+ Priority: 3
53
+ IndentCaseLabels: true
54
+ IndentWidth: 2
55
+ IndentWrappedFunctionNames: false
56
+ KeepEmptyLinesAtTheStartOfBlocks: false
57
+ MacroBlockBegin: ''
58
+ MacroBlockEnd: ''
59
+ MaxEmptyLinesToKeep: 1
60
+ NamespaceIndentation: None
61
+ ObjCBlockIndentWidth: 2
62
+ ObjCSpaceAfterProperty: false
63
+ ObjCSpaceBeforeProtocolList: false
64
+ PenaltyBreakBeforeFirstCallParameter: 1
65
+ PenaltyBreakComment: 300
66
+ PenaltyBreakFirstLessLess: 120
67
+ PenaltyBreakString: 1000
68
+ PenaltyExcessCharacter: 1000000
69
+ PenaltyReturnTypeOnItsOwnLine: 200
70
+ PointerAlignment: Left
71
+ ReflowComments: true
72
+ SortIncludes: true
73
+ SpaceAfterCStyleCast: false
74
+ SpaceBeforeAssignmentOperators: true
75
+ SpaceBeforeParens: ControlStatements
76
+ SpaceInEmptyParentheses: false
77
+ SpacesBeforeTrailingComments: 1
78
+ SpacesInAngles: false
79
+ SpacesInContainerLiterals: true
80
+ SpacesInCStyleCastParentheses: false
81
+ SpacesInParentheses: false
82
+ SpacesInSquareBrackets: false
83
+ Standard: Cpp11
84
+ TabWidth: 8
85
+ UseTab: Never
preprocess/detectron2/.flake8 ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is an example .flake8 config, used when developing *Black* itself.
2
+ # Keep in sync with setup.cfg which is used for source packages.
3
+
4
+ [flake8]
5
+ ignore = W503, E203, E221, C901, C408, E741, C407, B017, F811, C101, EXE001, EXE002
6
+ max-line-length = 100
7
+ max-complexity = 18
8
+ select = B,C,E,F,W,T4,B9
9
+ exclude = build
10
+ per-file-ignores =
11
+ **/__init__.py:F401,F403,E402
12
+ **/configs/**.py:F401,E402
13
+ configs/**.py:F401,E402
14
+ **/tests/config/**.py:F401,E402
15
+ tests/config/**.py:F401,E402
preprocess/detectron2/.github/CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # Code of Conduct
2
+
3
+ Facebook has adopted a Code of Conduct that we expect project participants to adhere to.
4
+ Please read the [full text](https://code.fb.com/codeofconduct/)
5
+ so that you can understand what actions will and will not be tolerated.
preprocess/detectron2/.github/CONTRIBUTING.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to detectron2
2
+
3
+ ## Issues
4
+ We use GitHub issues to track public bugs and questions.
5
+ Please make sure to follow one of the
6
+ [issue templates](https://github.com/facebookresearch/detectron2/issues/new/choose)
7
+ when reporting any issues.
8
+
9
+ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
10
+ disclosure of security bugs. In those cases, please go through the process
11
+ outlined on that page and do not file a public issue.
12
+
13
+ ## Pull Requests
14
+ We actively welcome pull requests.
15
+
16
+ However, if you're adding any significant features (e.g. > 50 lines), please
17
+ make sure to discuss with maintainers about your motivation and proposals in an issue
18
+ before sending a PR. This is to save your time so you don't spend time on a PR that we'll not accept.
19
+
20
+ We do not always accept new features, and we take the following
21
+ factors into consideration:
22
+
23
+ 1. Whether the same feature can be achieved without modifying detectron2.
24
+ Detectron2 is designed so that you can implement many extensions from the outside, e.g.
25
+ those in [projects](https://github.com/facebookresearch/detectron2/tree/master/projects).
26
+ * If some part of detectron2 is not extensible enough, you can also bring up a more general issue to
27
+ improve it. Such feature request may be useful to more users.
28
+ 2. Whether the feature is potentially useful to a large audience (e.g. an impactful detection paper, a popular dataset,
29
+ a significant speedup, a widely useful utility),
30
+ or only to a small portion of users (e.g., a less-known paper, an improvement not in the object
31
+ detection field, a trick that's not very popular in the community, code to handle a non-standard type of data)
32
+ * Adoption of additional models, datasets, new task are by default not added to detectron2 before they
33
+ receive significant popularity in the community.
34
+ We sometimes accept such features in `projects/`, or as a link in `projects/README.md`.
35
+ 3. Whether the proposed solution has a good design / interface. This can be discussed in the issue prior to PRs, or
36
+ in the form of a draft PR.
37
+ 4. Whether the proposed solution adds extra mental/practical overhead to users who don't
38
+ need such feature.
39
+ 5. Whether the proposed solution breaks existing APIs.
40
+
41
+ To add a feature to an existing function/class `Func`, there are always two approaches:
42
+ (1) add new arguments to `Func`; (2) write a new `Func_with_new_feature`.
43
+ To meet the above criteria, we often prefer approach (2), because:
44
+
45
+ 1. It does not involve modifying or potentially breaking existing code.
46
+ 2. It does not add overhead to users who do not need the new feature.
47
+ 3. Adding new arguments to a function/class is not scalable w.r.t. all the possible new research ideas in the future.
48
+
49
+ When sending a PR, please do:
50
+
51
+ 1. If a PR contains multiple orthogonal changes, split it to several PRs.
52
+ 2. If you've added code that should be tested, add tests.
53
+ 3. For PRs that need experiments (e.g. adding a new model or new methods),
54
+ you don't need to update model zoo, but do provide experiment results in the description of the PR.
55
+ 4. If APIs are changed, update the documentation.
56
+ 5. We use the [Google style docstrings](https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html) in python.
57
+ 6. Make sure your code lints with `./dev/linter.sh`.
58
+
59
+
60
+ ## Contributor License Agreement ("CLA")
61
+ In order to accept your pull request, we need you to submit a CLA. You only need
62
+ to do this once to work on any of Facebook's open source projects.
63
+
64
+ Complete your CLA here: <https://code.facebook.com/cla>
65
+
66
+ ## License
67
+ By contributing to detectron2, you agree that your contributions will be licensed
68
+ under the LICENSE file in the root directory of this source tree.
preprocess/detectron2/.github/Detectron2-Logo-Horz.svg ADDED
preprocess/detectron2/.github/ISSUE_TEMPLATE.md ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+
2
+ Please select an issue template from
3
+ https://github.com/facebookresearch/detectron2/issues/new/choose .
4
+
5
+ Otherwise your issue will be closed.
preprocess/detectron2/.github/ISSUE_TEMPLATE/bugs.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "πŸ› Bugs"
3
+ about: Report bugs in detectron2
4
+ title: Please read & provide the following
5
+
6
+ ---
7
+
8
+ ## Instructions To Reproduce the πŸ› Bug:
9
+ 1. Full runnable code or full changes you made:
10
+ ```
11
+ If making changes to the project itself, please use output of the following command:
12
+ git rev-parse HEAD; git diff
13
+
14
+ <put code or diff here>
15
+ ```
16
+ 2. What exact command you run:
17
+ 3. __Full logs__ or other relevant observations:
18
+ ```
19
+ <put logs here>
20
+ ```
21
+ 4. please simplify the steps as much as possible so they do not require additional resources to
22
+ run, such as a private dataset.
23
+
24
+ ## Expected behavior:
25
+
26
+ If there are no obvious error in "full logs" provided above,
27
+ please tell us the expected behavior.
28
+
29
+ ## Environment:
30
+
31
+ Provide your environment information using the following command:
32
+ ```
33
+ wget -nc -q https://github.com/facebookresearch/detectron2/raw/main/detectron2/utils/collect_env.py && python collect_env.py
34
+ ```
35
+
36
+ If your issue looks like an installation issue / environment issue,
37
+ please first try to solve it yourself with the instructions in
38
+ https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues
preprocess/detectron2/.github/ISSUE_TEMPLATE/config.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # require an issue template to be chosen
2
+ blank_issues_enabled: false
3
+
4
+ contact_links:
5
+ - name: How-To / All Other Questions
6
+ url: https://github.com/facebookresearch/detectron2/discussions
7
+ about: Use "github discussions" for community support on general questions that don't belong to the above issue categories
8
+ - name: Detectron2 Documentation
9
+ url: https://detectron2.readthedocs.io/index.html
10
+ about: Check if your question is answered in tutorials or API docs
11
+
12
+ # Unexpected behaviors & bugs are split to two templates.
13
+ # When they are one template, users think "it's not a bug" and don't choose the template.
14
+ #
15
+ # But the file name is still "unexpected-problems-bugs.md" so that old references
16
+ # to this issue template still works.
17
+ # It's ok since this template should be a superset of "bugs.md" (unexpected behaviors is a superset of bugs)
preprocess/detectron2/.github/ISSUE_TEMPLATE/documentation.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F4DA Documentation Issue"
3
+ about: Report a problem about existing documentation, comments, website or tutorials.
4
+ labels: documentation
5
+
6
+ ---
7
+
8
+ ## πŸ“š Documentation Issue
9
+
10
+ This issue category is for problems about existing documentation, not for asking how-to questions.
11
+
12
+ * Provide a link to an existing documentation/comment/tutorial:
13
+
14
+ * How should the above documentation/comment/tutorial improve:
preprocess/detectron2/.github/ISSUE_TEMPLATE/feature-request.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "\U0001F680Feature Request"
3
+ about: Suggest an improvement or new feature
4
+ labels: enhancement
5
+
6
+ ---
7
+
8
+ ## πŸš€ Feature
9
+ A clear and concise description of the feature proposal.
10
+
11
+ ## Motivation & Examples
12
+
13
+ Tell us why the feature is useful.
14
+
15
+ Describe what the feature would look like, if it is implemented.
16
+ Best demonstrated using **code examples** in addition to words.
17
+
18
+ ## Note
19
+
20
+ We only consider adding new features if they are relevant to many users.
21
+
22
+ If you request implementation of research papers -- we only consider papers that have enough significance and prevalance in the object detection field.
23
+
24
+ We do not take requests for most projects in the `projects/` directory, because they are research code release that is mainly for other researchers to reproduce results.
25
+
26
+ "Make X faster/accurate" is not a valid feature request. "Implement a concrete feature that can make X faster/accurate" can be a valid feature request.
27
+
28
+ Instead of adding features inside detectron2,
29
+ you can implement many features by [extending detectron2](https://detectron2.readthedocs.io/tutorials/extend.html).
30
+ The [projects/](https://github.com/facebookresearch/detectron2/tree/main/projects/) directory contains many of such examples.
31
+
preprocess/detectron2/.github/ISSUE_TEMPLATE/unexpected-problems-bugs.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "😩 Unexpected behaviors"
3
+ about: Report unexpected behaviors when using detectron2
4
+ title: Please read & provide the following
5
+
6
+ ---
7
+
8
+ If you do not know the root cause of the problem, please post according to this template:
9
+
10
+ ## Instructions To Reproduce the Issue:
11
+
12
+ Check https://stackoverflow.com/help/minimal-reproducible-example for how to ask good questions.
13
+ Simplify the steps to reproduce the issue using suggestions from the above link, and provide them below:
14
+
15
+ 1. Full runnable code or full changes you made:
16
+ ```
17
+ If making changes to the project itself, please use output of the following command:
18
+ git rev-parse HEAD; git diff
19
+
20
+ <put code or diff here>
21
+ ```
22
+ 2. What exact command you run:
23
+ 3. __Full logs__ or other relevant observations:
24
+ ```
25
+ <put logs here>
26
+ ```
27
+
28
+ ## Expected behavior:
29
+
30
+ If there are no obvious crash in "full logs" provided above,
31
+ please tell us the expected behavior.
32
+
33
+ If you expect a model to converge / work better, we do not help with such issues, unless
34
+ a model fails to reproduce the results in detectron2 model zoo, or proves existence of bugs.
35
+
36
+ ## Environment:
37
+
38
+ Paste the output of the following command:
39
+ ```
40
+ wget -nc -nv https://github.com/facebookresearch/detectron2/raw/main/detectron2/utils/collect_env.py && python collect_env.py
41
+ ```
42
+
43
+ If your issue looks like an installation issue / environment issue,
44
+ please first check common issues in https://detectron2.readthedocs.io/tutorials/install.html#common-installation-issues
preprocess/detectron2/.github/pull_request_template.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ Thanks for your contribution!
2
+
3
+ If you're sending a large PR (e.g., >100 lines),
4
+ please open an issue first about the feature / bug, and indicate how you want to contribute.
5
+
6
+ We do not always accept features.
7
+ See https://detectron2.readthedocs.io/notes/contributing.html#pull-requests about how we handle PRs.
8
+
9
+ Before submitting a PR, please run `dev/linter.sh` to lint the code.
10
+
preprocess/detectron2/.github/workflows/check-template.yml ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Check issue template
2
+
3
+ on:
4
+ issues:
5
+ types: [opened]
6
+
7
+ jobs:
8
+ check-template:
9
+ runs-on: ubuntu-latest
10
+ # comment this out when testing with https://github.com/nektos/act
11
+ if: ${{ github.repository_owner == 'facebookresearch' }}
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: actions/github-script@v3
15
+ with:
16
+ github-token: ${{secrets.GITHUB_TOKEN}}
17
+ script: |
18
+ // Arguments available:
19
+ // - github: A pre-authenticated octokit/rest.js client
20
+ // - context: An object containing the context of the workflow run
21
+ // - core: A reference to the @actions/core package
22
+ // - io: A reference to the @actions/io package
23
+ const fs = require('fs');
24
+ const editDistance = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/levenshtein.js`).getEditDistance
25
+ issue = await github.issues.get({
26
+ owner: context.issue.owner,
27
+ repo: context.issue.repo,
28
+ issue_number: context.issue.number,
29
+ });
30
+ const hasLabel = issue.data.labels.length > 0;
31
+ if (hasLabel || issue.state === "closed") {
32
+ // don't require template on them
33
+ core.debug("Issue " + issue.data.title + " was skipped.");
34
+ return;
35
+ }
36
+
37
+ sameAsTemplate = function(filename, body) {
38
+ let tmpl = fs.readFileSync(`.github/ISSUE_TEMPLATE/${filename}`, 'utf8');
39
+ tmpl = tmpl.toLowerCase().split("---").slice(2).join("").trim();
40
+ tmpl = tmpl.replace(/(\r\n|\n|\r)/gm, "");
41
+ let bodyr = body.replace(/(\r\n|\n|\r)/gm, "");
42
+ let dist = editDistance(tmpl, bodyr);
43
+ return dist < 8;
44
+ };
45
+
46
+ checkFail = async function(msg) {
47
+ core.info("Processing '" + issue.data.title + "' with message: " + msg);
48
+ await github.issues.addLabels({
49
+ owner: context.issue.owner,
50
+ repo: context.issue.repo,
51
+ issue_number: context.issue.number,
52
+ labels: ["needs-more-info"],
53
+ });
54
+ await github.issues.createComment({
55
+ owner: context.issue.owner,
56
+ repo: context.issue.repo,
57
+ issue_number: context.issue.number,
58
+ body: msg,
59
+ });
60
+ };
61
+
62
+ const body = issue.data.body.toLowerCase().trim();
63
+
64
+ if (sameAsTemplate("bugs.md", body) || sameAsTemplate("unexpected-problems-bugs.md", body)) {
65
+ await checkFail(`
66
+ We found that not enough information is provided about this issue.
67
+ Please provide details following the [issue template](https://github.com/facebookresearch/detectron2/issues/new/choose).`)
68
+ return;
69
+ }
70
+
71
+ const hasInstructions = body.indexOf("reproduce") != -1;
72
+ const hasEnvironment = (body.indexOf("environment") != -1) || (body.indexOf("colab") != -1) || (body.indexOf("docker") != -1);
73
+ if (hasInstructions && hasEnvironment) {
74
+ core.debug("Issue " + issue.data.title + " follows template.");
75
+ return;
76
+ }
77
+
78
+ let message = "You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the [issue template](https://github.com/facebookresearch/detectron2/issues/new/choose).\n";
79
+ message += "The following information is missing: ";
80
+ if (!hasInstructions) {
81
+ message += "\"Instructions To Reproduce the Issue and __Full__ Logs\"; ";
82
+ }
83
+ if (!hasEnvironment) {
84
+ message += "\"Your Environment\"; ";
85
+ }
86
+ await checkFail(message);
preprocess/detectron2/.github/workflows/levenshtein.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copyright (c) 2011 Andrei Mackenzie
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ 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.
9
+ */
10
+
11
+ // Compute the edit distance between the two given strings
12
+ exports.getEditDistance = function(a, b){
13
+ if(a.length == 0) return b.length;
14
+ if(b.length == 0) return a.length;
15
+
16
+ var matrix = [];
17
+
18
+ // increment along the first column of each row
19
+ var i;
20
+ for(i = 0; i <= b.length; i++){
21
+ matrix[i] = [i];
22
+ }
23
+
24
+ // increment each column in the first row
25
+ var j;
26
+ for(j = 0; j <= a.length; j++){
27
+ matrix[0][j] = j;
28
+ }
29
+
30
+ // Fill in the rest of the matrix
31
+ for(i = 1; i <= b.length; i++){
32
+ for(j = 1; j <= a.length; j++){
33
+ if(b.charAt(i-1) == a.charAt(j-1)){
34
+ matrix[i][j] = matrix[i-1][j-1];
35
+ } else {
36
+ matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, // substitution
37
+ Math.min(matrix[i][j-1] + 1, // insertion
38
+ matrix[i-1][j] + 1)); // deletion
39
+ }
40
+ }
41
+ }
42
+
43
+ return matrix[b.length][a.length];
44
+ };
preprocess/detectron2/.github/workflows/needs-reply.yml ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Close/Lock issues after inactivity
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 0 * * *"
6
+
7
+ jobs:
8
+ close-issues-needs-more-info:
9
+ runs-on: ubuntu-latest
10
+ if: ${{ github.repository_owner == 'facebookresearch' }}
11
+ steps:
12
+ - name: Close old issues that need reply
13
+ uses: actions/github-script@v3
14
+ with:
15
+ github-token: ${{secrets.GITHUB_TOKEN}}
16
+ # Modified from https://github.com/dwieeb/needs-reply
17
+ script: |
18
+ // Arguments available:
19
+ // - github: A pre-authenticated octokit/rest.js client
20
+ // - context: An object containing the context of the workflow run
21
+ // - core: A reference to the @actions/core package
22
+ // - io: A reference to the @actions/io package
23
+ const kLabelToCheck = "needs-more-info";
24
+ const kInvalidLabel = "invalid/unrelated";
25
+ const kDaysBeforeClose = 7;
26
+ const kMessage = "Requested information was not provided in 7 days, so we're closing this issue.\n\nPlease open new issue if information becomes available. Otherwise, use [github discussions](https://github.com/facebookresearch/detectron2/discussions) for free-form discussions."
27
+
28
+ issues = await github.issues.listForRepo({
29
+ owner: context.repo.owner,
30
+ repo: context.repo.repo,
31
+ state: 'open',
32
+ labels: kLabelToCheck,
33
+ sort: 'updated',
34
+ direction: 'asc',
35
+ per_page: 30,
36
+ page: 1,
37
+ });
38
+ issues = issues.data;
39
+ if (issues.length === 0) {
40
+ core.info('No more issues found to process. Exiting.');
41
+ return;
42
+ }
43
+ for (const issue of issues) {
44
+ if (!!issue.pull_request)
45
+ continue;
46
+ core.info(`Processing issue #${issue.number}`);
47
+
48
+ let updatedAt = new Date(issue.updated_at).getTime();
49
+ const numComments = issue.comments;
50
+ const comments = await github.issues.listComments({
51
+ owner: context.repo.owner,
52
+ repo: context.repo.repo,
53
+ issue_number: issue.number,
54
+ per_page: 30,
55
+ page: Math.floor((numComments - 1) / 30) + 1, // the last page
56
+ });
57
+ const lastComments = comments.data
58
+ .map(l => new Date(l.created_at).getTime())
59
+ .sort();
60
+ if (lastComments.length > 0) {
61
+ updatedAt = lastComments[lastComments.length - 1];
62
+ }
63
+
64
+ const now = new Date().getTime();
65
+ const daysSinceUpdated = (now - updatedAt) / 1000 / 60 / 60 / 24;
66
+
67
+ if (daysSinceUpdated < kDaysBeforeClose) {
68
+ core.info(`Skipping #${issue.number} because it has been updated in the last ${daysSinceUpdated} days`);
69
+ continue;
70
+ }
71
+ core.info(`Closing #${issue.number} because it has not been updated in the last ${daysSinceUpdated} days`);
72
+ await github.issues.createComment({
73
+ owner: context.repo.owner,
74
+ repo: context.repo.repo,
75
+ issue_number: issue.number,
76
+ body: kMessage,
77
+ });
78
+ const newLabels = numComments <= 2 ? [kInvalidLabel, kLabelToCheck] : issue.labels;
79
+ await github.issues.update({
80
+ owner: context.repo.owner,
81
+ repo: context.repo.repo,
82
+ issue_number: issue.number,
83
+ labels: newLabels,
84
+ state: 'closed',
85
+ });
86
+ }
87
+
88
+ lock-issues-after-closed:
89
+ runs-on: ubuntu-latest
90
+ if: ${{ github.repository_owner == 'facebookresearch' }}
91
+ steps:
92
+ - name: Lock closed issues that have no activity for a while
93
+ uses: dessant/lock-threads@v2
94
+ with:
95
+ github-token: ${{ github.token }}
96
+ issue-lock-inactive-days: '300'
97
+ process-only: 'issues'
98
+ issue-exclude-labels: 'enhancement,bug,documentation'
preprocess/detectron2/.github/workflows/remove-needs-reply.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Remove needs-more-info label
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ issues:
7
+ types: [edited]
8
+
9
+ jobs:
10
+ remove-needs-more-info-label:
11
+ runs-on: ubuntu-latest
12
+ # 1. issue_comment events could include PR comment, filter them out
13
+ # 2. Only trigger action if event was produced by the original author
14
+ if: ${{ !github.event.issue.pull_request && github.event.sender.login == github.event.issue.user.login }}
15
+ steps:
16
+ - name: Remove needs-more-info label
17
+ uses: octokit/request-action@v2.x
18
+ continue-on-error: true
19
+ with:
20
+ route: DELETE /repos/:repository/issues/:issue/labels/:label
21
+ repository: ${{ github.repository }}
22
+ issue: ${{ github.event.issue.number }}
23
+ label: needs-more-info
24
+ env:
25
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
preprocess/detectron2/.github/workflows/workflow.yml ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CI
2
+ on: [push, pull_request]
3
+
4
+ # Run linter with github actions for quick feedbacks.
5
+ # Run macos tests with github actions. Linux (CPU & GPU) tests currently runs on CircleCI
6
+ jobs:
7
+ linter:
8
+ runs-on: ubuntu-latest
9
+ # run on PRs, or commits to facebookresearch (not internal)
10
+ if: ${{ github.repository_owner == 'facebookresearch' || github.event_name == 'pull_request' }}
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - name: Set up Python 3.9
14
+ uses: actions/setup-python@v2
15
+ with:
16
+ python-version: 3.9
17
+ - name: Install dependencies
18
+ # flake8-bugbear flake8-comprehensions are useful but not available internally
19
+ run: |
20
+ python -m pip install --upgrade pip
21
+ python -m pip install flake8==3.8.1 isort==4.3.21
22
+ python -m pip install black==22.3.0
23
+ flake8 --version
24
+ - name: Lint
25
+ run: |
26
+ echo "Running isort"
27
+ isort -c -sp .
28
+ echo "Running black"
29
+ black -l 100 --check .
30
+ echo "Running flake8"
31
+ flake8 .
32
+
33
+ macos_tests:
34
+ runs-on: macos-latest
35
+ # run on PRs, or commits to facebookresearch (not internal)
36
+ if: ${{ github.repository_owner == 'facebookresearch' || github.event_name == 'pull_request' }}
37
+ strategy:
38
+ fail-fast: false
39
+ matrix:
40
+ torch: ["1.8", "1.9", "1.10"]
41
+ include:
42
+ - torch: "1.8"
43
+ torchvision: 0.9
44
+ - torch: "1.9"
45
+ torchvision: "0.10"
46
+ - torch: "1.10"
47
+ torchvision: "0.11.1"
48
+ env:
49
+ # point datasets to ~/.torch so it's cached by CI
50
+ DETECTRON2_DATASETS: ~/.torch/datasets
51
+ steps:
52
+ - name: Checkout
53
+ uses: actions/checkout@v2
54
+ - name: Set up Python 3.8
55
+ uses: actions/setup-python@v2
56
+ with:
57
+ python-version: 3.8
58
+ - name: Cache dependencies
59
+ uses: actions/cache@v2
60
+ with:
61
+ path: |
62
+ ${{ env.pythonLocation }}/lib/python3.8/site-packages
63
+ ~/.torch
64
+ key: ${{ runner.os }}-torch${{ matrix.torch }}-${{ hashFiles('setup.py') }}-20220119
65
+
66
+ - name: Install dependencies
67
+ run: |
68
+ python -m pip install -U pip
69
+ python -m pip install ninja opencv-python-headless onnx pytest-xdist
70
+ python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
71
+ # install from github to get latest; install iopath first since fvcore depends on it
72
+ python -m pip install -U 'git+https://github.com/facebookresearch/iopath'
73
+ python -m pip install -U 'git+https://github.com/facebookresearch/fvcore'
74
+
75
+ - name: Build and install
76
+ run: |
77
+ CC=clang CXX=clang++ python -m pip install -e .[all]
78
+ python -m detectron2.utils.collect_env
79
+ ./datasets/prepare_for_tests.sh
80
+ - name: Run unittests
81
+ run: python -m pytest -n 4 --durations=15 -sv tests/
preprocess/detectron2/.gitignore ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # output dir
2
+ output
3
+ instant_test_output
4
+ inference_test_output
5
+
6
+
7
+ *.png
8
+ *.json
9
+ *.diff
10
+ *.jpg
11
+ !/projects/DensePose/doc/images/*.jpg
12
+
13
+ # compilation and distribution
14
+ __pycache__
15
+ _ext
16
+ *.pyc
17
+ *.pyd
18
+ *.so
19
+ *.dll
20
+ *.egg-info/
21
+ build/
22
+ dist/
23
+ wheels/
24
+
25
+ # pytorch/python/numpy formats
26
+ *.pth
27
+ *.pkl
28
+ *.npy
29
+ *.ts
30
+ model_ts*.txt
31
+
32
+ # ipython/jupyter notebooks
33
+ *.ipynb
34
+ **/.ipynb_checkpoints/
35
+
36
+ # Editor temporaries
37
+ *.swn
38
+ *.swo
39
+ *.swp
40
+ *~
41
+
42
+ # editor settings
43
+ .idea
44
+ .vscode
45
+ _darcs
46
+
47
+ # project dirs
48
+ /detectron2/model_zoo/configs
49
+ /datasets/*
50
+ !/datasets/*.*
51
+ /projects/*/datasets
52
+ /models
53
+ /snippet
preprocess/detectron2/GETTING_STARTED.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Getting Started with Detectron2
2
+
3
+ This document provides a brief intro of the usage of builtin command-line tools in detectron2.
4
+
5
+ For a tutorial that involves actual coding with the API,
6
+ see our [Colab Notebook](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5)
7
+ which covers how to run inference with an
8
+ existing model, and how to train a builtin model on a custom dataset.
9
+
10
+
11
+ ### Inference Demo with Pre-trained Models
12
+
13
+ 1. Pick a model and its config file from
14
+ [model zoo](MODEL_ZOO.md),
15
+ for example, `mask_rcnn_R_50_FPN_3x.yaml`.
16
+ 2. We provide `demo.py` that is able to demo builtin configs. Run it with:
17
+ ```
18
+ cd demo/
19
+ python demo.py --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
20
+ --input input1.jpg input2.jpg \
21
+ [--other-options]
22
+ --opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
23
+ ```
24
+ The configs are made for training, therefore we need to specify `MODEL.WEIGHTS` to a model from model zoo for evaluation.
25
+ This command will run the inference and show visualizations in an OpenCV window.
26
+
27
+ For details of the command line arguments, see `demo.py -h` or look at its source code
28
+ to understand its behavior. Some common arguments are:
29
+ * To run __on your webcam__, replace `--input files` with `--webcam`.
30
+ * To run __on a video__, replace `--input files` with `--video-input video.mp4`.
31
+ * To run __on cpu__, add `MODEL.DEVICE cpu` after `--opts`.
32
+ * To save outputs to a directory (for images) or a file (for webcam or video), use `--output`.
33
+
34
+
35
+ ### Training & Evaluation in Command Line
36
+
37
+ We provide two scripts in "tools/plain_train_net.py" and "tools/train_net.py",
38
+ that are made to train all the configs provided in detectron2. You may want to
39
+ use it as a reference to write your own training script.
40
+
41
+ Compared to "train_net.py", "plain_train_net.py" supports fewer default
42
+ features. It also includes fewer abstraction, therefore is easier to add custom
43
+ logic.
44
+
45
+ To train a model with "train_net.py", first
46
+ setup the corresponding datasets following
47
+ [datasets/README.md](./datasets/README.md),
48
+ then run:
49
+ ```
50
+ cd tools/
51
+ ./train_net.py --num-gpus 8 \
52
+ --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml
53
+ ```
54
+
55
+ The configs are made for 8-GPU training.
56
+ To train on 1 GPU, you may need to [change some parameters](https://arxiv.org/abs/1706.02677), e.g.:
57
+ ```
58
+ ./train_net.py \
59
+ --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \
60
+ --num-gpus 1 SOLVER.IMS_PER_BATCH 2 SOLVER.BASE_LR 0.0025
61
+ ```
62
+
63
+ To evaluate a model's performance, use
64
+ ```
65
+ ./train_net.py \
66
+ --config-file ../configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml \
67
+ --eval-only MODEL.WEIGHTS /path/to/checkpoint_file
68
+ ```
69
+ For more options, see `./train_net.py -h`.
70
+
71
+ ### Use Detectron2 APIs in Your Code
72
+
73
+ See our [Colab Notebook](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5)
74
+ to learn how to use detectron2 APIs to:
75
+ 1. run inference with an existing model
76
+ 2. train a builtin model on a custom dataset
77
+
78
+ See [detectron2/projects](https://github.com/facebookresearch/detectron2/tree/main/projects)
79
+ for more ways to build your project on detectron2.
preprocess/detectron2/INSTALL.md ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Installation
2
+
3
+ ### Requirements
4
+ - Linux or macOS with Python β‰₯ 3.7
5
+ - PyTorch β‰₯ 1.8 and [torchvision](https://github.com/pytorch/vision/) that matches the PyTorch installation.
6
+ Install them together at [pytorch.org](https://pytorch.org) to make sure of this
7
+ - OpenCV is optional but needed by demo and visualization
8
+
9
+
10
+ ### Build Detectron2 from Source
11
+
12
+ gcc & g++ β‰₯ 5.4 are required. [ninja](https://ninja-build.org/) is optional but recommended for faster build.
13
+ After having them, run:
14
+ ```
15
+ python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
16
+ # (add --user if you don't have permission)
17
+
18
+ # Or, to install it from a local clone:
19
+ git clone https://github.com/facebookresearch/detectron2.git
20
+ python -m pip install -e detectron2
21
+
22
+ # On macOS, you may need to prepend the above commands with a few environment variables:
23
+ CC=clang CXX=clang++ ARCHFLAGS="-arch x86_64" python -m pip install ...
24
+ ```
25
+
26
+ To __rebuild__ detectron2 that's built from a local clone, use `rm -rf build/ **/*.so` to clean the
27
+ old build first. You often need to rebuild detectron2 after reinstalling PyTorch.
28
+
29
+ ### Install Pre-Built Detectron2 (Linux only)
30
+
31
+ Choose from this table to install [v0.6 (Oct 2021)](https://github.com/facebookresearch/detectron2/releases):
32
+
33
+ <table class="docutils"><tbody><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.10</th><th valign="bottom" align="left" width="100">torch 1.9</th><th valign="bottom" align="left" width="100">torch 1.8</th> <tr><td align="left">11.3</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
34
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
35
+ </code></pre> </details> </td> <td align="left"> </td> <td align="left"> </td> </tr> <tr><td align="left">11.1</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
36
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.10/index.html
37
+ </code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
38
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.9/index.html
39
+ </code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
40
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html
41
+ </code></pre> </details> </td> </tr> <tr><td align="left">10.2</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
42
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.10/index.html
43
+ </code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
44
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.9/index.html
45
+ </code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
46
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.8/index.html
47
+ </code></pre> </details> </td> </tr> <tr><td align="left">10.1</td><td align="left"> </td> <td align="left"> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
48
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html
49
+ </code></pre> </details> </td> </tr> <tr><td align="left">cpu</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
50
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.10/index.html
51
+ </code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
52
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.9/index.html
53
+ </code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
54
+ https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.8/index.html
55
+ </code></pre> </details> </td> </tr></tbody></table>
56
+
57
+ Note that:
58
+ 1. The pre-built packages have to be used with corresponding version of CUDA and the official package of PyTorch.
59
+ Otherwise, please build detectron2 from source.
60
+ 2. New packages are released every few months. Therefore, packages may not contain latest features in the main
61
+ branch and may not be compatible with the main branch of a research project that uses detectron2
62
+ (e.g. those in [projects](projects)).
63
+
64
+ ### Common Installation Issues
65
+
66
+ Click each issue for its solutions:
67
+
68
+ <details>
69
+ <summary>
70
+ Undefined symbols that looks like "TH..","at::Tensor...","torch..."
71
+ </summary>
72
+ <br/>
73
+
74
+ This usually happens when detectron2 or torchvision is not
75
+ compiled with the version of PyTorch you're running.
76
+
77
+ If the error comes from a pre-built torchvision, uninstall torchvision and pytorch and reinstall them
78
+ following [pytorch.org](http://pytorch.org). So the versions will match.
79
+
80
+ If the error comes from a pre-built detectron2, check [release notes](https://github.com/facebookresearch/detectron2/releases),
81
+ uninstall and reinstall the correct pre-built detectron2 that matches pytorch version.
82
+
83
+ If the error comes from detectron2 or torchvision that you built manually from source,
84
+ remove files you built (`build/`, `**/*.so`) and rebuild it so it can pick up the version of pytorch currently in your environment.
85
+
86
+ If the above instructions do not resolve this problem, please provide an environment (e.g. a dockerfile) that can reproduce the issue.
87
+ </details>
88
+
89
+ <details>
90
+ <summary>
91
+ Missing torch dynamic libraries, OR segmentation fault immediately when using detectron2.
92
+ </summary>
93
+ This usually happens when detectron2 or torchvision is not
94
+ compiled with the version of PyTorch you're running. See the previous common issue for the solution.
95
+ </details>
96
+
97
+ <details>
98
+ <summary>
99
+ Undefined C++ symbols (e.g. "GLIBCXX..") or C++ symbols not found.
100
+ </summary>
101
+ <br/>
102
+ Usually it's because the library is compiled with a newer C++ compiler but run with an old C++ runtime.
103
+
104
+ This often happens with old anaconda.
105
+ It may help to run `conda update libgcc` to upgrade its runtime.
106
+
107
+ The fundamental solution is to avoid the mismatch, either by compiling using older version of C++
108
+ compiler, or run the code with proper C++ runtime.
109
+ To run the code with a specific C++ runtime, you can use environment variable `LD_PRELOAD=/path/to/libstdc++.so`.
110
+
111
+ </details>
112
+
113
+ <details>
114
+ <summary>
115
+ "nvcc not found" or "Not compiled with GPU support" or "Detectron2 CUDA Compiler: not available".
116
+ </summary>
117
+ <br/>
118
+ CUDA is not found when building detectron2.
119
+ You should make sure
120
+
121
+ ```
122
+ python -c 'import torch; from torch.utils.cpp_extension import CUDA_HOME; print(torch.cuda.is_available(), CUDA_HOME)'
123
+ ```
124
+
125
+ print `(True, a directory with cuda)` at the time you build detectron2.
126
+
127
+ Most models can run inference (but not training) without GPU support. To use CPUs, set `MODEL.DEVICE='cpu'` in the config.
128
+ </details>
129
+
130
+ <details>
131
+ <summary>
132
+ "invalid device function" or "no kernel image is available for execution".
133
+ </summary>
134
+ <br/>
135
+ Two possibilities:
136
+
137
+ * You build detectron2 with one version of CUDA but run it with a different version.
138
+
139
+ To check whether it is the case,
140
+ use `python -m detectron2.utils.collect_env` to find out inconsistent CUDA versions.
141
+ In the output of this command, you should expect "Detectron2 CUDA Compiler", "CUDA_HOME", "PyTorch built with - CUDA"
142
+ to contain cuda libraries of the same version.
143
+
144
+ When they are inconsistent,
145
+ you need to either install a different build of PyTorch (or build by yourself)
146
+ to match your local CUDA installation, or install a different version of CUDA to match PyTorch.
147
+
148
+ * PyTorch/torchvision/Detectron2 is not built for the correct GPU SM architecture (aka. compute capability).
149
+
150
+ The architecture included by PyTorch/detectron2/torchvision is available in the "architecture flags" in
151
+ `python -m detectron2.utils.collect_env`. It must include
152
+ the architecture of your GPU, which can be found at [developer.nvidia.com/cuda-gpus](https://developer.nvidia.com/cuda-gpus).
153
+
154
+ If you're using pre-built PyTorch/detectron2/torchvision, they have included support for most popular GPUs already.
155
+ If not supported, you need to build them from source.
156
+
157
+ When building detectron2/torchvision from source, they detect the GPU device and build for only the device.
158
+ This means the compiled code may not work on a different GPU device.
159
+ To recompile them for the correct architecture, remove all installed/compiled files,
160
+ and rebuild them with the `TORCH_CUDA_ARCH_LIST` environment variable set properly.
161
+ For example, `export TORCH_CUDA_ARCH_LIST="6.0;7.0"` makes it compile for both P100s and V100s.
162
+ </details>
163
+
164
+ <details>
165
+ <summary>
166
+ Undefined CUDA symbols; Cannot open libcudart.so
167
+ </summary>
168
+ <br/>
169
+ The version of NVCC you use to build detectron2 or torchvision does
170
+ not match the version of CUDA you are running with.
171
+ This often happens when using anaconda's CUDA runtime.
172
+
173
+ Use `python -m detectron2.utils.collect_env` to find out inconsistent CUDA versions.
174
+ In the output of this command, you should expect "Detectron2 CUDA Compiler", "CUDA_HOME", "PyTorch built with - CUDA"
175
+ to contain cuda libraries of the same version.
176
+
177
+ When they are inconsistent,
178
+ you need to either install a different build of PyTorch (or build by yourself)
179
+ to match your local CUDA installation, or install a different version of CUDA to match PyTorch.
180
+ </details>
181
+
182
+
183
+ <details>
184
+ <summary>
185
+ C++ compilation errors from NVCC / NVRTC, or "Unsupported gpu architecture"
186
+ </summary>
187
+ <br/>
188
+ A few possibilities:
189
+
190
+ 1. Local CUDA/NVCC version has to match the CUDA version of your PyTorch. Both can be found in `python collect_env.py`
191
+ (download from [here](./detectron2/utils/collect_env.py)).
192
+ When they are inconsistent, you need to either install a different build of PyTorch (or build by yourself)
193
+ to match your local CUDA installation, or install a different version of CUDA to match PyTorch.
194
+
195
+ 2. Local CUDA/NVCC version shall support the SM architecture (a.k.a. compute capability) of your GPU.
196
+ The capability of your GPU can be found at [developer.nvidia.com/cuda-gpus](https://developer.nvidia.com/cuda-gpus).
197
+ The capability supported by NVCC is listed at [here](https://gist.github.com/ax3l/9489132).
198
+ If your NVCC version is too old, this can be workaround by setting environment variable
199
+ `TORCH_CUDA_ARCH_LIST` to a lower, supported capability.
200
+
201
+ 3. The combination of NVCC and GCC you use is incompatible. You need to change one of their versions.
202
+ See [here](https://gist.github.com/ax3l/9489132) for some valid combinations.
203
+ Notably, CUDA<=10.1.105 doesn't support GCC>7.3.
204
+
205
+ The CUDA/GCC version used by PyTorch can be found by `print(torch.__config__.show())`.
206
+
207
+ </details>
208
+
209
+
210
+ <details>
211
+ <summary>
212
+ "ImportError: cannot import name '_C'".
213
+ </summary>
214
+ <br/>
215
+ Please build and install detectron2 following the instructions above.
216
+
217
+ Or, if you are running code from detectron2's root directory, `cd` to a different one.
218
+ Otherwise you may not import the code that you installed.
219
+ </details>
220
+
221
+
222
+ <details>
223
+ <summary>
224
+ Any issue on windows.
225
+ </summary>
226
+ <br/>
227
+
228
+ Detectron2 is continuously built on windows with [CircleCI](https://app.circleci.com/pipelines/github/facebookresearch/detectron2?branch=main).
229
+ However we do not provide official support for it.
230
+ PRs that improves code compatibility on windows are welcome.
231
+ </details>
232
+
233
+ <details>
234
+ <summary>
235
+ ONNX conversion segfault after some "TraceWarning".
236
+ </summary>
237
+ <br/>
238
+ The ONNX package is compiled with a too old compiler.
239
+
240
+ Please build and install ONNX from its source code using a compiler
241
+ whose version is closer to what's used by PyTorch (available in `torch.__config__.show()`).
242
+ </details>
243
+
244
+
245
+ <details>
246
+ <summary>
247
+ "library not found for -lstdc++" on older version of MacOS
248
+ </summary>
249
+ <br/>
250
+
251
+ See [this stackoverflow answer](https://stackoverflow.com/questions/56083725/macos-build-issues-lstdc-not-found-while-building-python-package).
252
+
253
+ </details>
254
+
255
+
256
+ ### Installation inside specific environments:
257
+
258
+ * __Colab__: see our [Colab Tutorial](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5)
259
+ which has step-by-step instructions.
260
+
261
+ * __Docker__: The official [Dockerfile](docker) installs detectron2 with a few simple commands.
preprocess/detectron2/LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
preprocess/detectron2/MODEL_ZOO.md ADDED
@@ -0,0 +1,1052 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Detectron2 Model Zoo and Baselines
2
+
3
+ ## Introduction
4
+
5
+ This file documents a large collection of baselines trained
6
+ with detectron2 in Sep-Oct, 2019.
7
+ All numbers were obtained on [Big Basin](https://engineering.fb.com/data-center-engineering/introducing-big-basin-our-next-generation-ai-hardware/)
8
+ servers with 8 NVIDIA V100 GPUs & NVLink. The speed numbers are periodically updated with latest PyTorch/CUDA/cuDNN versions.
9
+ You can access these models from code using [detectron2.model_zoo](https://detectron2.readthedocs.io/modules/model_zoo.html) APIs.
10
+
11
+ In addition to these official baseline models, you can find more models in [projects/](projects/).
12
+
13
+ #### How to Read the Tables
14
+ * The "Name" column contains a link to the config file. Models can be reproduced using `tools/train_net.py` with the corresponding yaml config file,
15
+ or `tools/lazyconfig_train_net.py` for python config files.
16
+ * Training speed is averaged across the entire training.
17
+ We keep updating the speed with latest version of detectron2/pytorch/etc.,
18
+ so they might be different from the `metrics` file.
19
+ Training speed for multi-machine jobs is not provided.
20
+ * Inference speed is measured by `tools/train_net.py --eval-only`, or [inference_on_dataset()](https://detectron2.readthedocs.io/modules/evaluation.html#detectron2.evaluation.inference_on_dataset),
21
+ with batch size 1 in detectron2 directly.
22
+ Measuring it with custom code may introduce other overhead.
23
+ Actual deployment in production should in general be faster than the given inference
24
+ speed due to more optimizations.
25
+ * The *model id* column is provided for ease of reference.
26
+ To check downloaded file integrity, any model on this page contains its md5 prefix in its file name.
27
+ * Training curves and other statistics can be found in `metrics` for each model.
28
+
29
+ #### Common Settings for COCO Models
30
+ * All COCO models were trained on `train2017` and evaluated on `val2017`.
31
+ * The default settings are __not directly comparable__ with Detectron's standard settings.
32
+ For example, our default training data augmentation uses scale jittering in addition to horizontal flipping.
33
+
34
+ To make fair comparisons with Detectron's settings, see
35
+ [Detectron1-Comparisons](configs/Detectron1-Comparisons/) for accuracy comparison,
36
+ and [benchmarks](https://detectron2.readthedocs.io/notes/benchmarks.html)
37
+ for speed comparison.
38
+ * For Faster/Mask R-CNN, we provide baselines based on __3 different backbone combinations__:
39
+ * __FPN__: Use a ResNet+FPN backbone with standard conv and FC heads for mask and box prediction,
40
+ respectively. It obtains the best
41
+ speed/accuracy tradeoff, but the other two are still useful for research.
42
+ * __C4__: Use a ResNet conv4 backbone with conv5 head. The original baseline in the Faster R-CNN paper.
43
+ * __DC5__ (Dilated-C5): Use a ResNet conv5 backbone with dilations in conv5, and standard conv and FC heads
44
+ for mask and box prediction, respectively.
45
+ This is used by the Deformable ConvNet paper.
46
+ * Most models are trained with the 3x schedule (~37 COCO epochs).
47
+ Although 1x models are heavily under-trained, we provide some ResNet-50 models with the 1x (~12 COCO epochs)
48
+ training schedule for comparison when doing quick research iteration.
49
+
50
+ #### ImageNet Pretrained Models
51
+
52
+ It's common to initialize from backbone models pre-trained on ImageNet classification tasks. The following backbone models are available:
53
+
54
+ * [R-50.pkl](https://dl.fbaipublicfiles.com/detectron2/ImageNetPretrained/MSRA/R-50.pkl): converted copy of [MSRA's original ResNet-50](https://github.com/KaimingHe/deep-residual-networks) model.
55
+ * [R-101.pkl](https://dl.fbaipublicfiles.com/detectron2/ImageNetPretrained/MSRA/R-101.pkl): converted copy of [MSRA's original ResNet-101](https://github.com/KaimingHe/deep-residual-networks) model.
56
+ * [X-101-32x8d.pkl](https://dl.fbaipublicfiles.com/detectron2/ImageNetPretrained/FAIR/X-101-32x8d.pkl): ResNeXt-101-32x8d model trained with Caffe2 at FB.
57
+ * [R-50.pkl (torchvision)](https://dl.fbaipublicfiles.com/detectron2/ImageNetPretrained/torchvision/R-50.pkl): converted copy of [torchvision's ResNet-50](https://pytorch.org/docs/stable/torchvision/models.html#torchvision.models.resnet50) model.
58
+ More details can be found in [the conversion script](tools/convert-torchvision-to-d2.py).
59
+
60
+ Note that the above models have __different__ format from those provided in Detectron: we do not fuse BatchNorm into an affine layer.
61
+ Pretrained models in Detectron's format can still be used. For example:
62
+ * [X-152-32x8d-IN5k.pkl](https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/25093814/X-152-32x8d-IN5k.pkl):
63
+ ResNeXt-152-32x8d model trained on ImageNet-5k with Caffe2 at FB (see ResNeXt paper for details on ImageNet-5k).
64
+ * [R-50-GN.pkl](https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/47261647/R-50-GN.pkl):
65
+ ResNet-50 with Group Normalization.
66
+ * [R-101-GN.pkl](https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/47592356/R-101-GN.pkl):
67
+ ResNet-101 with Group Normalization.
68
+
69
+ These models require slightly different settings regarding normalization and architecture. See the model zoo configs for reference.
70
+
71
+ #### License
72
+
73
+ All models available for download through this document are licensed under the
74
+ [Creative Commons Attribution-ShareAlike 3.0 license](https://creativecommons.org/licenses/by-sa/3.0/).
75
+
76
+ ### COCO Object Detection Baselines
77
+
78
+ #### Faster R-CNN:
79
+ <!--
80
+ (fb only) To update the table in vim:
81
+ 1. Remove the old table: d}
82
+ 2. Copy the below command to the place of the table
83
+ 3. :.!bash
84
+
85
+ ./gen_html_table.py --config 'COCO-Detection/faster*50*'{1x,3x}'*' 'COCO-Detection/faster*101*' --name R50-C4 R50-DC5 R50-FPN R50-C4 R50-DC5 R50-FPN R101-C4 R101-DC5 R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP
86
+ -->
87
+
88
+
89
+ <table><tbody>
90
+ <!-- START TABLE -->
91
+ <!-- TABLE HEADER -->
92
+ <th valign="bottom">Name</th>
93
+ <th valign="bottom">lr<br/>sched</th>
94
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
95
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
96
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
97
+ <th valign="bottom">box<br/>AP</th>
98
+ <th valign="bottom">model id</th>
99
+ <th valign="bottom">download</th>
100
+ <!-- TABLE BODY -->
101
+ <!-- ROW: faster_rcnn_R_50_C4_1x -->
102
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml">R50-C4</a></td>
103
+ <td align="center">1x</td>
104
+ <td align="center">0.551</td>
105
+ <td align="center">0.102</td>
106
+ <td align="center">4.8</td>
107
+ <td align="center">35.7</td>
108
+ <td align="center">137257644</td>
109
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_1x/137257644/model_final_721ade.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_1x/137257644/metrics.json">metrics</a></td>
110
+ </tr>
111
+ <!-- ROW: faster_rcnn_R_50_DC5_1x -->
112
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml">R50-DC5</a></td>
113
+ <td align="center">1x</td>
114
+ <td align="center">0.380</td>
115
+ <td align="center">0.068</td>
116
+ <td align="center">5.0</td>
117
+ <td align="center">37.3</td>
118
+ <td align="center">137847829</td>
119
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_1x/137847829/model_final_51d356.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_1x/137847829/metrics.json">metrics</a></td>
120
+ </tr>
121
+ <!-- ROW: faster_rcnn_R_50_FPN_1x -->
122
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
123
+ <td align="center">1x</td>
124
+ <td align="center">0.210</td>
125
+ <td align="center">0.038</td>
126
+ <td align="center">3.0</td>
127
+ <td align="center">37.9</td>
128
+ <td align="center">137257794</td>
129
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_1x/137257794/model_final_b275ba.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_1x/137257794/metrics.json">metrics</a></td>
130
+ </tr>
131
+ <!-- ROW: faster_rcnn_R_50_C4_3x -->
132
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml">R50-C4</a></td>
133
+ <td align="center">3x</td>
134
+ <td align="center">0.543</td>
135
+ <td align="center">0.104</td>
136
+ <td align="center">4.8</td>
137
+ <td align="center">38.4</td>
138
+ <td align="center">137849393</td>
139
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_3x/137849393/model_final_f97cb7.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_C4_3x/137849393/metrics.json">metrics</a></td>
140
+ </tr>
141
+ <!-- ROW: faster_rcnn_R_50_DC5_3x -->
142
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml">R50-DC5</a></td>
143
+ <td align="center">3x</td>
144
+ <td align="center">0.378</td>
145
+ <td align="center">0.070</td>
146
+ <td align="center">5.0</td>
147
+ <td align="center">39.0</td>
148
+ <td align="center">137849425</td>
149
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_3x/137849425/model_final_68d202.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_DC5_3x/137849425/metrics.json">metrics</a></td>
150
+ </tr>
151
+ <!-- ROW: faster_rcnn_R_50_FPN_3x -->
152
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml">R50-FPN</a></td>
153
+ <td align="center">3x</td>
154
+ <td align="center">0.209</td>
155
+ <td align="center">0.038</td>
156
+ <td align="center">3.0</td>
157
+ <td align="center">40.2</td>
158
+ <td align="center">137849458</td>
159
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/model_final_280758.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/metrics.json">metrics</a></td>
160
+ </tr>
161
+ <!-- ROW: faster_rcnn_R_101_C4_3x -->
162
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml">R101-C4</a></td>
163
+ <td align="center">3x</td>
164
+ <td align="center">0.619</td>
165
+ <td align="center">0.139</td>
166
+ <td align="center">5.9</td>
167
+ <td align="center">41.1</td>
168
+ <td align="center">138204752</td>
169
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_C4_3x/138204752/model_final_298dad.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_C4_3x/138204752/metrics.json">metrics</a></td>
170
+ </tr>
171
+ <!-- ROW: faster_rcnn_R_101_DC5_3x -->
172
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml">R101-DC5</a></td>
173
+ <td align="center">3x</td>
174
+ <td align="center">0.452</td>
175
+ <td align="center">0.086</td>
176
+ <td align="center">6.1</td>
177
+ <td align="center">40.6</td>
178
+ <td align="center">138204841</td>
179
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_DC5_3x/138204841/model_final_3e0943.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_DC5_3x/138204841/metrics.json">metrics</a></td>
180
+ </tr>
181
+ <!-- ROW: faster_rcnn_R_101_FPN_3x -->
182
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml">R101-FPN</a></td>
183
+ <td align="center">3x</td>
184
+ <td align="center">0.286</td>
185
+ <td align="center">0.051</td>
186
+ <td align="center">4.1</td>
187
+ <td align="center">42.0</td>
188
+ <td align="center">137851257</td>
189
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/model_final_f6e8b1.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/metrics.json">metrics</a></td>
190
+ </tr>
191
+ <!-- ROW: faster_rcnn_X_101_32x8d_FPN_3x -->
192
+ <tr><td align="left"><a href="configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml">X101-FPN</a></td>
193
+ <td align="center">3x</td>
194
+ <td align="center">0.638</td>
195
+ <td align="center">0.098</td>
196
+ <td align="center">6.7</td>
197
+ <td align="center">43.0</td>
198
+ <td align="center">139173657</td>
199
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x/139173657/model_final_68b088.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x/139173657/metrics.json">metrics</a></td>
200
+ </tr>
201
+ </tbody></table>
202
+
203
+ #### RetinaNet:
204
+ <!--
205
+ ./gen_html_table.py --config 'COCO-Detection/retina*50*' 'COCO-Detection/retina*101*' --name R50 R50 R101 --fields lr_sched train_speed inference_speed mem box_AP
206
+ -->
207
+
208
+ <table><tbody>
209
+ <!-- START TABLE -->
210
+ <!-- TABLE HEADER -->
211
+ <th valign="bottom">Name</th>
212
+ <th valign="bottom">lr<br/>sched</th>
213
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
214
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
215
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
216
+ <th valign="bottom">box<br/>AP</th>
217
+ <th valign="bottom">model id</th>
218
+ <th valign="bottom">download</th>
219
+ <!-- TABLE BODY -->
220
+ <!-- ROW: retinanet_R_50_FPN_1x -->
221
+ <tr><td align="left"><a href="configs/COCO-Detection/retinanet_R_50_FPN_1x.yaml">R50</a></td>
222
+ <td align="center">1x</td>
223
+ <td align="center">0.205</td>
224
+ <td align="center">0.041</td>
225
+ <td align="center">4.1</td>
226
+ <td align="center">37.4</td>
227
+ <td align="center">190397773</td>
228
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_1x/190397773/model_final_bfca0b.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_1x/190397773/metrics.json">metrics</a></td>
229
+ </tr>
230
+ <!-- ROW: retinanet_R_50_FPN_3x -->
231
+ <tr><td align="left"><a href="configs/COCO-Detection/retinanet_R_50_FPN_3x.yaml">R50</a></td>
232
+ <td align="center">3x</td>
233
+ <td align="center">0.205</td>
234
+ <td align="center">0.041</td>
235
+ <td align="center">4.1</td>
236
+ <td align="center">38.7</td>
237
+ <td align="center">190397829</td>
238
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_3x/190397829/model_final_5bd44e.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_50_FPN_3x/190397829/metrics.json">metrics</a></td>
239
+ </tr>
240
+ <!-- ROW: retinanet_R_101_FPN_3x -->
241
+ <tr><td align="left"><a href="configs/COCO-Detection/retinanet_R_101_FPN_3x.yaml">R101</a></td>
242
+ <td align="center">3x</td>
243
+ <td align="center">0.291</td>
244
+ <td align="center">0.054</td>
245
+ <td align="center">5.2</td>
246
+ <td align="center">40.4</td>
247
+ <td align="center">190397697</td>
248
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_101_FPN_3x/190397697/model_final_971ab9.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/retinanet_R_101_FPN_3x/190397697/metrics.json">metrics</a></td>
249
+ </tr>
250
+ </tbody></table>
251
+
252
+
253
+ #### RPN & Fast R-CNN:
254
+ <!--
255
+ ./gen_html_table.py --config 'COCO-Detection/rpn*' 'COCO-Detection/fast_rcnn*' --name "RPN R50-C4" "RPN R50-FPN" "Fast R-CNN R50-FPN" --fields lr_sched train_speed inference_speed mem box_AP prop_AR
256
+ -->
257
+
258
+ <table><tbody>
259
+ <!-- START TABLE -->
260
+ <!-- TABLE HEADER -->
261
+ <th valign="bottom">Name</th>
262
+ <th valign="bottom">lr<br/>sched</th>
263
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
264
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
265
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
266
+ <th valign="bottom">box<br/>AP</th>
267
+ <th valign="bottom">prop.<br/>AR</th>
268
+ <th valign="bottom">model id</th>
269
+ <th valign="bottom">download</th>
270
+ <!-- TABLE BODY -->
271
+ <!-- ROW: rpn_R_50_C4_1x -->
272
+ <tr><td align="left"><a href="configs/COCO-Detection/rpn_R_50_C4_1x.yaml">RPN R50-C4</a></td>
273
+ <td align="center">1x</td>
274
+ <td align="center">0.130</td>
275
+ <td align="center">0.034</td>
276
+ <td align="center">1.5</td>
277
+ <td align="center"></td>
278
+ <td align="center">51.6</td>
279
+ <td align="center">137258005</td>
280
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_C4_1x/137258005/model_final_450694.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_C4_1x/137258005/metrics.json">metrics</a></td>
281
+ </tr>
282
+ <!-- ROW: rpn_R_50_FPN_1x -->
283
+ <tr><td align="left"><a href="configs/COCO-Detection/rpn_R_50_FPN_1x.yaml">RPN R50-FPN</a></td>
284
+ <td align="center">1x</td>
285
+ <td align="center">0.186</td>
286
+ <td align="center">0.032</td>
287
+ <td align="center">2.7</td>
288
+ <td align="center"></td>
289
+ <td align="center">58.0</td>
290
+ <td align="center">137258492</td>
291
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_FPN_1x/137258492/model_final_02ce48.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/rpn_R_50_FPN_1x/137258492/metrics.json">metrics</a></td>
292
+ </tr>
293
+ <!-- ROW: fast_rcnn_R_50_FPN_1x -->
294
+ <tr><td align="left"><a href="configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml">Fast R-CNN R50-FPN</a></td>
295
+ <td align="center">1x</td>
296
+ <td align="center">0.140</td>
297
+ <td align="center">0.029</td>
298
+ <td align="center">2.6</td>
299
+ <td align="center">37.8</td>
300
+ <td align="center"></td>
301
+ <td align="center">137635226</td>
302
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/fast_rcnn_R_50_FPN_1x/137635226/model_final_e5f7ce.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Detection/fast_rcnn_R_50_FPN_1x/137635226/metrics.json">metrics</a></td>
303
+ </tr>
304
+ </tbody></table>
305
+
306
+ ### COCO Instance Segmentation Baselines with Mask R-CNN
307
+ <!--
308
+ ./gen_html_table.py --config 'COCO-InstanceSegmentation/mask*50*'{1x,3x}'*' 'COCO-InstanceSegmentation/mask*101*' --name R50-C4 R50-DC5 R50-FPN R50-C4 R50-DC5 R50-FPN R101-C4 R101-DC5 R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP mask_AP
309
+ -->
310
+
311
+
312
+
313
+ <table><tbody>
314
+ <!-- START TABLE -->
315
+ <!-- TABLE HEADER -->
316
+ <th valign="bottom">Name</th>
317
+ <th valign="bottom">lr<br/>sched</th>
318
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
319
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
320
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
321
+ <th valign="bottom">box<br/>AP</th>
322
+ <th valign="bottom">mask<br/>AP</th>
323
+ <th valign="bottom">model id</th>
324
+ <th valign="bottom">download</th>
325
+ <!-- TABLE BODY -->
326
+ <!-- ROW: mask_rcnn_R_50_C4_1x -->
327
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x.yaml">R50-C4</a></td>
328
+ <td align="center">1x</td>
329
+ <td align="center">0.584</td>
330
+ <td align="center">0.110</td>
331
+ <td align="center">5.2</td>
332
+ <td align="center">36.8</td>
333
+ <td align="center">32.2</td>
334
+ <td align="center">137259246</td>
335
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x/137259246/model_final_9243eb.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_1x/137259246/metrics.json">metrics</a></td>
336
+ </tr>
337
+ <!-- ROW: mask_rcnn_R_50_DC5_1x -->
338
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x.yaml">R50-DC5</a></td>
339
+ <td align="center">1x</td>
340
+ <td align="center">0.471</td>
341
+ <td align="center">0.076</td>
342
+ <td align="center">6.5</td>
343
+ <td align="center">38.3</td>
344
+ <td align="center">34.2</td>
345
+ <td align="center">137260150</td>
346
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x/137260150/model_final_4f86c3.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_1x/137260150/metrics.json">metrics</a></td>
347
+ </tr>
348
+ <!-- ROW: mask_rcnn_R_50_FPN_1x -->
349
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
350
+ <td align="center">1x</td>
351
+ <td align="center">0.261</td>
352
+ <td align="center">0.043</td>
353
+ <td align="center">3.4</td>
354
+ <td align="center">38.6</td>
355
+ <td align="center">35.2</td>
356
+ <td align="center">137260431</td>
357
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/model_final_a54504.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/metrics.json">metrics</a></td>
358
+ </tr>
359
+ <!-- ROW: mask_rcnn_R_50_C4_3x -->
360
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x.yaml">R50-C4</a></td>
361
+ <td align="center">3x</td>
362
+ <td align="center">0.575</td>
363
+ <td align="center">0.111</td>
364
+ <td align="center">5.2</td>
365
+ <td align="center">39.8</td>
366
+ <td align="center">34.4</td>
367
+ <td align="center">137849525</td>
368
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x/137849525/model_final_4ce675.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_C4_3x/137849525/metrics.json">metrics</a></td>
369
+ </tr>
370
+ <!-- ROW: mask_rcnn_R_50_DC5_3x -->
371
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x.yaml">R50-DC5</a></td>
372
+ <td align="center">3x</td>
373
+ <td align="center">0.470</td>
374
+ <td align="center">0.076</td>
375
+ <td align="center">6.5</td>
376
+ <td align="center">40.0</td>
377
+ <td align="center">35.9</td>
378
+ <td align="center">137849551</td>
379
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x/137849551/model_final_84107b.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_DC5_3x/137849551/metrics.json">metrics</a></td>
380
+ </tr>
381
+ <!-- ROW: mask_rcnn_R_50_FPN_3x -->
382
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml">R50-FPN</a></td>
383
+ <td align="center">3x</td>
384
+ <td align="center">0.261</td>
385
+ <td align="center">0.043</td>
386
+ <td align="center">3.4</td>
387
+ <td align="center">41.0</td>
388
+ <td align="center">37.2</td>
389
+ <td align="center">137849600</td>
390
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/metrics.json">metrics</a></td>
391
+ </tr>
392
+ <!-- ROW: mask_rcnn_R_101_C4_3x -->
393
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x.yaml">R101-C4</a></td>
394
+ <td align="center">3x</td>
395
+ <td align="center">0.652</td>
396
+ <td align="center">0.145</td>
397
+ <td align="center">6.3</td>
398
+ <td align="center">42.6</td>
399
+ <td align="center">36.7</td>
400
+ <td align="center">138363239</td>
401
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x/138363239/model_final_a2914c.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_C4_3x/138363239/metrics.json">metrics</a></td>
402
+ </tr>
403
+ <!-- ROW: mask_rcnn_R_101_DC5_3x -->
404
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x.yaml">R101-DC5</a></td>
405
+ <td align="center">3x</td>
406
+ <td align="center">0.545</td>
407
+ <td align="center">0.092</td>
408
+ <td align="center">7.6</td>
409
+ <td align="center">41.9</td>
410
+ <td align="center">37.3</td>
411
+ <td align="center">138363294</td>
412
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x/138363294/model_final_0464b7.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_DC5_3x/138363294/metrics.json">metrics</a></td>
413
+ </tr>
414
+ <!-- ROW: mask_rcnn_R_101_FPN_3x -->
415
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml">R101-FPN</a></td>
416
+ <td align="center">3x</td>
417
+ <td align="center">0.340</td>
418
+ <td align="center">0.056</td>
419
+ <td align="center">4.6</td>
420
+ <td align="center">42.9</td>
421
+ <td align="center">38.6</td>
422
+ <td align="center">138205316</td>
423
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x/138205316/model_final_a3ec72.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x/138205316/metrics.json">metrics</a></td>
424
+ </tr>
425
+ <!-- ROW: mask_rcnn_X_101_32x8d_FPN_3x -->
426
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml">X101-FPN</a></td>
427
+ <td align="center">3x</td>
428
+ <td align="center">0.690</td>
429
+ <td align="center">0.103</td>
430
+ <td align="center">7.2</td>
431
+ <td align="center">44.3</td>
432
+ <td align="center">39.5</td>
433
+ <td align="center">139653917</td>
434
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x/139653917/model_final_2d9806.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x/139653917/metrics.json">metrics</a></td>
435
+ </tr>
436
+ </tbody></table>
437
+
438
+
439
+
440
+ #### New baselines using Large-Scale Jitter and Longer Training Schedule
441
+
442
+ The following baselines of COCO Instance Segmentation with Mask R-CNN are generated
443
+ using a longer training schedule and large-scale jitter as described in Google's
444
+ [Simple Copy-Paste Data Augmentation](https://arxiv.org/pdf/2012.07177.pdf) paper. These
445
+ models are trained from scratch using random initialization. These baselines exceed the
446
+ previous Mask R-CNN baselines.
447
+
448
+ In the following table, one epoch consists of training on 118000 COCO images.
449
+
450
+ <table><tbody>
451
+ <!-- START TABLE -->
452
+ <!-- TABLE HEADER -->
453
+ <th valign="bottom">Name</th>
454
+ <th valign="bottom">epochs</th>
455
+ <th valign="bottom">train<br/>time<br/>(s/im)</th>
456
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
457
+ <th valign="bottom">box<br/>AP</th>
458
+ <th valign="bottom">mask<br/>AP</th>
459
+ <th valign="bottom">model id</th>
460
+ <th valign="bottom">download</th>
461
+ <!-- TABLE BODY -->
462
+ <!-- ROW: mask_rcnn_R_50_FPN_100ep_LSJ -->
463
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_R_50_FPN_100ep_LSJ.py">R50-FPN</a></td>
464
+ <td align="center">100</td>
465
+ <td align="center">0.376</td>
466
+ <td align="center">0.069</td>
467
+ <td align="center">44.6</td>
468
+ <td align="center">40.3</td>
469
+ <td align="center">42047764</td>
470
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_50_FPN_100ep_LSJ/42047764/model_final_bb69de.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_50_FPN_100ep_LSJ/42047764/metrics.json">metrics</a></td>
471
+ </tr>
472
+ <!-- ROW: mask_rcnn_R_50_FPN_200ep_LSJ -->
473
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_R_50_FPN_200ep_LSJ.py">R50-FPN</a></td>
474
+ <td align="center">200</td>
475
+ <td align="center">0.376</td>
476
+ <td align="center">0.069</td>
477
+ <td align="center">46.3</td>
478
+ <td align="center">41.7</td>
479
+ <td align="center">42047638</td>
480
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_50_FPN_200ep_LSJ/42047638/model_final_89a8d3.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_50_FPN_200ep_LSJ/42047638/metrics.json">metrics</a></td>
481
+ </tr>
482
+ <!-- ROW: mask_rcnn_R_50_FPN_400ep_LSJ -->
483
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_R_50_FPN_400ep_LSJ.py">R50-FPN</a></td>
484
+ <td align="center">400</td>
485
+ <td align="center">0.376</td>
486
+ <td align="center">0.069</td>
487
+ <td align="center">47.4</td>
488
+ <td align="center">42.5</td>
489
+ <td align="center">42019571</td>
490
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_50_FPN_400ep_LSJ/42019571/model_final_14d201.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_50_FPN_400ep_LSJ/42019571/metrics.json">metrics</a></td>
491
+ </tr>
492
+ <!-- ROW: mask_rcnn_R_101_FPN_100ep_LSJ -->
493
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_R_101_FPN_100ep_LSJ.py">R101-FPN</a></td>
494
+ <td align="center">100</td>
495
+ <td align="center">0.518</td>
496
+ <td align="center">0.073</td>
497
+ <td align="center">46.4</td>
498
+ <td align="center">41.6</td>
499
+ <td align="center">42025812</td>
500
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_101_FPN_100ep_LSJ/42025812/model_final_4f7b58.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_101_FPN_100ep_LSJ/42025812/metrics.json">metrics</a></td>
501
+ </tr>
502
+ <!-- ROW: mask_rcnn_R_101_FPN_200ep_LSJ -->
503
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_R_101_FPN_200ep_LSJ.py">R101-FPN</a></td>
504
+ <td align="center">200</td>
505
+ <td align="center">0.518</td>
506
+ <td align="center">0.073</td>
507
+ <td align="center">48.0</td>
508
+ <td align="center">43.1</td>
509
+ <td align="center">42131867</td>
510
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_101_FPN_200ep_LSJ/42131867/model_final_0bb7ae.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_101_FPN_200ep_LSJ/42131867/metrics.json">metrics</a></td>
511
+ </tr>
512
+ <!-- ROW: mask_rcnn_R_101_FPN_400ep_LSJ -->
513
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_R_101_FPN_400ep_LSJ.py">R101-FPN</a></td>
514
+ <td align="center">400</td>
515
+ <td align="center">0.518</td>
516
+ <td align="center">0.073</td>
517
+ <td align="center">48.9</td>
518
+ <td align="center">43.7</td>
519
+ <td align="center">42073830</td>
520
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_101_FPN_400ep_LSJ/42073830/model_final_f96b26.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_R_101_FPN_400ep_LSJ/42073830/metrics.json">metrics</a></td>
521
+ </tr>
522
+ <!-- ROW: mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ -->
523
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ.py">regnetx_4gf_dds_FPN</a></td>
524
+ <td align="center">100</td>
525
+ <td align="center">0.474</td>
526
+ <td align="center">0.071</td>
527
+ <td align="center">46.0</td>
528
+ <td align="center">41.3</td>
529
+ <td align="center">42047771</td>
530
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ/42047771/model_final_b7fbab.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ/42047771/metrics.json">metrics</a></td>
531
+ </tr>
532
+ <!-- ROW: mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ -->
533
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py">regnetx_4gf_dds_FPN</a></td>
534
+ <td align="center">200</td>
535
+ <td align="center">0.474</td>
536
+ <td align="center">0.071</td>
537
+ <td align="center">48.1</td>
538
+ <td align="center">43.1</td>
539
+ <td align="center">42132721</td>
540
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ/42132721/model_final_5d87c1.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ/42132721/metrics.json">metrics</a></td>
541
+ </tr>
542
+ <!-- ROW: mask_rcnn_regnetx_4gf_dds_FPN_400ep_LSJ -->
543
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_400ep_LSJ.py">regnetx_4gf_dds_FPN</a></td>
544
+ <td align="center">400</td>
545
+ <td align="center">0.474</td>
546
+ <td align="center">0.071</td>
547
+ <td align="center">48.6</td>
548
+ <td align="center">43.5</td>
549
+ <td align="center">42025447</td>
550
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_400ep_LSJ/42025447/model_final_f1362d.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_400ep_LSJ/42025447/metrics.json">metrics</a></td>
551
+ </tr>
552
+ <!-- ROW: mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ -->
553
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ.py">regnety_4gf_dds_FPN</a></td>
554
+ <td align="center">100</td>
555
+ <td align="center">0.487</td>
556
+ <td align="center">0.073</td>
557
+ <td align="center">46.1</td>
558
+ <td align="center">41.6</td>
559
+ <td align="center">42047784</td>
560
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ/42047784/model_final_6ba57e.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_100ep_LSJ/42047784/metrics.json">metrics</a></td>
561
+ </tr>
562
+ <!-- ROW: mask_rcnn_regnety_4gf_dds_FPN_200ep_LSJ -->
563
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_200ep_LSJ.py">regnety_4gf_dds_FPN</a></td>
564
+ <td align="center">200</td>
565
+ <td align="center">0.487</td>
566
+ <td align="center">0.072</td>
567
+ <td align="center">47.8</td>
568
+ <td align="center">43.0</td>
569
+ <td align="center">42047642</td>
570
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_200ep_LSJ/42047642/model_final_27b9c1.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_200ep_LSJ/42047642/metrics.json">metrics</a></td>
571
+ </tr>
572
+ <!-- ROW: mask_rcnn_regnety_4gf_dds_FPN_400ep_LSJ -->
573
+ <tr><td align="left"><a href="configs/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_400ep_LSJ.py">regnety_4gf_dds_FPN</a></td>
574
+ <td align="center">400</td>
575
+ <td align="center">0.487</td>
576
+ <td align="center">0.072</td>
577
+ <td align="center">48.2</td>
578
+ <td align="center">43.3</td>
579
+ <td align="center">42045954</td>
580
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_400ep_LSJ/42045954/model_final_ef3a80.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/new_baselines/mask_rcnn_regnety_4gf_dds_FPN_400ep_LSJ/42045954/metrics.json">metrics</a></td>
581
+ </tr>
582
+ </tbody></table>
583
+
584
+ ### COCO Person Keypoint Detection Baselines with Keypoint R-CNN
585
+ <!--
586
+ ./gen_html_table.py --config 'COCO-Keypoints/*50*' 'COCO-Keypoints/*101*' --name R50-FPN R50-FPN R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP keypoint_AP
587
+ -->
588
+
589
+
590
+ <table><tbody>
591
+ <!-- START TABLE -->
592
+ <!-- TABLE HEADER -->
593
+ <th valign="bottom">Name</th>
594
+ <th valign="bottom">lr<br/>sched</th>
595
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
596
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
597
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
598
+ <th valign="bottom">box<br/>AP</th>
599
+ <th valign="bottom">kp.<br/>AP</th>
600
+ <th valign="bottom">model id</th>
601
+ <th valign="bottom">download</th>
602
+ <!-- TABLE BODY -->
603
+ <!-- ROW: keypoint_rcnn_R_50_FPN_1x -->
604
+ <tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
605
+ <td align="center">1x</td>
606
+ <td align="center">0.315</td>
607
+ <td align="center">0.072</td>
608
+ <td align="center">5.0</td>
609
+ <td align="center">53.6</td>
610
+ <td align="center">64.0</td>
611
+ <td align="center">137261548</td>
612
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x/137261548/model_final_04e291.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_1x/137261548/metrics.json">metrics</a></td>
613
+ </tr>
614
+ <!-- ROW: keypoint_rcnn_R_50_FPN_3x -->
615
+ <tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml">R50-FPN</a></td>
616
+ <td align="center">3x</td>
617
+ <td align="center">0.316</td>
618
+ <td align="center">0.066</td>
619
+ <td align="center">5.0</td>
620
+ <td align="center">55.4</td>
621
+ <td align="center">65.5</td>
622
+ <td align="center">137849621</td>
623
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x/137849621/model_final_a6e10b.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x/137849621/metrics.json">metrics</a></td>
624
+ </tr>
625
+ <!-- ROW: keypoint_rcnn_R_101_FPN_3x -->
626
+ <tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml">R101-FPN</a></td>
627
+ <td align="center">3x</td>
628
+ <td align="center">0.390</td>
629
+ <td align="center">0.076</td>
630
+ <td align="center">6.1</td>
631
+ <td align="center">56.4</td>
632
+ <td align="center">66.1</td>
633
+ <td align="center">138363331</td>
634
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x/138363331/model_final_997cc7.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x/138363331/metrics.json">metrics</a></td>
635
+ </tr>
636
+ <!-- ROW: keypoint_rcnn_X_101_32x8d_FPN_3x -->
637
+ <tr><td align="left"><a href="configs/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x.yaml">X101-FPN</a></td>
638
+ <td align="center">3x</td>
639
+ <td align="center">0.738</td>
640
+ <td align="center">0.121</td>
641
+ <td align="center">8.7</td>
642
+ <td align="center">57.3</td>
643
+ <td align="center">66.0</td>
644
+ <td align="center">139686956</td>
645
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x/139686956/model_final_5ad38f.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-Keypoints/keypoint_rcnn_X_101_32x8d_FPN_3x/139686956/metrics.json">metrics</a></td>
646
+ </tr>
647
+ </tbody></table>
648
+
649
+ ### COCO Panoptic Segmentation Baselines with Panoptic FPN
650
+ <!--
651
+ ./gen_html_table.py --config 'COCO-PanopticSegmentation/*50*' 'COCO-PanopticSegmentation/*101*' --name R50-FPN R50-FPN R101-FPN --fields lr_sched train_speed inference_speed mem box_AP mask_AP PQ
652
+ -->
653
+
654
+
655
+ <table><tbody>
656
+ <!-- START TABLE -->
657
+ <!-- TABLE HEADER -->
658
+ <th valign="bottom">Name</th>
659
+ <th valign="bottom">lr<br/>sched</th>
660
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
661
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
662
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
663
+ <th valign="bottom">box<br/>AP</th>
664
+ <th valign="bottom">mask<br/>AP</th>
665
+ <th valign="bottom">PQ</th>
666
+ <th valign="bottom">model id</th>
667
+ <th valign="bottom">download</th>
668
+ <!-- TABLE BODY -->
669
+ <!-- ROW: panoptic_fpn_R_50_1x -->
670
+ <tr><td align="left"><a href="configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x.yaml">R50-FPN</a></td>
671
+ <td align="center">1x</td>
672
+ <td align="center">0.304</td>
673
+ <td align="center">0.053</td>
674
+ <td align="center">4.8</td>
675
+ <td align="center">37.6</td>
676
+ <td align="center">34.7</td>
677
+ <td align="center">39.4</td>
678
+ <td align="center">139514544</td>
679
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x/139514544/model_final_dbfeb4.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_1x/139514544/metrics.json">metrics</a></td>
680
+ </tr>
681
+ <!-- ROW: panoptic_fpn_R_50_3x -->
682
+ <tr><td align="left"><a href="configs/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml">R50-FPN</a></td>
683
+ <td align="center">3x</td>
684
+ <td align="center">0.302</td>
685
+ <td align="center">0.053</td>
686
+ <td align="center">4.8</td>
687
+ <td align="center">40.0</td>
688
+ <td align="center">36.5</td>
689
+ <td align="center">41.5</td>
690
+ <td align="center">139514569</td>
691
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x/139514569/model_final_c10459.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_50_3x/139514569/metrics.json">metrics</a></td>
692
+ </tr>
693
+ <!-- ROW: panoptic_fpn_R_101_3x -->
694
+ <tr><td align="left"><a href="configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml">R101-FPN</a></td>
695
+ <td align="center">3x</td>
696
+ <td align="center">0.392</td>
697
+ <td align="center">0.066</td>
698
+ <td align="center">6.0</td>
699
+ <td align="center">42.4</td>
700
+ <td align="center">38.5</td>
701
+ <td align="center">43.0</td>
702
+ <td align="center">139514519</td>
703
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x/139514519/model_final_cafdb1.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x/139514519/metrics.json">metrics</a></td>
704
+ </tr>
705
+ </tbody></table>
706
+
707
+
708
+ ### LVIS Instance Segmentation Baselines with Mask R-CNN
709
+
710
+ Mask R-CNN baselines on the [LVIS dataset](https://lvisdataset.org), v0.5.
711
+ These baselines are described in Table 3(c) of the [LVIS paper](https://arxiv.org/abs/1908.03195).
712
+
713
+ NOTE: the 1x schedule here has the same amount of __iterations__ as the COCO 1x baselines.
714
+ They are roughly 24 epochs of LVISv0.5 data.
715
+ The final results of these configs have large variance across different runs.
716
+
717
+ <!--
718
+ ./gen_html_table.py --config 'LVISv0.5-InstanceSegmentation/mask*50*' 'LVISv0.5-InstanceSegmentation/mask*101*' --name R50-FPN R101-FPN X101-FPN --fields lr_sched train_speed inference_speed mem box_AP mask_AP
719
+ -->
720
+
721
+
722
+ <table><tbody>
723
+ <!-- START TABLE -->
724
+ <!-- TABLE HEADER -->
725
+ <th valign="bottom">Name</th>
726
+ <th valign="bottom">lr<br/>sched</th>
727
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
728
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
729
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
730
+ <th valign="bottom">box<br/>AP</th>
731
+ <th valign="bottom">mask<br/>AP</th>
732
+ <th valign="bottom">model id</th>
733
+ <th valign="bottom">download</th>
734
+ <!-- TABLE BODY -->
735
+ <!-- ROW: mask_rcnn_R_50_FPN_1x -->
736
+ <tr><td align="left"><a href="configs/LVISv0.5-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml">R50-FPN</a></td>
737
+ <td align="center">1x</td>
738
+ <td align="center">0.292</td>
739
+ <td align="center">0.107</td>
740
+ <td align="center">7.1</td>
741
+ <td align="center">23.6</td>
742
+ <td align="center">24.4</td>
743
+ <td align="center">144219072</td>
744
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/LVISv0.5-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/144219072/model_final_571f7c.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/LVISv0.5-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/144219072/metrics.json">metrics</a></td>
745
+ </tr>
746
+ <!-- ROW: mask_rcnn_R_101_FPN_1x -->
747
+ <tr><td align="left"><a href="configs/LVISv0.5-InstanceSegmentation/mask_rcnn_R_101_FPN_1x.yaml">R101-FPN</a></td>
748
+ <td align="center">1x</td>
749
+ <td align="center">0.371</td>
750
+ <td align="center">0.114</td>
751
+ <td align="center">7.8</td>
752
+ <td align="center">25.6</td>
753
+ <td align="center">25.9</td>
754
+ <td align="center">144219035</td>
755
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/LVISv0.5-InstanceSegmentation/mask_rcnn_R_101_FPN_1x/144219035/model_final_824ab5.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/LVISv0.5-InstanceSegmentation/mask_rcnn_R_101_FPN_1x/144219035/metrics.json">metrics</a></td>
756
+ </tr>
757
+ <!-- ROW: mask_rcnn_X_101_32x8d_FPN_1x -->
758
+ <tr><td align="left"><a href="configs/LVISv0.5-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x.yaml">X101-FPN</a></td>
759
+ <td align="center">1x</td>
760
+ <td align="center">0.712</td>
761
+ <td align="center">0.151</td>
762
+ <td align="center">10.2</td>
763
+ <td align="center">26.7</td>
764
+ <td align="center">27.1</td>
765
+ <td align="center">144219108</td>
766
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/LVISv0.5-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x/144219108/model_final_5e3439.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/LVISv0.5-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_1x/144219108/metrics.json">metrics</a></td>
767
+ </tr>
768
+ </tbody></table>
769
+
770
+
771
+
772
+ ### Cityscapes & Pascal VOC Baselines
773
+
774
+ Simple baselines for
775
+ * Mask R-CNN on Cityscapes instance segmentation (initialized from COCO pre-training, then trained on Cityscapes fine annotations only)
776
+ * Faster R-CNN on PASCAL VOC object detection (trained on VOC 2007 train+val + VOC 2012 train+val, tested on VOC 2007 using 11-point interpolated AP)
777
+
778
+ <!--
779
+ ./gen_html_table.py --config 'Cityscapes/*' 'PascalVOC-Detection/*' --name "R50-FPN, Cityscapes" "R50-C4, VOC" --fields train_speed inference_speed mem box_AP box_AP50 mask_AP
780
+ -->
781
+
782
+
783
+ <table><tbody>
784
+ <!-- START TABLE -->
785
+ <!-- TABLE HEADER -->
786
+ <th valign="bottom">Name</th>
787
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
788
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
789
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
790
+ <th valign="bottom">box<br/>AP</th>
791
+ <th valign="bottom">box<br/>AP50</th>
792
+ <th valign="bottom">mask<br/>AP</th>
793
+ <th valign="bottom">model id</th>
794
+ <th valign="bottom">download</th>
795
+ <!-- TABLE BODY -->
796
+ <!-- ROW: mask_rcnn_R_50_FPN -->
797
+ <tr><td align="left"><a href="configs/Cityscapes/mask_rcnn_R_50_FPN.yaml">R50-FPN, Cityscapes</a></td>
798
+ <td align="center">0.240</td>
799
+ <td align="center">0.078</td>
800
+ <td align="center">4.4</td>
801
+ <td align="center"></td>
802
+ <td align="center"></td>
803
+ <td align="center">36.5</td>
804
+ <td align="center">142423278</td>
805
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Cityscapes/mask_rcnn_R_50_FPN/142423278/model_final_af9cf5.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Cityscapes/mask_rcnn_R_50_FPN/142423278/metrics.json">metrics</a></td>
806
+ </tr>
807
+ <!-- ROW: faster_rcnn_R_50_C4 -->
808
+ <tr><td align="left"><a href="configs/PascalVOC-Detection/faster_rcnn_R_50_C4.yaml">R50-C4, VOC</a></td>
809
+ <td align="center">0.537</td>
810
+ <td align="center">0.081</td>
811
+ <td align="center">4.8</td>
812
+ <td align="center">51.9</td>
813
+ <td align="center">80.3</td>
814
+ <td align="center"></td>
815
+ <td align="center">142202221</td>
816
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/PascalVOC-Detection/faster_rcnn_R_50_C4/142202221/model_final_b1acc2.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/PascalVOC-Detection/faster_rcnn_R_50_C4/142202221/metrics.json">metrics</a></td>
817
+ </tr>
818
+ </tbody></table>
819
+
820
+
821
+
822
+ ### Other Settings
823
+
824
+ Ablations for Deformable Conv and Cascade R-CNN:
825
+
826
+ <!--
827
+ ./gen_html_table.py --config 'COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml' 'Misc/*R_50_FPN_1x_dconv*' 'Misc/cascade*1x.yaml' 'COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml' 'Misc/*R_50_FPN_3x_dconv*' 'Misc/cascade*3x.yaml' --name "Baseline R50-FPN" "Deformable Conv" "Cascade R-CNN" "Baseline R50-FPN" "Deformable Conv" "Cascade R-CNN" --fields lr_sched train_speed inference_speed mem box_AP mask_AP
828
+ -->
829
+
830
+
831
+ <table><tbody>
832
+ <!-- START TABLE -->
833
+ <!-- TABLE HEADER -->
834
+ <th valign="bottom">Name</th>
835
+ <th valign="bottom">lr<br/>sched</th>
836
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
837
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
838
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
839
+ <th valign="bottom">box<br/>AP</th>
840
+ <th valign="bottom">mask<br/>AP</th>
841
+ <th valign="bottom">model id</th>
842
+ <th valign="bottom">download</th>
843
+ <!-- TABLE BODY -->
844
+ <!-- ROW: mask_rcnn_R_50_FPN_1x -->
845
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml">Baseline R50-FPN</a></td>
846
+ <td align="center">1x</td>
847
+ <td align="center">0.261</td>
848
+ <td align="center">0.043</td>
849
+ <td align="center">3.4</td>
850
+ <td align="center">38.6</td>
851
+ <td align="center">35.2</td>
852
+ <td align="center">137260431</td>
853
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/model_final_a54504.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/metrics.json">metrics</a></td>
854
+ </tr>
855
+ <!-- ROW: mask_rcnn_R_50_FPN_1x_dconv_c3-c5 -->
856
+ <tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5.yaml">Deformable Conv</a></td>
857
+ <td align="center">1x</td>
858
+ <td align="center">0.342</td>
859
+ <td align="center">0.048</td>
860
+ <td align="center">3.5</td>
861
+ <td align="center">41.5</td>
862
+ <td align="center">37.5</td>
863
+ <td align="center">138602867</td>
864
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5/138602867/model_final_65c703.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_1x_dconv_c3-c5/138602867/metrics.json">metrics</a></td>
865
+ </tr>
866
+ <!-- ROW: cascade_mask_rcnn_R_50_FPN_1x -->
867
+ <tr><td align="left"><a href="configs/Misc/cascade_mask_rcnn_R_50_FPN_1x.yaml">Cascade R-CNN</a></td>
868
+ <td align="center">1x</td>
869
+ <td align="center">0.317</td>
870
+ <td align="center">0.052</td>
871
+ <td align="center">4.0</td>
872
+ <td align="center">42.1</td>
873
+ <td align="center">36.4</td>
874
+ <td align="center">138602847</td>
875
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_1x/138602847/model_final_e9d89b.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_1x/138602847/metrics.json">metrics</a></td>
876
+ </tr>
877
+ <!-- ROW: mask_rcnn_R_50_FPN_3x -->
878
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml">Baseline R50-FPN</a></td>
879
+ <td align="center">3x</td>
880
+ <td align="center">0.261</td>
881
+ <td align="center">0.043</td>
882
+ <td align="center">3.4</td>
883
+ <td align="center">41.0</td>
884
+ <td align="center">37.2</td>
885
+ <td align="center">137849600</td>
886
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/metrics.json">metrics</a></td>
887
+ </tr>
888
+ <!-- ROW: mask_rcnn_R_50_FPN_3x_dconv_c3-c5 -->
889
+ <tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5.yaml">Deformable Conv</a></td>
890
+ <td align="center">3x</td>
891
+ <td align="center">0.349</td>
892
+ <td align="center">0.047</td>
893
+ <td align="center">3.5</td>
894
+ <td align="center">42.7</td>
895
+ <td align="center">38.5</td>
896
+ <td align="center">144998336</td>
897
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5/144998336/model_final_821d0b.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_dconv_c3-c5/144998336/metrics.json">metrics</a></td>
898
+ </tr>
899
+ <!-- ROW: cascade_mask_rcnn_R_50_FPN_3x -->
900
+ <tr><td align="left"><a href="configs/Misc/cascade_mask_rcnn_R_50_FPN_3x.yaml">Cascade R-CNN</a></td>
901
+ <td align="center">3x</td>
902
+ <td align="center">0.328</td>
903
+ <td align="center">0.053</td>
904
+ <td align="center">4.0</td>
905
+ <td align="center">44.3</td>
906
+ <td align="center">38.5</td>
907
+ <td align="center">144998488</td>
908
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_3x/144998488/model_final_480dd8.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_R_50_FPN_3x/144998488/metrics.json">metrics</a></td>
909
+ </tr>
910
+ </tbody></table>
911
+
912
+
913
+ Ablations for normalization methods, and a few models trained from scratch following [Rethinking ImageNet Pre-training](https://arxiv.org/abs/1811.08883).
914
+ (Note: The baseline uses `2fc` head while the others use [`4conv1fc` head](https://arxiv.org/abs/1803.08494))
915
+ <!--
916
+ ./gen_html_table.py --config 'COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml' 'Misc/mask*50_FPN_3x_gn.yaml' 'Misc/mask*50_FPN_3x_syncbn.yaml' 'Misc/scratch*' --name "Baseline R50-FPN" "GN" "SyncBN" "GN (from scratch)" "GN (from scratch)" "SyncBN (from scratch)" --fields lr_sched train_speed inference_speed mem box_AP mask_AP
917
+ -->
918
+
919
+
920
+ <table><tbody>
921
+ <!-- START TABLE -->
922
+ <!-- TABLE HEADER -->
923
+ <th valign="bottom">Name</th>
924
+ <th valign="bottom">lr<br/>sched</th>
925
+ <th valign="bottom">train<br/>time<br/>(s/iter)</th>
926
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
927
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
928
+ <th valign="bottom">box<br/>AP</th>
929
+ <th valign="bottom">mask<br/>AP</th>
930
+ <th valign="bottom">model id</th>
931
+ <th valign="bottom">download</th>
932
+ <!-- TABLE BODY -->
933
+ <!-- ROW: mask_rcnn_R_50_FPN_3x -->
934
+ <tr><td align="left"><a href="configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml">Baseline R50-FPN</a></td>
935
+ <td align="center">3x</td>
936
+ <td align="center">0.261</td>
937
+ <td align="center">0.043</td>
938
+ <td align="center">3.4</td>
939
+ <td align="center">41.0</td>
940
+ <td align="center">37.2</td>
941
+ <td align="center">137849600</td>
942
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/metrics.json">metrics</a></td>
943
+ </tr>
944
+ <!-- ROW: mask_rcnn_R_50_FPN_3x_gn -->
945
+ <tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_3x_gn.yaml">GN</a></td>
946
+ <td align="center">3x</td>
947
+ <td align="center">0.309</td>
948
+ <td align="center">0.060</td>
949
+ <td align="center">5.6</td>
950
+ <td align="center">42.6</td>
951
+ <td align="center">38.6</td>
952
+ <td align="center">138602888</td>
953
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_gn/138602888/model_final_dc5d9e.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_gn/138602888/metrics.json">metrics</a></td>
954
+ </tr>
955
+ <!-- ROW: mask_rcnn_R_50_FPN_3x_syncbn -->
956
+ <tr><td align="left"><a href="configs/Misc/mask_rcnn_R_50_FPN_3x_syncbn.yaml">SyncBN</a></td>
957
+ <td align="center">3x</td>
958
+ <td align="center">0.345</td>
959
+ <td align="center">0.053</td>
960
+ <td align="center">5.5</td>
961
+ <td align="center">41.9</td>
962
+ <td align="center">37.8</td>
963
+ <td align="center">169527823</td>
964
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_syncbn/169527823/model_final_3b3c51.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/mask_rcnn_R_50_FPN_3x_syncbn/169527823/metrics.json">metrics</a></td>
965
+ </tr>
966
+ <!-- ROW: scratch_mask_rcnn_R_50_FPN_3x_gn -->
967
+ <tr><td align="left"><a href="configs/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn.yaml">GN (from scratch)</a></td>
968
+ <td align="center">3x</td>
969
+ <td align="center">0.338</td>
970
+ <td align="center">0.061</td>
971
+ <td align="center">7.2</td>
972
+ <td align="center">39.9</td>
973
+ <td align="center">36.6</td>
974
+ <td align="center">138602908</td>
975
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn/138602908/model_final_01ca85.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn/138602908/metrics.json">metrics</a></td>
976
+ </tr>
977
+ <!-- ROW: scratch_mask_rcnn_R_50_FPN_9x_gn -->
978
+ <tr><td align="left"><a href="configs/Misc/scratch_mask_rcnn_R_50_FPN_9x_gn.yaml">GN (from scratch)</a></td>
979
+ <td align="center">9x</td>
980
+ <td align="center">N/A</td>
981
+ <td align="center">0.061</td>
982
+ <td align="center">7.2</td>
983
+ <td align="center">43.7</td>
984
+ <td align="center">39.6</td>
985
+ <td align="center">183808979</td>
986
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_9x_gn/183808979/model_final_da7b4c.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_9x_gn/183808979/metrics.json">metrics</a></td>
987
+ </tr>
988
+ <!-- ROW: scratch_mask_rcnn_R_50_FPN_9x_syncbn -->
989
+ <tr><td align="left"><a href="configs/Misc/scratch_mask_rcnn_R_50_FPN_9x_syncbn.yaml">SyncBN (from scratch)</a></td>
990
+ <td align="center">9x</td>
991
+ <td align="center">N/A</td>
992
+ <td align="center">0.055</td>
993
+ <td align="center">7.2</td>
994
+ <td align="center">43.6</td>
995
+ <td align="center">39.3</td>
996
+ <td align="center">184226666</td>
997
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_9x_syncbn/184226666/model_final_5ce33e.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/scratch_mask_rcnn_R_50_FPN_9x_syncbn/184226666/metrics.json">metrics</a></td>
998
+ </tr>
999
+ </tbody></table>
1000
+
1001
+
1002
+ A few very large models trained for a long time, for demo purposes. They are trained using multiple machines:
1003
+
1004
+ <!--
1005
+ ./gen_html_table.py --config 'Misc/panoptic_*dconv*' 'Misc/cascade_*152*' --name "Panoptic FPN R101" "Mask R-CNN X152" --fields inference_speed mem box_AP mask_AP PQ
1006
+ # manually add TTA results
1007
+ -->
1008
+
1009
+
1010
+ <table><tbody>
1011
+ <!-- START TABLE -->
1012
+ <!-- TABLE HEADER -->
1013
+ <th valign="bottom">Name</th>
1014
+ <th valign="bottom">inference<br/>time<br/>(s/im)</th>
1015
+ <th valign="bottom">train<br/>mem<br/>(GB)</th>
1016
+ <th valign="bottom">box<br/>AP</th>
1017
+ <th valign="bottom">mask<br/>AP</th>
1018
+ <th valign="bottom">PQ</th>
1019
+ <th valign="bottom">model id</th>
1020
+ <th valign="bottom">download</th>
1021
+ <!-- TABLE BODY -->
1022
+ <!-- ROW: panoptic_fpn_R_101_dconv_cascade_gn_3x -->
1023
+ <tr><td align="left"><a href="configs/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x.yaml">Panoptic FPN R101</a></td>
1024
+ <td align="center">0.098</td>
1025
+ <td align="center">11.4</td>
1026
+ <td align="center">47.4</td>
1027
+ <td align="center">41.3</td>
1028
+ <td align="center">46.1</td>
1029
+ <td align="center">139797668</td>
1030
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x/139797668/model_final_be35db.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/panoptic_fpn_R_101_dconv_cascade_gn_3x/139797668/metrics.json">metrics</a></td>
1031
+ </tr>
1032
+ <!-- ROW: cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv -->
1033
+ <tr><td align="left"><a href="configs/Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv.yaml">Mask R-CNN X152</a></td>
1034
+ <td align="center">0.234</td>
1035
+ <td align="center">15.1</td>
1036
+ <td align="center">50.2</td>
1037
+ <td align="center">44.0</td>
1038
+ <td align="center"></td>
1039
+ <td align="center">18131413</td>
1040
+ <td align="center"><a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv/18131413/model_0039999_e76410.pkl">model</a>&nbsp;|&nbsp;<a href="https://dl.fbaipublicfiles.com/detectron2/Misc/cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv/18131413/metrics.json">metrics</a></td>
1041
+ </tr>
1042
+ <!-- ROW: TTA cascade_mask_rcnn_X_152_32x8d_FPN_IN5k_gn_dconv -->
1043
+ <tr><td align="left">above + test-time aug.</td>
1044
+ <td align="center"></td>
1045
+ <td align="center"></td>
1046
+ <td align="center">51.9</td>
1047
+ <td align="center">45.9</td>
1048
+ <td align="center"></td>
1049
+ <td align="center"></td>
1050
+ <td align="center"></td>
1051
+ </tr>
1052
+ </tbody></table>
preprocess/detectron2/README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <img src=".github/Detectron2-Logo-Horz.svg" width="300" >
2
+
3
+ <a href="https://opensource.facebook.com/support-ukraine">
4
+ <img src="https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB" alt="Support Ukraine - Help Provide Humanitarian Aid to Ukraine." />
5
+ </a>
6
+
7
+ Detectron2 is Facebook AI Research's next generation library
8
+ that provides state-of-the-art detection and segmentation algorithms.
9
+ It is the successor of
10
+ [Detectron](https://github.com/facebookresearch/Detectron/)
11
+ and [maskrcnn-benchmark](https://github.com/facebookresearch/maskrcnn-benchmark/).
12
+ It supports a number of computer vision research projects and production applications in Facebook.
13
+
14
+ <div align="center">
15
+ <img src="https://user-images.githubusercontent.com/1381301/66535560-d3422200-eace-11e9-9123-5535d469db19.png"/>
16
+ </div>
17
+ <br>
18
+
19
+ ## Learn More about Detectron2
20
+
21
+ Explain Like I’m 5: Detectron2 | Using Machine Learning with Detectron2
22
+ :-------------------------:|:-------------------------:
23
+ [![Explain Like I’m 5: Detectron2](https://img.youtube.com/vi/1oq1Ye7dFqc/0.jpg)](https://www.youtube.com/watch?v=1oq1Ye7dFqc) | [![Using Machine Learning with Detectron2](https://img.youtube.com/vi/eUSgtfK4ivk/0.jpg)](https://www.youtube.com/watch?v=eUSgtfK4ivk)
24
+
25
+ ## What's New
26
+ * Includes new capabilities such as panoptic segmentation, Densepose, Cascade R-CNN, rotated bounding boxes, PointRend,
27
+ DeepLab, ViTDet, MViTv2 etc.
28
+ * Used as a library to support building [research projects](projects/) on top of it.
29
+ * Models can be exported to TorchScript format or Caffe2 format for deployment.
30
+ * It [trains much faster](https://detectron2.readthedocs.io/notes/benchmarks.html).
31
+
32
+ See our [blog post](https://ai.facebook.com/blog/-detectron2-a-pytorch-based-modular-object-detection-library-/)
33
+ to see more demos and learn about detectron2.
34
+
35
+ ## Installation
36
+
37
+ See [installation instructions](https://detectron2.readthedocs.io/tutorials/install.html).
38
+
39
+ ## Getting Started
40
+
41
+ See [Getting Started with Detectron2](https://detectron2.readthedocs.io/tutorials/getting_started.html),
42
+ and the [Colab Notebook](https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5)
43
+ to learn about basic usage.
44
+
45
+ Learn more at our [documentation](https://detectron2.readthedocs.org).
46
+ And see [projects/](projects/) for some projects that are built on top of detectron2.
47
+
48
+ ## Model Zoo and Baselines
49
+
50
+ We provide a large set of baseline results and trained models available for download in the [Detectron2 Model Zoo](MODEL_ZOO.md).
51
+
52
+ ## License
53
+
54
+ Detectron2 is released under the [Apache 2.0 license](LICENSE).
55
+
56
+ ## Citing Detectron2
57
+
58
+ If you use Detectron2 in your research or wish to refer to the baseline results published in the [Model Zoo](MODEL_ZOO.md), please use the following BibTeX entry.
59
+
60
+ ```BibTeX
61
+ @misc{wu2019detectron2,
62
+ author = {Yuxin Wu and Alexander Kirillov and Francisco Massa and
63
+ Wan-Yen Lo and Ross Girshick},
64
+ title = {Detectron2},
65
+ howpublished = {\url{https://github.com/facebookresearch/detectron2}},
66
+ year = {2019}
67
+ }
68
+ ```
preprocess/detectron2/configs/Base-RCNN-C4.yaml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MODEL:
2
+ META_ARCHITECTURE: "GeneralizedRCNN"
3
+ RPN:
4
+ PRE_NMS_TOPK_TEST: 6000
5
+ POST_NMS_TOPK_TEST: 1000
6
+ ROI_HEADS:
7
+ NAME: "Res5ROIHeads"
8
+ DATASETS:
9
+ TRAIN: ("coco_2017_train",)
10
+ TEST: ("coco_2017_val",)
11
+ SOLVER:
12
+ IMS_PER_BATCH: 16
13
+ BASE_LR: 0.02
14
+ STEPS: (60000, 80000)
15
+ MAX_ITER: 90000
16
+ INPUT:
17
+ MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
18
+ VERSION: 2
preprocess/detectron2/configs/Base-RCNN-DilatedC5.yaml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MODEL:
2
+ META_ARCHITECTURE: "GeneralizedRCNN"
3
+ RESNETS:
4
+ OUT_FEATURES: ["res5"]
5
+ RES5_DILATION: 2
6
+ RPN:
7
+ IN_FEATURES: ["res5"]
8
+ PRE_NMS_TOPK_TEST: 6000
9
+ POST_NMS_TOPK_TEST: 1000
10
+ ROI_HEADS:
11
+ NAME: "StandardROIHeads"
12
+ IN_FEATURES: ["res5"]
13
+ ROI_BOX_HEAD:
14
+ NAME: "FastRCNNConvFCHead"
15
+ NUM_FC: 2
16
+ POOLER_RESOLUTION: 7
17
+ ROI_MASK_HEAD:
18
+ NAME: "MaskRCNNConvUpsampleHead"
19
+ NUM_CONV: 4
20
+ POOLER_RESOLUTION: 14
21
+ DATASETS:
22
+ TRAIN: ("coco_2017_train",)
23
+ TEST: ("coco_2017_val",)
24
+ SOLVER:
25
+ IMS_PER_BATCH: 16
26
+ BASE_LR: 0.02
27
+ STEPS: (60000, 80000)
28
+ MAX_ITER: 90000
29
+ INPUT:
30
+ MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
31
+ VERSION: 2
preprocess/detectron2/configs/Base-RCNN-FPN.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MODEL:
2
+ META_ARCHITECTURE: "GeneralizedRCNN"
3
+ BACKBONE:
4
+ NAME: "build_resnet_fpn_backbone"
5
+ RESNETS:
6
+ OUT_FEATURES: ["res2", "res3", "res4", "res5"]
7
+ FPN:
8
+ IN_FEATURES: ["res2", "res3", "res4", "res5"]
9
+ ANCHOR_GENERATOR:
10
+ SIZES: [[32], [64], [128], [256], [512]] # One size for each in feature map
11
+ ASPECT_RATIOS: [[0.5, 1.0, 2.0]] # Three aspect ratios (same for all in feature maps)
12
+ RPN:
13
+ IN_FEATURES: ["p2", "p3", "p4", "p5", "p6"]
14
+ PRE_NMS_TOPK_TRAIN: 2000 # Per FPN level
15
+ PRE_NMS_TOPK_TEST: 1000 # Per FPN level
16
+ # Detectron1 uses 2000 proposals per-batch,
17
+ # (See "modeling/rpn/rpn_outputs.py" for details of this legacy issue)
18
+ # which is approximately 1000 proposals per-image since the default batch size for FPN is 2.
19
+ POST_NMS_TOPK_TRAIN: 1000
20
+ POST_NMS_TOPK_TEST: 1000
21
+ ROI_HEADS:
22
+ NAME: "StandardROIHeads"
23
+ IN_FEATURES: ["p2", "p3", "p4", "p5"]
24
+ ROI_BOX_HEAD:
25
+ NAME: "FastRCNNConvFCHead"
26
+ NUM_FC: 2
27
+ POOLER_RESOLUTION: 7
28
+ ROI_MASK_HEAD:
29
+ NAME: "MaskRCNNConvUpsampleHead"
30
+ NUM_CONV: 4
31
+ POOLER_RESOLUTION: 14
32
+ DATASETS:
33
+ TRAIN: ("coco_2017_train",)
34
+ TEST: ("coco_2017_val",)
35
+ SOLVER:
36
+ IMS_PER_BATCH: 16
37
+ BASE_LR: 0.02
38
+ STEPS: (60000, 80000)
39
+ MAX_ITER: 90000
40
+ INPUT:
41
+ MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
42
+ VERSION: 2
preprocess/detectron2/configs/Base-RetinaNet.yaml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MODEL:
2
+ META_ARCHITECTURE: "RetinaNet"
3
+ BACKBONE:
4
+ NAME: "build_retinanet_resnet_fpn_backbone"
5
+ RESNETS:
6
+ OUT_FEATURES: ["res3", "res4", "res5"]
7
+ ANCHOR_GENERATOR:
8
+ SIZES: !!python/object/apply:eval ["[[x, x * 2**(1.0/3), x * 2**(2.0/3) ] for x in [32, 64, 128, 256, 512 ]]"]
9
+ FPN:
10
+ IN_FEATURES: ["res3", "res4", "res5"]
11
+ RETINANET:
12
+ IOU_THRESHOLDS: [0.4, 0.5]
13
+ IOU_LABELS: [0, -1, 1]
14
+ SMOOTH_L1_LOSS_BETA: 0.0
15
+ DATASETS:
16
+ TRAIN: ("coco_2017_train",)
17
+ TEST: ("coco_2017_val",)
18
+ SOLVER:
19
+ IMS_PER_BATCH: 16
20
+ BASE_LR: 0.01 # Note that RetinaNet uses a different default learning rate
21
+ STEPS: (60000, 80000)
22
+ MAX_ITER: 90000
23
+ INPUT:
24
+ MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800)
25
+ VERSION: 2
preprocess/detectron2/configs/COCO-Detection/fast_rcnn_R_50_FPN_1x.yaml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-FPN.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
4
+ MASK_ON: False
5
+ LOAD_PROPOSALS: True
6
+ RESNETS:
7
+ DEPTH: 50
8
+ PROPOSAL_GENERATOR:
9
+ NAME: "PrecomputedProposals"
10
+ DATASETS:
11
+ TRAIN: ("coco_2017_train",)
12
+ PROPOSAL_FILES_TRAIN: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_train_box_proposals_21bc3a.pkl", )
13
+ TEST: ("coco_2017_val",)
14
+ PROPOSAL_FILES_TEST: ("detectron2://COCO-Detection/rpn_R_50_FPN_1x/137258492/coco_2017_val_box_proposals_ee0dad.pkl", )
15
+ DATALOADER:
16
+ # proposals are part of the dataset_dicts, and take a lot of RAM
17
+ NUM_WORKERS: 2
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_101_C4_3x.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-C4.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 101
7
+ SOLVER:
8
+ STEPS: (210000, 250000)
9
+ MAX_ITER: 270000
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_101_DC5_3x.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-DilatedC5.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 101
7
+ SOLVER:
8
+ STEPS: (210000, 250000)
9
+ MAX_ITER: 270000
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-FPN.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 101
7
+ SOLVER:
8
+ STEPS: (210000, 250000)
9
+ MAX_ITER: 270000
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_C4_1x.yaml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-C4.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 50
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_C4_3x.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-C4.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 50
7
+ SOLVER:
8
+ STEPS: (210000, 250000)
9
+ MAX_ITER: 270000
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_DC5_1x.yaml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-DilatedC5.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 50
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_DC5_3x.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-DilatedC5.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 50
7
+ SOLVER:
8
+ STEPS: (210000, 250000)
9
+ MAX_ITER: 270000
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_FPN_1x.yaml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-FPN.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 50
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-FPN.yaml"
2
+ MODEL:
3
+ WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
4
+ MASK_ON: False
5
+ RESNETS:
6
+ DEPTH: 50
7
+ SOLVER:
8
+ STEPS: (210000, 250000)
9
+ MAX_ITER: 270000
preprocess/detectron2/configs/COCO-Detection/faster_rcnn_X_101_32x8d_FPN_3x.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _BASE_: "../Base-RCNN-FPN.yaml"
2
+ MODEL:
3
+ MASK_ON: False
4
+ WEIGHTS: "detectron2://ImageNetPretrained/FAIR/X-101-32x8d.pkl"
5
+ PIXEL_STD: [57.375, 57.120, 58.395]
6
+ RESNETS:
7
+ STRIDE_IN_1X1: False # this is a C2 model
8
+ NUM_GROUPS: 32
9
+ WIDTH_PER_GROUP: 8
10
+ DEPTH: 101
11
+ SOLVER:
12
+ STEPS: (210000, 250000)
13
+ MAX_ITER: 270000
preprocess/detectron2/configs/COCO-Detection/fcos_R_50_FPN_1x.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ..common.optim import SGD as optimizer
2
+ from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier
3
+ from ..common.data.coco import dataloader
4
+ from ..common.models.fcos import model
5
+ from ..common.train import train
6
+
7
+ dataloader.train.mapper.use_instance_mask = False
8
+ optimizer.lr = 0.01
9
+
10
+ model.backbone.bottom_up.freeze_at = 2
11
+ train.init_checkpoint = "detectron2://ImageNetPretrained/MSRA/R-50.pkl"