TLMHoang commited on
Commit
d77508d
·
verified ·
1 Parent(s): e173221

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +4 -0
  2. mmdet_code/.gitignore +134 -0
  3. mmdet_code/SR-TOD/CITATION.cff +8 -0
  4. mmdet_code/SR-TOD/LICENSE +203 -0
  5. mmdet_code/SR-TOD/MANIFEST.in +7 -0
  6. mmdet_code/SR-TOD/README.md +59 -0
  7. mmdet_code/SR-TOD/configs/_base_/default_runtime.py +25 -0
  8. mmdet_code/SR-TOD/configs/_base_/models/cascade-mask-rcnn_r50_fpn.py +203 -0
  9. mmdet_code/SR-TOD/configs/_base_/models/cascade-rcnn_r50_fpn.py +280 -0
  10. mmdet_code/SR-TOD/configs/_base_/models/fast-rcnn_r50_fpn.py +68 -0
  11. mmdet_code/SR-TOD/configs/_base_/models/faster-rcnn_r50-caffe-c4.py +123 -0
  12. mmdet_code/SR-TOD/configs/_base_/models/faster-rcnn_r50-caffe-dc5.py +111 -0
  13. mmdet_code/SR-TOD/configs/_base_/models/faster-rcnn_r50_fpn.py +168 -0
  14. mmdet_code/SR-TOD/configs/_base_/models/mask-rcnn_r50-caffe-c4.py +132 -0
  15. mmdet_code/SR-TOD/configs/_base_/models/mask-rcnn_r50_fpn.py +127 -0
  16. mmdet_code/SR-TOD/configs/_base_/models/retinanet_r50_fpn copy.py +68 -0
  17. mmdet_code/SR-TOD/configs/_base_/models/retinanet_r50_fpn.py +78 -0
  18. mmdet_code/SR-TOD/configs/_base_/models/rpn_r50-caffe-c4.py +64 -0
  19. mmdet_code/SR-TOD/configs/_base_/models/rpn_r50_fpn.py +64 -0
  20. mmdet_code/SR-TOD/configs/_base_/models/ssd300.py +63 -0
  21. mmdet_code/SR-TOD/configs/_base_/schedules/schedule_1x.py +30 -0
  22. mmdet_code/SR-TOD/configs/_base_/schedules/schedule_20e.py +30 -0
  23. mmdet_code/SR-TOD/configs/_base_/schedules/schedule_2x.py +28 -0
  24. mmdet_code/SR-TOD/configs/albu_example/README.md +31 -0
  25. mmdet_code/SR-TOD/configs/albu_example/mask-rcnn_r50_fpn_albu-1x_coco.py +66 -0
  26. mmdet_code/SR-TOD/configs/albu_example/metafile.yml +17 -0
  27. mmdet_code/SR-TOD/configs/atss/README.md +31 -0
  28. mmdet_code/SR-TOD/configs/atss/atss_r101_fpn_1x_coco.py +19 -0
  29. mmdet_code/SR-TOD/configs/atss/atss_r101_fpn_8xb8-amp-lsj-200e_coco.py +7 -0
  30. mmdet_code/SR-TOD/configs/atss/atss_r18_fpn_8xb8-amp-lsj-200e_coco.py +7 -0
  31. mmdet_code/SR-TOD/configs/atss/atss_r50_fpn_1x_coco.py +80 -0
  32. mmdet_code/SR-TOD/configs/atss/atss_r50_fpn_8xb8-amp-lsj-200e_coco.py +81 -0
  33. mmdet_code/SR-TOD/configs/atss/metafile.yml +60 -0
  34. mmdet_code/SR-TOD/configs/autoassign/README.md +35 -0
  35. mmdet_code/SR-TOD/configs/autoassign/autoassign_r50-caffe_fpn_1x_coco.py +69 -0
  36. mmdet_code/SR-TOD/configs/autoassign/metafile.yml +33 -0
  37. mmdet_code/SR-TOD/configs/boxinst/README.md +32 -0
  38. mmdet_code/SR-TOD/configs/boxinst/boxinst_r101_fpn_ms-90k_coco.py +8 -0
  39. mmdet_code/SR-TOD/configs/boxinst/boxinst_r50_fpn_ms-90k_coco.py +93 -0
  40. mmdet_code/SR-TOD/configs/boxinst/metafile.yml +52 -0
  41. mmdet_code/SR-TOD/configs/bytetrack/README.md +132 -0
  42. mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-80e_crowdhuman-mot17halftrain_test-mot17halfval.py +249 -0
  43. mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-80e_crowdhuman-mot20train_test-mot20test.py +127 -0
  44. mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py +9 -0
  45. mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17test.py +17 -0
  46. mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test.py +8 -0
  47. mmdet_code/SR-TOD/configs/bytetrack/metafile.yml +53 -0
  48. mmdet_code/SR-TOD/configs/bytetrack/yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py +6 -0
  49. mmdet_code/SR-TOD/configs/carafe/README.md +42 -0
  50. mmdet_code/SR-TOD/configs/carafe/faster-rcnn_r50_fpn-carafe_1x_coco.py +20 -0
.gitattributes CHANGED
@@ -62,3 +62,7 @@ models_related/SR-TOD/demo/MMDet_InstanceSeg_Tutorial.ipynb filter=lfs diff=lfs
62
  models_related/SR-TOD/demo/MMDet_Tutorial.ipynb filter=lfs diff=lfs merge=lfs -text
63
  models_related/mmcv-2.1.0-cp311-cp311-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
64
  models_related/mmdetection/demo/MMDet_Tutorial.ipynb filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
62
  models_related/SR-TOD/demo/MMDet_Tutorial.ipynb filter=lfs diff=lfs merge=lfs -text
63
  models_related/mmcv-2.1.0-cp311-cp311-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
64
  models_related/mmdetection/demo/MMDet_Tutorial.ipynb filter=lfs diff=lfs merge=lfs -text
65
+ mmdet_code/SR-TOD/demo/MMDet_InstanceSeg_Tutorial.ipynb filter=lfs diff=lfs merge=lfs -text
66
+ mmdet_code/SR-TOD/demo/MMDet_Tutorial.ipynb filter=lfs diff=lfs merge=lfs -text
67
+ mmdet_code/mmcv-2.1.0-cp311-cp311-linux_x86_64.whl filter=lfs diff=lfs merge=lfs -text
68
+ mmdet_code/mmdetection/demo/MMDet_Tutorial.ipynb filter=lfs diff=lfs merge=lfs -text
mmdet_code/.gitignore ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ .hypothesis/
48
+ .pytest_cache/
49
+
50
+ # Translations
51
+ *.mo
52
+ *.pot
53
+
54
+ # Django stuff:
55
+ *.log
56
+ local_settings.py
57
+ db.sqlite3
58
+
59
+ # Flask stuff:
60
+ instance/
61
+ .webassets-cache
62
+
63
+ # Scrapy stuff:
64
+ .scrapy
65
+
66
+ # Sphinx documentation
67
+ docs/en/_build/
68
+ docs/zh_cn/_build/
69
+
70
+ # PyBuilder
71
+ target/
72
+
73
+ # Jupyter Notebook
74
+ .ipynb_checkpoints
75
+
76
+ # pyenv
77
+ .python-version
78
+
79
+ # celery beat schedule file
80
+ celerybeat-schedule
81
+
82
+ # SageMath parsed files
83
+ *.sage.py
84
+
85
+ # Environments
86
+ .env
87
+ .venv
88
+ env/
89
+ venv/
90
+ ENV/
91
+ env.bak/
92
+ venv.bak/
93
+
94
+ # Spyder project settings
95
+ .spyderproject
96
+ .spyproject
97
+
98
+ # Rope project settings
99
+ .ropeproject
100
+
101
+ # mkdocs documentation
102
+ /site
103
+
104
+ # mypy
105
+ .mypy_cache/
106
+ data/
107
+ data
108
+ .vscode
109
+ .idea
110
+ .DS_Store
111
+
112
+ # custom
113
+ *.pkl
114
+ *.pkl.json
115
+ *.log.json
116
+ docs/modelzoo_statistics.md
117
+ mmdet/.mim
118
+ work_dirs/
119
+
120
+ # Pytorch
121
+ *.pth
122
+ *.py~
123
+ *.sh~
124
+
125
+ data/
126
+ .venv*/
127
+ # mmdetection/
128
+ *understand*/
129
+ hf_runs/
130
+ LevirShipData/
131
+ varroa*/
132
+ upload_data*.py
133
+ hf_results/
134
+ docs/
mmdet_code/SR-TOD/CITATION.cff ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ authors:
4
+ - name: "MMDetection Contributors"
5
+ title: "OpenMMLab Detection Toolbox and Benchmark"
6
+ date-released: 2018-08-22
7
+ url: "https://github.com/open-mmlab/mmdetection"
8
+ license: Apache-2.0
mmdet_code/SR-TOD/LICENSE ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright 2018-2023 OpenMMLab. All rights reserved.
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright 2018-2023 OpenMMLab.
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
mmdet_code/SR-TOD/MANIFEST.in ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ include requirements/*.txt
2
+ include mmdet/VERSION
3
+ include mmdet/.mim/model-index.yml
4
+ include mmdet/.mim/dataset-index.yml
5
+ include mmdet/.mim/demo/*/*
6
+ recursive-include mmdet/.mim/configs *.py *.yml
7
+ recursive-include mmdet/.mim/tools *.sh *.py
mmdet_code/SR-TOD/README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SR-TOD
2
+
3
+ # Introduce
4
+
5
+ This is the official code for the paper Visible and Clear: Finding Tiny Objects in Difference Map.
6
+
7
+ The link to the paper is https://arxiv.org/abs/2405.11276.
8
+
9
+ This project is built based on mmdetection 3.1 and mmcv 2.0.1.
10
+
11
+ **NOTE: Our paper has been accepted by ECCV 2024.**
12
+
13
+ # Environment
14
+
15
+ pytorch 1.12.0
16
+
17
+ torchvision 0.13.0
18
+
19
+ mmdetection 3.1
20
+
21
+ mmcv 2.0.1
22
+
23
+ The installation and usage of mmdetection can be referred to at the following link: https://mmdetection.readthedocs.io/en/latest/get_started.html.
24
+
25
+ To use the AI-TOD evaluation metrics, you need to download aitodpycocotools. You can install it using the following command:
26
+
27
+ ```shell
28
+ pip install "git+https://github.com/jwwangchn/cocoapi-aitod.git#subdirectory=aitodpycocotools"
29
+ ```
30
+
31
+ For other environment requirements, please refer to mmdetection.
32
+
33
+
34
+ # Training and Test
35
+ The training and test commands can also be referenced from mmdetection.
36
+
37
+ 1 gpu:
38
+
39
+ ```shell
40
+ python tools/train.py ./srtod_project/srtod_cascade_rcnn/config/srtod-cascade-rcnn_r50_fpn_1x_coco.py
41
+ ```
42
+ ```shell
43
+ python tools/test.py ./srtod_project/srtod_cascade_rcnn/config/srtod-cascade-rcnn_r50_fpn_1x_coco.py your_model.pth
44
+ ```
45
+
46
+ If you need to use more GPUs, you should use ./tools/dist_train.sh instead of tools/train.py.
47
+
48
+ # DroneSwarms
49
+ If you want to access the DroneSwarms dataset, please visit the following link:[DroneSwarms](https://hiyuur.github.io)
50
+
51
+ # Reference
52
+ ```shell
53
+ @article{cao2024visible,
54
+ title={Visible and Clear: Finding Tiny Objects in Difference Map},
55
+ author={Cao, Bing and Yao, Haiyu and Zhu, Pengfei and Hu, Qinghua},
56
+ journal={arXiv preprint arXiv:2405.11276},
57
+ year={2024}
58
+ }
59
+ ```
mmdet_code/SR-TOD/configs/_base_/default_runtime.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ default_scope = 'mmdet'
2
+
3
+ default_hooks = dict(
4
+ timer=dict(type='IterTimerHook'),
5
+ logger=dict(type='LoggerHook', interval=50),
6
+ param_scheduler=dict(type='ParamSchedulerHook'),
7
+ checkpoint=dict(type='CheckpointHook', interval=1),
8
+ sampler_seed=dict(type='DistSamplerSeedHook'),
9
+ visualization=dict(type='DetVisualizationHook'))
10
+
11
+ env_cfg = dict(
12
+ cudnn_benchmark=False,
13
+ mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
14
+ dist_cfg=dict(backend='nccl'),
15
+ )
16
+
17
+ vis_backends = [dict(type='LocalVisBackend')]
18
+ visualizer = dict(
19
+ type='DetLocalVisualizer', vis_backends=vis_backends, name='visualizer', save_dir="/root/nas-public-linkdata/mmdet/public_result/vis/1/")
20
+ log_processor = dict(type='LogProcessor', window_size=50, by_epoch=True)
21
+
22
+ log_level = 'INFO'
23
+ load_from = None
24
+ resume = False
25
+ #find_unused_parameters = True
mmdet_code/SR-TOD/configs/_base_/models/cascade-mask-rcnn_r50_fpn.py ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='CascadeRCNN',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_mask=True,
10
+ pad_size_divisor=32),
11
+ backbone=dict(
12
+ type='ResNet',
13
+ depth=50,
14
+ num_stages=4,
15
+ out_indices=(0, 1, 2, 3),
16
+ frozen_stages=1,
17
+ norm_cfg=dict(type='BN', requires_grad=True),
18
+ norm_eval=True,
19
+ style='pytorch',
20
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
21
+ neck=dict(
22
+ type='FPN',
23
+ in_channels=[256, 512, 1024, 2048],
24
+ out_channels=256,
25
+ num_outs=5),
26
+ rpn_head=dict(
27
+ type='RPNHead',
28
+ in_channels=256,
29
+ feat_channels=256,
30
+ anchor_generator=dict(
31
+ type='AnchorGenerator',
32
+ scales=[8],
33
+ ratios=[0.5, 1.0, 2.0],
34
+ strides=[4, 8, 16, 32, 64]),
35
+ bbox_coder=dict(
36
+ type='DeltaXYWHBBoxCoder',
37
+ target_means=[.0, .0, .0, .0],
38
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
39
+ loss_cls=dict(
40
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
41
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0)),
42
+ roi_head=dict(
43
+ type='CascadeRoIHead',
44
+ num_stages=3,
45
+ stage_loss_weights=[1, 0.5, 0.25],
46
+ bbox_roi_extractor=dict(
47
+ type='SingleRoIExtractor',
48
+ roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
49
+ out_channels=256,
50
+ featmap_strides=[4, 8, 16, 32]),
51
+ bbox_head=[
52
+ dict(
53
+ type='Shared2FCBBoxHead',
54
+ in_channels=256,
55
+ fc_out_channels=1024,
56
+ roi_feat_size=7,
57
+ num_classes=80,
58
+ bbox_coder=dict(
59
+ type='DeltaXYWHBBoxCoder',
60
+ target_means=[0., 0., 0., 0.],
61
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
62
+ reg_class_agnostic=True,
63
+ loss_cls=dict(
64
+ type='CrossEntropyLoss',
65
+ use_sigmoid=False,
66
+ loss_weight=1.0),
67
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
68
+ loss_weight=1.0)),
69
+ dict(
70
+ type='Shared2FCBBoxHead',
71
+ in_channels=256,
72
+ fc_out_channels=1024,
73
+ roi_feat_size=7,
74
+ num_classes=80,
75
+ bbox_coder=dict(
76
+ type='DeltaXYWHBBoxCoder',
77
+ target_means=[0., 0., 0., 0.],
78
+ target_stds=[0.05, 0.05, 0.1, 0.1]),
79
+ reg_class_agnostic=True,
80
+ loss_cls=dict(
81
+ type='CrossEntropyLoss',
82
+ use_sigmoid=False,
83
+ loss_weight=1.0),
84
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
85
+ loss_weight=1.0)),
86
+ dict(
87
+ type='Shared2FCBBoxHead',
88
+ in_channels=256,
89
+ fc_out_channels=1024,
90
+ roi_feat_size=7,
91
+ num_classes=80,
92
+ bbox_coder=dict(
93
+ type='DeltaXYWHBBoxCoder',
94
+ target_means=[0., 0., 0., 0.],
95
+ target_stds=[0.033, 0.033, 0.067, 0.067]),
96
+ reg_class_agnostic=True,
97
+ loss_cls=dict(
98
+ type='CrossEntropyLoss',
99
+ use_sigmoid=False,
100
+ loss_weight=1.0),
101
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))
102
+ ],
103
+ mask_roi_extractor=dict(
104
+ type='SingleRoIExtractor',
105
+ roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
106
+ out_channels=256,
107
+ featmap_strides=[4, 8, 16, 32]),
108
+ mask_head=dict(
109
+ type='FCNMaskHead',
110
+ num_convs=4,
111
+ in_channels=256,
112
+ conv_out_channels=256,
113
+ num_classes=80,
114
+ loss_mask=dict(
115
+ type='CrossEntropyLoss', use_mask=True, loss_weight=1.0))),
116
+ # model training and testing settings
117
+ train_cfg=dict(
118
+ rpn=dict(
119
+ assigner=dict(
120
+ type='MaxIoUAssigner',
121
+ pos_iou_thr=0.7,
122
+ neg_iou_thr=0.3,
123
+ min_pos_iou=0.3,
124
+ match_low_quality=True,
125
+ ignore_iof_thr=-1),
126
+ sampler=dict(
127
+ type='RandomSampler',
128
+ num=256,
129
+ pos_fraction=0.5,
130
+ neg_pos_ub=-1,
131
+ add_gt_as_proposals=False),
132
+ allowed_border=0,
133
+ pos_weight=-1,
134
+ debug=False),
135
+ rpn_proposal=dict(
136
+ nms_pre=2000,
137
+ max_per_img=2000,
138
+ nms=dict(type='nms', iou_threshold=0.7),
139
+ min_bbox_size=0),
140
+ rcnn=[
141
+ dict(
142
+ assigner=dict(
143
+ type='MaxIoUAssigner',
144
+ pos_iou_thr=0.5,
145
+ neg_iou_thr=0.5,
146
+ min_pos_iou=0.5,
147
+ match_low_quality=False,
148
+ ignore_iof_thr=-1),
149
+ sampler=dict(
150
+ type='RandomSampler',
151
+ num=512,
152
+ pos_fraction=0.25,
153
+ neg_pos_ub=-1,
154
+ add_gt_as_proposals=True),
155
+ mask_size=28,
156
+ pos_weight=-1,
157
+ debug=False),
158
+ dict(
159
+ assigner=dict(
160
+ type='MaxIoUAssigner',
161
+ pos_iou_thr=0.6,
162
+ neg_iou_thr=0.6,
163
+ min_pos_iou=0.6,
164
+ match_low_quality=False,
165
+ ignore_iof_thr=-1),
166
+ sampler=dict(
167
+ type='RandomSampler',
168
+ num=512,
169
+ pos_fraction=0.25,
170
+ neg_pos_ub=-1,
171
+ add_gt_as_proposals=True),
172
+ mask_size=28,
173
+ pos_weight=-1,
174
+ debug=False),
175
+ dict(
176
+ assigner=dict(
177
+ type='MaxIoUAssigner',
178
+ pos_iou_thr=0.7,
179
+ neg_iou_thr=0.7,
180
+ min_pos_iou=0.7,
181
+ match_low_quality=False,
182
+ ignore_iof_thr=-1),
183
+ sampler=dict(
184
+ type='RandomSampler',
185
+ num=512,
186
+ pos_fraction=0.25,
187
+ neg_pos_ub=-1,
188
+ add_gt_as_proposals=True),
189
+ mask_size=28,
190
+ pos_weight=-1,
191
+ debug=False)
192
+ ]),
193
+ test_cfg=dict(
194
+ rpn=dict(
195
+ nms_pre=1000,
196
+ max_per_img=1000,
197
+ nms=dict(type='nms', iou_threshold=0.7),
198
+ min_bbox_size=0),
199
+ rcnn=dict(
200
+ score_thr=0.05,
201
+ nms=dict(type='nms', iou_threshold=0.5),
202
+ max_per_img=100,
203
+ mask_thr_binary=0.5)))
mmdet_code/SR-TOD/configs/_base_/models/cascade-rcnn_r50_fpn.py ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='CascadeRCNN',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_size_divisor=32),
10
+ backbone=dict(
11
+ type='ResNet',
12
+ depth=50,
13
+ num_stages=4,
14
+ out_indices=(0, 1, 2, 3),
15
+ frozen_stages=1,
16
+ norm_cfg=dict(type='BN', requires_grad=True),
17
+ norm_eval=True,
18
+ style='pytorch',
19
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
20
+ neck=dict(
21
+ type='FPN',
22
+ in_channels=[256, 512, 1024, 2048],
23
+ out_channels=256,
24
+ num_outs=5),
25
+ rpn_head=dict(
26
+ type='RPNHead',
27
+ in_channels=256,
28
+ feat_channels=256,
29
+ anchor_generator=dict(
30
+ type='AnchorGenerator',
31
+ scales=[8], #[8]
32
+ ratios=[0.5, 1.0, 2.0],
33
+ strides=[4, 8, 16, 32, 64]),
34
+ bbox_coder=dict(
35
+ type='DeltaXYWHBBoxCoder',
36
+ target_means=[.0, .0, .0, .0],
37
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
38
+ loss_cls=dict(
39
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
40
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0)),
41
+ roi_head=dict(
42
+ type='CascadeRoIHead',
43
+ num_stages=3,
44
+ stage_loss_weights=[1, 0.5, 0.25],
45
+ bbox_roi_extractor=dict(
46
+ type='SingleRoIExtractor',
47
+ roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
48
+ out_channels=256,
49
+ featmap_strides=[4, 8, 16, 32]),
50
+ bbox_head=[
51
+ dict(
52
+ type='Shared2FCBBoxHead',
53
+ in_channels=256,
54
+ fc_out_channels=1024,
55
+ roi_feat_size=7,
56
+ num_classes=10,
57
+ bbox_coder=dict(
58
+ type='DeltaXYWHBBoxCoder',
59
+ target_means=[0., 0., 0., 0.],
60
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
61
+ reg_class_agnostic=True,
62
+ loss_cls=dict(
63
+ type='CrossEntropyLoss',
64
+ use_sigmoid=False,
65
+ loss_weight=1.0),
66
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
67
+ loss_weight=1.0)),
68
+ dict(
69
+ type='Shared2FCBBoxHead',
70
+ in_channels=256,
71
+ fc_out_channels=1024,
72
+ roi_feat_size=7,
73
+ num_classes=10,
74
+ bbox_coder=dict(
75
+ type='DeltaXYWHBBoxCoder',
76
+ target_means=[0., 0., 0., 0.],
77
+ target_stds=[0.05, 0.05, 0.1, 0.1]),
78
+ reg_class_agnostic=True,
79
+ loss_cls=dict(
80
+ type='CrossEntropyLoss',
81
+ use_sigmoid=False,
82
+ loss_weight=1.0),
83
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
84
+ loss_weight=1.0)),
85
+ dict(
86
+ type='Shared2FCBBoxHead',
87
+ in_channels=256,
88
+ fc_out_channels=1024,
89
+ roi_feat_size=7,
90
+ num_classes=10,
91
+ bbox_coder=dict(
92
+ type='DeltaXYWHBBoxCoder',
93
+ target_means=[0., 0., 0., 0.],
94
+ target_stds=[0.033, 0.033, 0.067, 0.067]),
95
+ reg_class_agnostic=True,
96
+ loss_cls=dict(
97
+ type='CrossEntropyLoss',
98
+ use_sigmoid=False,
99
+ loss_weight=1.0),
100
+ loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))
101
+ ]),
102
+ # model training and testing settings
103
+ # train_cfg=dict(
104
+ # rpn=dict(
105
+ # assigner=dict(
106
+ # type='MaxIoUAssigner',
107
+ # pos_iou_thr=0.7,
108
+ # neg_iou_thr=0.3,
109
+ # min_pos_iou=0.3,
110
+ # match_low_quality=True,
111
+ # ignore_iof_thr=-1),
112
+ # sampler=dict(
113
+ # type='RandomSampler',
114
+ # num=256,
115
+ # pos_fraction=0.5,
116
+ # neg_pos_ub=-1,
117
+ # add_gt_as_proposals=False),
118
+ # allowed_border=0,
119
+ # pos_weight=-1,
120
+ # debug=False),
121
+ # rpn_proposal=dict(
122
+ # nms_pre=2000,
123
+ # max_per_img=2000,
124
+ # nms=dict(type='nms', iou_threshold=0.7),
125
+ # min_bbox_size=0),
126
+ # rcnn=[
127
+ # dict(
128
+ # assigner=dict(
129
+ # type='MaxIoUAssigner',
130
+ # pos_iou_thr=0.5,
131
+ # neg_iou_thr=0.5,
132
+ # min_pos_iou=0.5,
133
+ # match_low_quality=False,
134
+ # ignore_iof_thr=-1),
135
+ # sampler=dict(
136
+ # type='RandomSampler',
137
+ # num=512,
138
+ # pos_fraction=0.25,
139
+ # neg_pos_ub=-1,
140
+ # add_gt_as_proposals=True),
141
+ # pos_weight=-1,
142
+ # debug=False),
143
+ # dict(
144
+ # assigner=dict(
145
+ # type='MaxIoUAssigner',
146
+ # pos_iou_thr=0.6,
147
+ # neg_iou_thr=0.6,
148
+ # min_pos_iou=0.6,
149
+ # match_low_quality=False,
150
+ # ignore_iof_thr=-1),
151
+ # sampler=dict(
152
+ # type='RandomSampler',
153
+ # num=512,
154
+ # pos_fraction=0.25,
155
+ # neg_pos_ub=-1,
156
+ # add_gt_as_proposals=True),
157
+ # pos_weight=-1,
158
+ # debug=False),
159
+ # dict(
160
+ # assigner=dict(
161
+ # type='MaxIoUAssigner',
162
+ # pos_iou_thr=0.7,
163
+ # neg_iou_thr=0.7,
164
+ # min_pos_iou=0.7,
165
+ # match_low_quality=False,
166
+ # ignore_iof_thr=-1),
167
+ # sampler=dict(
168
+ # type='RandomSampler',
169
+ # num=512,
170
+ # pos_fraction=0.25,
171
+ # neg_pos_ub=-1,
172
+ # add_gt_as_proposals=True),
173
+ # pos_weight=-1,
174
+ # debug=False)
175
+ # ]),
176
+ # test_cfg=dict(
177
+ # rpn=dict(
178
+ # nms_pre=1000,
179
+ # max_per_img=1000,
180
+ # nms=dict(type='nms', iou_threshold=0.7),
181
+ # min_bbox_size=0),
182
+ # rcnn=dict(
183
+ # score_thr=0.05,
184
+ # nms=dict(type='nms', iou_threshold=0.5),
185
+ # max_per_img=100)))
186
+ train_cfg=dict(
187
+ rpn=dict(
188
+ assigner=dict(
189
+ type='MaxIoUAssigner',
190
+ pos_iou_thr=0.7,
191
+ neg_iou_thr=0.3,
192
+ min_pos_iou=0.3,
193
+ match_low_quality=True,
194
+ ignore_iof_thr=-1),
195
+ sampler=dict(
196
+ type='RandomSampler',
197
+ num=256,
198
+ pos_fraction=0.5,
199
+ neg_pos_ub=-1,
200
+ add_gt_as_proposals=False),
201
+ allowed_border=0,
202
+ pos_weight=-1,
203
+ debug=False),
204
+ rpn_proposal=dict(
205
+ nms_pre=3000,
206
+ max_per_img=3000,
207
+ nms=dict(type='nms', iou_threshold=0.7),
208
+ min_bbox_size=0),
209
+ rcnn=[
210
+ dict(
211
+ assigner=dict(
212
+ type='MaxIoUAssigner',
213
+ pos_iou_thr=0.5,
214
+ neg_iou_thr=0.5,
215
+ min_pos_iou=0.5,
216
+ match_low_quality=False,
217
+ ignore_iof_thr=-1),
218
+ sampler=dict(
219
+ type='RandomSampler',
220
+ num=512,
221
+ pos_fraction=0.25,
222
+ neg_pos_ub=-1,
223
+ add_gt_as_proposals=True),
224
+ pos_weight=-1,
225
+ debug=False),
226
+ dict(
227
+ assigner=dict(
228
+ type='MaxIoUAssigner',
229
+ pos_iou_thr=0.6,
230
+ neg_iou_thr=0.6,
231
+ min_pos_iou=0.6,
232
+ match_low_quality=False,
233
+ ignore_iof_thr=-1),
234
+ sampler=dict(
235
+ type='RandomSampler',
236
+ num=512,
237
+ pos_fraction=0.25,
238
+ neg_pos_ub=-1,
239
+ add_gt_as_proposals=True),
240
+ pos_weight=-1,
241
+ debug=False),
242
+ dict(
243
+ assigner=dict(
244
+ type='MaxIoUAssigner',
245
+ pos_iou_thr=0.7,
246
+ neg_iou_thr=0.7,
247
+ min_pos_iou=0.7,
248
+ match_low_quality=False,
249
+ ignore_iof_thr=-1),
250
+ sampler=dict(
251
+ type='RandomSampler',
252
+ num=512,
253
+ pos_fraction=0.25,
254
+ neg_pos_ub=-1,
255
+ add_gt_as_proposals=True),
256
+ pos_weight=-1,
257
+ debug=False)
258
+ ]),
259
+ test_cfg=dict(
260
+ rpn=dict(
261
+ nms_pre=3000,
262
+ max_per_img=3000,
263
+ nms=dict(type='nms', iou_threshold=0.7),
264
+ min_bbox_size=0),
265
+ rcnn=dict(
266
+ score_thr=0.05,
267
+ nms=dict(type='nms', iou_threshold=0.5),
268
+ max_per_img=3000)))
269
+
270
+ optimizer = dict(type='SGD', lr=0.02/4, momentum=0.9, weight_decay=0.0001)
271
+ # learning policy
272
+ checkpoint_config = dict(interval=4)
273
+ lr_config = dict(
274
+ policy='step',
275
+ warmup='linear',
276
+ warmup_iters=5000,
277
+ warmup_ratio=0.001,
278
+ step=[8, 11])
279
+ runner = dict(type='EpochBasedRunner', max_epochs=12)
280
+ evaluation = dict(interval=12, metric='bbox')
mmdet_code/SR-TOD/configs/_base_/models/fast-rcnn_r50_fpn.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='FastRCNN',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_size_divisor=32),
10
+ backbone=dict(
11
+ type='ResNet',
12
+ depth=50,
13
+ num_stages=4,
14
+ out_indices=(0, 1, 2, 3),
15
+ frozen_stages=1,
16
+ norm_cfg=dict(type='BN', requires_grad=True),
17
+ norm_eval=True,
18
+ style='pytorch',
19
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
20
+ neck=dict(
21
+ type='FPN',
22
+ in_channels=[256, 512, 1024, 2048],
23
+ out_channels=256,
24
+ num_outs=5),
25
+ roi_head=dict(
26
+ type='StandardRoIHead',
27
+ bbox_roi_extractor=dict(
28
+ type='SingleRoIExtractor',
29
+ roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
30
+ out_channels=256,
31
+ featmap_strides=[4, 8, 16, 32]),
32
+ bbox_head=dict(
33
+ type='Shared2FCBBoxHead',
34
+ in_channels=256,
35
+ fc_out_channels=1024,
36
+ roi_feat_size=7,
37
+ num_classes=80,
38
+ bbox_coder=dict(
39
+ type='DeltaXYWHBBoxCoder',
40
+ target_means=[0., 0., 0., 0.],
41
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
42
+ reg_class_agnostic=False,
43
+ loss_cls=dict(
44
+ type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
45
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0))),
46
+ # model training and testing settings
47
+ train_cfg=dict(
48
+ rcnn=dict(
49
+ assigner=dict(
50
+ type='MaxIoUAssigner',
51
+ pos_iou_thr=0.5,
52
+ neg_iou_thr=0.5,
53
+ min_pos_iou=0.5,
54
+ match_low_quality=False,
55
+ ignore_iof_thr=-1),
56
+ sampler=dict(
57
+ type='RandomSampler',
58
+ num=512,
59
+ pos_fraction=0.25,
60
+ neg_pos_ub=-1,
61
+ add_gt_as_proposals=True),
62
+ pos_weight=-1,
63
+ debug=False)),
64
+ test_cfg=dict(
65
+ rcnn=dict(
66
+ score_thr=0.05,
67
+ nms=dict(type='nms', iou_threshold=0.5),
68
+ max_per_img=100)))
mmdet_code/SR-TOD/configs/_base_/models/faster-rcnn_r50-caffe-c4.py ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ norm_cfg = dict(type='BN', requires_grad=False)
3
+ model = dict(
4
+ type='FasterRCNN',
5
+ data_preprocessor=dict(
6
+ type='DetDataPreprocessor',
7
+ mean=[103.530, 116.280, 123.675],
8
+ std=[1.0, 1.0, 1.0],
9
+ bgr_to_rgb=False,
10
+ pad_size_divisor=32),
11
+ backbone=dict(
12
+ type='ResNet',
13
+ depth=50,
14
+ num_stages=3,
15
+ strides=(1, 2, 2),
16
+ dilations=(1, 1, 1),
17
+ out_indices=(2, ),
18
+ frozen_stages=1,
19
+ norm_cfg=norm_cfg,
20
+ norm_eval=True,
21
+ style='caffe',
22
+ init_cfg=dict(
23
+ type='Pretrained',
24
+ checkpoint='open-mmlab://detectron2/resnet50_caffe')),
25
+ rpn_head=dict(
26
+ type='RPNHead',
27
+ in_channels=1024,
28
+ feat_channels=1024,
29
+ anchor_generator=dict(
30
+ type='AnchorGenerator',
31
+ scales=[2, 4, 8, 16, 32],
32
+ ratios=[0.5, 1.0, 2.0],
33
+ strides=[16]),
34
+ bbox_coder=dict(
35
+ type='DeltaXYWHBBoxCoder',
36
+ target_means=[.0, .0, .0, .0],
37
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
38
+ loss_cls=dict(
39
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
40
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
41
+ roi_head=dict(
42
+ type='StandardRoIHead',
43
+ shared_head=dict(
44
+ type='ResLayer',
45
+ depth=50,
46
+ stage=3,
47
+ stride=2,
48
+ dilation=1,
49
+ style='caffe',
50
+ norm_cfg=norm_cfg,
51
+ norm_eval=True,
52
+ init_cfg=dict(
53
+ type='Pretrained',
54
+ checkpoint='open-mmlab://detectron2/resnet50_caffe')),
55
+ bbox_roi_extractor=dict(
56
+ type='SingleRoIExtractor',
57
+ roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
58
+ out_channels=1024,
59
+ featmap_strides=[16]),
60
+ bbox_head=dict(
61
+ type='BBoxHead',
62
+ with_avg_pool=True,
63
+ roi_feat_size=7,
64
+ in_channels=2048,
65
+ num_classes=1,
66
+ bbox_coder=dict(
67
+ type='DeltaXYWHBBoxCoder',
68
+ target_means=[0., 0., 0., 0.],
69
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
70
+ reg_class_agnostic=False,
71
+ loss_cls=dict(
72
+ type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
73
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0))),
74
+ # model training and testing settings
75
+ train_cfg=dict(
76
+ rpn=dict(
77
+ assigner=dict(
78
+ type='MaxIoUAssigner',
79
+ pos_iou_thr=0.7,
80
+ neg_iou_thr=0.3,
81
+ min_pos_iou=0.3,
82
+ match_low_quality=True,
83
+ ignore_iof_thr=-1),
84
+ sampler=dict(
85
+ type='RandomSampler',
86
+ num=256,
87
+ pos_fraction=0.5,
88
+ neg_pos_ub=-1,
89
+ add_gt_as_proposals=False),
90
+ allowed_border=-1,
91
+ pos_weight=-1,
92
+ debug=False),
93
+ rpn_proposal=dict(
94
+ nms_pre=12000,
95
+ max_per_img=2000,
96
+ nms=dict(type='nms', iou_threshold=0.7),
97
+ min_bbox_size=0),
98
+ rcnn=dict(
99
+ assigner=dict(
100
+ type='MaxIoUAssigner',
101
+ pos_iou_thr=0.5,
102
+ neg_iou_thr=0.5,
103
+ min_pos_iou=0.5,
104
+ match_low_quality=False,
105
+ ignore_iof_thr=-1),
106
+ sampler=dict(
107
+ type='RandomSampler',
108
+ num=512,
109
+ pos_fraction=0.25,
110
+ neg_pos_ub=-1,
111
+ add_gt_as_proposals=True),
112
+ pos_weight=-1,
113
+ debug=False)),
114
+ test_cfg=dict(
115
+ rpn=dict(
116
+ nms_pre=6000,
117
+ max_per_img=1000,
118
+ nms=dict(type='nms', iou_threshold=0.7),
119
+ min_bbox_size=0),
120
+ rcnn=dict(
121
+ score_thr=0.05,
122
+ nms=dict(type='nms', iou_threshold=0.5),
123
+ max_per_img=100)))
mmdet_code/SR-TOD/configs/_base_/models/faster-rcnn_r50-caffe-dc5.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ norm_cfg = dict(type='BN', requires_grad=False)
3
+ model = dict(
4
+ type='FasterRCNN',
5
+ data_preprocessor=dict(
6
+ type='DetDataPreprocessor',
7
+ mean=[103.530, 116.280, 123.675],
8
+ std=[1.0, 1.0, 1.0],
9
+ bgr_to_rgb=False,
10
+ pad_size_divisor=32),
11
+ backbone=dict(
12
+ type='ResNet',
13
+ depth=50,
14
+ num_stages=4,
15
+ strides=(1, 2, 2, 1),
16
+ dilations=(1, 1, 1, 2),
17
+ out_indices=(3, ),
18
+ frozen_stages=1,
19
+ norm_cfg=norm_cfg,
20
+ norm_eval=True,
21
+ style='caffe',
22
+ init_cfg=dict(
23
+ type='Pretrained',
24
+ checkpoint='open-mmlab://detectron2/resnet50_caffe')),
25
+ rpn_head=dict(
26
+ type='RPNHead',
27
+ in_channels=2048,
28
+ feat_channels=2048,
29
+ anchor_generator=dict(
30
+ type='AnchorGenerator',
31
+ scales=[2, 4, 8, 16, 32],
32
+ ratios=[0.5, 1.0, 2.0],
33
+ strides=[16]),
34
+ bbox_coder=dict(
35
+ type='DeltaXYWHBBoxCoder',
36
+ target_means=[.0, .0, .0, .0],
37
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
38
+ loss_cls=dict(
39
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
40
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
41
+ roi_head=dict(
42
+ type='StandardRoIHead',
43
+ bbox_roi_extractor=dict(
44
+ type='SingleRoIExtractor',
45
+ roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
46
+ out_channels=2048,
47
+ featmap_strides=[16]),
48
+ bbox_head=dict(
49
+ type='Shared2FCBBoxHead',
50
+ in_channels=2048,
51
+ fc_out_channels=1024,
52
+ roi_feat_size=7,
53
+ num_classes=80,
54
+ bbox_coder=dict(
55
+ type='DeltaXYWHBBoxCoder',
56
+ target_means=[0., 0., 0., 0.],
57
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
58
+ reg_class_agnostic=False,
59
+ loss_cls=dict(
60
+ type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
61
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0))),
62
+ # model training and testing settings
63
+ train_cfg=dict(
64
+ rpn=dict(
65
+ assigner=dict(
66
+ type='MaxIoUAssigner',
67
+ pos_iou_thr=0.7,
68
+ neg_iou_thr=0.3,
69
+ min_pos_iou=0.3,
70
+ match_low_quality=True,
71
+ ignore_iof_thr=-1),
72
+ sampler=dict(
73
+ type='RandomSampler',
74
+ num=256,
75
+ pos_fraction=0.5,
76
+ neg_pos_ub=-1,
77
+ add_gt_as_proposals=False),
78
+ allowed_border=0,
79
+ pos_weight=-1,
80
+ debug=False),
81
+ rpn_proposal=dict(
82
+ nms_pre=12000,
83
+ max_per_img=2000,
84
+ nms=dict(type='nms', iou_threshold=0.7),
85
+ min_bbox_size=0),
86
+ rcnn=dict(
87
+ assigner=dict(
88
+ type='MaxIoUAssigner',
89
+ pos_iou_thr=0.5,
90
+ neg_iou_thr=0.5,
91
+ min_pos_iou=0.5,
92
+ match_low_quality=False,
93
+ ignore_iof_thr=-1),
94
+ sampler=dict(
95
+ type='RandomSampler',
96
+ num=512,
97
+ pos_fraction=0.25,
98
+ neg_pos_ub=-1,
99
+ add_gt_as_proposals=True),
100
+ pos_weight=-1,
101
+ debug=False)),
102
+ test_cfg=dict(
103
+ rpn=dict(
104
+ nms=dict(type='nms', iou_threshold=0.7),
105
+ nms_pre=6000,
106
+ max_per_img=1000,
107
+ min_bbox_size=0),
108
+ rcnn=dict(
109
+ score_thr=0.05,
110
+ nms=dict(type='nms', iou_threshold=0.5),
111
+ max_per_img=100)))
mmdet_code/SR-TOD/configs/_base_/models/faster-rcnn_r50_fpn.py ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='FasterRCNN',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_size_divisor=32),
10
+ backbone=dict(
11
+ type='ResNet',
12
+ depth=50,
13
+ num_stages=4,
14
+ out_indices=(0, 1, 2, 3),
15
+ frozen_stages=1,
16
+ norm_cfg=dict(type='BN', requires_grad=True),
17
+ norm_eval=True,
18
+ style='pytorch',
19
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
20
+ neck=dict(
21
+ type='FPN',
22
+ in_channels=[256, 512, 1024, 2048],
23
+ out_channels=256,
24
+ num_outs=5),
25
+ rpn_head=dict(
26
+ type='RPNHead',
27
+ in_channels=256,
28
+ feat_channels=256,
29
+ anchor_generator=dict(
30
+ type='AnchorGenerator',
31
+ scales=[8],
32
+ ratios=[0.5, 1.0, 2.0],
33
+ strides=[4, 8, 16, 32, 64]),
34
+ bbox_coder=dict(
35
+ type='DeltaXYWHBBoxCoder',
36
+ target_means=[.0, .0, .0, .0],
37
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
38
+ loss_cls=dict(
39
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
40
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
41
+ roi_head=dict(
42
+ type='StandardRoIHead',
43
+ bbox_roi_extractor=dict(
44
+ type='SingleRoIExtractor',
45
+ roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
46
+ out_channels=256,
47
+ featmap_strides=[4, 8, 16, 32]),
48
+ bbox_head=dict(
49
+ type='Shared2FCBBoxHead',
50
+ in_channels=256,
51
+ fc_out_channels=1024,
52
+ roi_feat_size=7,
53
+ num_classes=8,
54
+ bbox_coder=dict(
55
+ type='DeltaXYWHBBoxCoder',
56
+ target_means=[0., 0., 0., 0.],
57
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
58
+ reg_class_agnostic=False,
59
+ loss_cls=dict(
60
+ type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
61
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0))),
62
+ # model training and testing settings
63
+ # train_cfg=dict(
64
+ # rpn=dict(
65
+ # assigner=dict(
66
+ # type='MaxIoUAssigner',
67
+ # pos_iou_thr=0.7,
68
+ # neg_iou_thr=0.3,
69
+ # min_pos_iou=0.3,
70
+ # match_low_quality=True,
71
+ # ignore_iof_thr=-1),
72
+ # sampler=dict(
73
+ # type='RandomSampler',
74
+ # num=256,
75
+ # pos_fraction=0.5,
76
+ # neg_pos_ub=-1,
77
+ # add_gt_as_proposals=False),
78
+ # allowed_border=-1,
79
+ # pos_weight=-1,
80
+ # debug=False),
81
+ # rpn_proposal=dict(
82
+ # nms_pre=2000,
83
+ # max_per_img=1000,
84
+ # nms=dict(type='nms', iou_threshold=0.7),
85
+ # min_bbox_size=0),
86
+ # rcnn=dict(
87
+ # assigner=dict(
88
+ # type='MaxIoUAssigner',
89
+ # pos_iou_thr=0.5,
90
+ # neg_iou_thr=0.5,
91
+ # min_pos_iou=0.5,
92
+ # match_low_quality=False,
93
+ # ignore_iof_thr=-1),
94
+ # sampler=dict(
95
+ # type='RandomSampler',
96
+ # num=512,
97
+ # pos_fraction=0.25,
98
+ # neg_pos_ub=-1,
99
+ # add_gt_as_proposals=True),
100
+ # pos_weight=-1,
101
+ # debug=False)),
102
+ # test_cfg=dict(
103
+ # rpn=dict(
104
+ # nms_pre=1000,
105
+ # max_per_img=1000,
106
+ # nms=dict(type='nms', iou_threshold=0.7),
107
+ # min_bbox_size=0),
108
+ # rcnn=dict(
109
+ # score_thr=0.05,
110
+ # nms=dict(type='nms', iou_threshold=0.5),
111
+ # max_per_img=100)
112
+ # # soft-nms is also supported for rcnn testing
113
+ # # e.g., nms=dict(type='soft_nms', iou_threshold=0.5, min_score=0.05)
114
+ # ))
115
+ train_cfg=dict(
116
+ rpn=dict(
117
+ assigner=dict(
118
+ type='MaxIoUAssigner',
119
+ pos_iou_thr=0.7,
120
+ neg_iou_thr=0.3,
121
+ min_pos_iou=0.3,
122
+ match_low_quality=True,
123
+ ignore_iof_thr=-1,
124
+ gpu_assign_thr=512),
125
+ sampler=dict(
126
+ type='RandomSampler',
127
+ num=256,
128
+ pos_fraction=0.5,
129
+ neg_pos_ub=-1,
130
+ add_gt_as_proposals=False),
131
+ allowed_border=-1,
132
+ pos_weight=-1,
133
+ debug=False),
134
+ rpn_proposal=dict(
135
+ nms_pre=3000,
136
+ max_per_img=3000,
137
+ nms=dict(type='nms', iou_threshold=0.7),
138
+ min_bbox_size=0),
139
+ rcnn=dict(
140
+ assigner=dict(
141
+ type='MaxIoUAssigner',
142
+ pos_iou_thr=0.5,
143
+ neg_iou_thr=0.5,
144
+ min_pos_iou=0.5,
145
+ match_low_quality=False,
146
+ ignore_iof_thr=-1,
147
+ gpu_assign_thr=512),
148
+ sampler=dict(
149
+ type='RandomSampler',
150
+ num=512,
151
+ pos_fraction=0.25,
152
+ neg_pos_ub=-1,
153
+ add_gt_as_proposals=True),
154
+ pos_weight=-1,
155
+ debug=False)),
156
+ test_cfg=dict(
157
+ rpn=dict(
158
+ nms_pre=3000,
159
+ max_per_img=3000,
160
+ nms=dict(type='nms', iou_threshold=0.7),
161
+ min_bbox_size=0),
162
+ rcnn=dict(
163
+ score_thr=0.05,
164
+ nms=dict(type='nms', iou_threshold=0.5),
165
+ max_per_img=3000)
166
+ # soft-nms is also supported for rcnn testing
167
+ # e.g., nms=dict(type='soft_nms', iou_threshold=0.5, min_score=0.05)
168
+ ))
mmdet_code/SR-TOD/configs/_base_/models/mask-rcnn_r50-caffe-c4.py ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ norm_cfg = dict(type='BN', requires_grad=False)
3
+ model = dict(
4
+ type='MaskRCNN',
5
+ data_preprocessor=dict(
6
+ type='DetDataPreprocessor',
7
+ mean=[103.530, 116.280, 123.675],
8
+ std=[1.0, 1.0, 1.0],
9
+ bgr_to_rgb=False,
10
+ pad_mask=True,
11
+ pad_size_divisor=32),
12
+ backbone=dict(
13
+ type='ResNet',
14
+ depth=50,
15
+ num_stages=3,
16
+ strides=(1, 2, 2),
17
+ dilations=(1, 1, 1),
18
+ out_indices=(2, ),
19
+ frozen_stages=1,
20
+ norm_cfg=norm_cfg,
21
+ norm_eval=True,
22
+ style='caffe',
23
+ init_cfg=dict(
24
+ type='Pretrained',
25
+ checkpoint='open-mmlab://detectron2/resnet50_caffe')),
26
+ rpn_head=dict(
27
+ type='RPNHead',
28
+ in_channels=1024,
29
+ feat_channels=1024,
30
+ anchor_generator=dict(
31
+ type='AnchorGenerator',
32
+ scales=[2, 4, 8, 16, 32],
33
+ ratios=[0.5, 1.0, 2.0],
34
+ strides=[16]),
35
+ bbox_coder=dict(
36
+ type='DeltaXYWHBBoxCoder',
37
+ target_means=[.0, .0, .0, .0],
38
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
39
+ loss_cls=dict(
40
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
41
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
42
+ roi_head=dict(
43
+ type='StandardRoIHead',
44
+ shared_head=dict(
45
+ type='ResLayer',
46
+ depth=50,
47
+ stage=3,
48
+ stride=2,
49
+ dilation=1,
50
+ style='caffe',
51
+ norm_cfg=norm_cfg,
52
+ norm_eval=True),
53
+ bbox_roi_extractor=dict(
54
+ type='SingleRoIExtractor',
55
+ roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
56
+ out_channels=1024,
57
+ featmap_strides=[16]),
58
+ bbox_head=dict(
59
+ type='BBoxHead',
60
+ with_avg_pool=True,
61
+ roi_feat_size=7,
62
+ in_channels=2048,
63
+ num_classes=80,
64
+ bbox_coder=dict(
65
+ type='DeltaXYWHBBoxCoder',
66
+ target_means=[0., 0., 0., 0.],
67
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
68
+ reg_class_agnostic=False,
69
+ loss_cls=dict(
70
+ type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
71
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
72
+ mask_roi_extractor=None,
73
+ mask_head=dict(
74
+ type='FCNMaskHead',
75
+ num_convs=0,
76
+ in_channels=2048,
77
+ conv_out_channels=256,
78
+ num_classes=80,
79
+ loss_mask=dict(
80
+ type='CrossEntropyLoss', use_mask=True, loss_weight=1.0))),
81
+ # model training and testing settings
82
+ train_cfg=dict(
83
+ rpn=dict(
84
+ assigner=dict(
85
+ type='MaxIoUAssigner',
86
+ pos_iou_thr=0.7,
87
+ neg_iou_thr=0.3,
88
+ min_pos_iou=0.3,
89
+ match_low_quality=True,
90
+ ignore_iof_thr=-1),
91
+ sampler=dict(
92
+ type='RandomSampler',
93
+ num=256,
94
+ pos_fraction=0.5,
95
+ neg_pos_ub=-1,
96
+ add_gt_as_proposals=False),
97
+ allowed_border=0,
98
+ pos_weight=-1,
99
+ debug=False),
100
+ rpn_proposal=dict(
101
+ nms_pre=12000,
102
+ max_per_img=2000,
103
+ nms=dict(type='nms', iou_threshold=0.7),
104
+ min_bbox_size=0),
105
+ rcnn=dict(
106
+ assigner=dict(
107
+ type='MaxIoUAssigner',
108
+ pos_iou_thr=0.5,
109
+ neg_iou_thr=0.5,
110
+ min_pos_iou=0.5,
111
+ match_low_quality=False,
112
+ ignore_iof_thr=-1),
113
+ sampler=dict(
114
+ type='RandomSampler',
115
+ num=512,
116
+ pos_fraction=0.25,
117
+ neg_pos_ub=-1,
118
+ add_gt_as_proposals=True),
119
+ mask_size=14,
120
+ pos_weight=-1,
121
+ debug=False)),
122
+ test_cfg=dict(
123
+ rpn=dict(
124
+ nms_pre=6000,
125
+ nms=dict(type='nms', iou_threshold=0.7),
126
+ max_per_img=1000,
127
+ min_bbox_size=0),
128
+ rcnn=dict(
129
+ score_thr=0.05,
130
+ nms=dict(type='nms', iou_threshold=0.5),
131
+ max_per_img=100,
132
+ mask_thr_binary=0.5)))
mmdet_code/SR-TOD/configs/_base_/models/mask-rcnn_r50_fpn.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='MaskRCNN',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_mask=True,
10
+ pad_size_divisor=32),
11
+ backbone=dict(
12
+ type='ResNet',
13
+ depth=50,
14
+ num_stages=4,
15
+ out_indices=(0, 1, 2, 3),
16
+ frozen_stages=1,
17
+ norm_cfg=dict(type='BN', requires_grad=True),
18
+ norm_eval=True,
19
+ style='pytorch',
20
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
21
+ neck=dict(
22
+ type='FPN',
23
+ in_channels=[256, 512, 1024, 2048],
24
+ out_channels=256,
25
+ num_outs=5),
26
+ rpn_head=dict(
27
+ type='RPNHead',
28
+ in_channels=256,
29
+ feat_channels=256,
30
+ anchor_generator=dict(
31
+ type='AnchorGenerator',
32
+ scales=[8],
33
+ ratios=[0.5, 1.0, 2.0],
34
+ strides=[4, 8, 16, 32, 64]),
35
+ bbox_coder=dict(
36
+ type='DeltaXYWHBBoxCoder',
37
+ target_means=[.0, .0, .0, .0],
38
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
39
+ loss_cls=dict(
40
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
41
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
42
+ roi_head=dict(
43
+ type='StandardRoIHead',
44
+ bbox_roi_extractor=dict(
45
+ type='SingleRoIExtractor',
46
+ roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
47
+ out_channels=256,
48
+ featmap_strides=[4, 8, 16, 32]),
49
+ bbox_head=dict(
50
+ type='Shared2FCBBoxHead',
51
+ in_channels=256,
52
+ fc_out_channels=1024,
53
+ roi_feat_size=7,
54
+ num_classes=80,
55
+ bbox_coder=dict(
56
+ type='DeltaXYWHBBoxCoder',
57
+ target_means=[0., 0., 0., 0.],
58
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
59
+ reg_class_agnostic=False,
60
+ loss_cls=dict(
61
+ type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
62
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
63
+ mask_roi_extractor=dict(
64
+ type='SingleRoIExtractor',
65
+ roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
66
+ out_channels=256,
67
+ featmap_strides=[4, 8, 16, 32]),
68
+ mask_head=dict(
69
+ type='FCNMaskHead',
70
+ num_convs=4,
71
+ in_channels=256,
72
+ conv_out_channels=256,
73
+ num_classes=80,
74
+ loss_mask=dict(
75
+ type='CrossEntropyLoss', use_mask=True, loss_weight=1.0))),
76
+ # model training and testing settings
77
+ train_cfg=dict(
78
+ rpn=dict(
79
+ assigner=dict(
80
+ type='MaxIoUAssigner',
81
+ pos_iou_thr=0.7,
82
+ neg_iou_thr=0.3,
83
+ min_pos_iou=0.3,
84
+ match_low_quality=True,
85
+ ignore_iof_thr=-1),
86
+ sampler=dict(
87
+ type='RandomSampler',
88
+ num=256,
89
+ pos_fraction=0.5,
90
+ neg_pos_ub=-1,
91
+ add_gt_as_proposals=False),
92
+ allowed_border=-1,
93
+ pos_weight=-1,
94
+ debug=False),
95
+ rpn_proposal=dict(
96
+ nms_pre=2000,
97
+ max_per_img=1000,
98
+ nms=dict(type='nms', iou_threshold=0.7),
99
+ min_bbox_size=0),
100
+ rcnn=dict(
101
+ assigner=dict(
102
+ type='MaxIoUAssigner',
103
+ pos_iou_thr=0.5,
104
+ neg_iou_thr=0.5,
105
+ min_pos_iou=0.5,
106
+ match_low_quality=True,
107
+ ignore_iof_thr=-1),
108
+ sampler=dict(
109
+ type='RandomSampler',
110
+ num=512,
111
+ pos_fraction=0.25,
112
+ neg_pos_ub=-1,
113
+ add_gt_as_proposals=True),
114
+ mask_size=28,
115
+ pos_weight=-1,
116
+ debug=False)),
117
+ test_cfg=dict(
118
+ rpn=dict(
119
+ nms_pre=1000,
120
+ max_per_img=1000,
121
+ nms=dict(type='nms', iou_threshold=0.7),
122
+ min_bbox_size=0),
123
+ rcnn=dict(
124
+ score_thr=0.05,
125
+ nms=dict(type='nms', iou_threshold=0.5),
126
+ max_per_img=100,
127
+ mask_thr_binary=0.5)))
mmdet_code/SR-TOD/configs/_base_/models/retinanet_r50_fpn copy.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='RetinaNet',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_size_divisor=32),
10
+ backbone=dict(
11
+ type='ResNet',
12
+ depth=50,
13
+ num_stages=4,
14
+ out_indices=(0, 1, 2, 3),
15
+ frozen_stages=1,
16
+ norm_cfg=dict(type='BN', requires_grad=True),
17
+ norm_eval=True,
18
+ style='pytorch',
19
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
20
+ neck=dict(
21
+ type='FPN',
22
+ in_channels=[256, 512, 1024, 2048],
23
+ out_channels=256,
24
+ start_level=1,
25
+ add_extra_convs='on_input',
26
+ num_outs=5),
27
+ bbox_head=dict(
28
+ type='RetinaHead',
29
+ num_classes=1,
30
+ in_channels=256,
31
+ stacked_convs=4,
32
+ feat_channels=256,
33
+ anchor_generator=dict(
34
+ type='AnchorGenerator',
35
+ octave_base_scale=2,#4
36
+ scales_per_octave=3,
37
+ ratios=[0.5, 1.0, 2.0],
38
+ strides=[8, 16, 32, 64, 128]),
39
+ bbox_coder=dict(
40
+ type='DeltaXYWHBBoxCoder',
41
+ target_means=[.0, .0, .0, .0],
42
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
43
+ loss_cls=dict(
44
+ type='FocalLoss',
45
+ use_sigmoid=True,
46
+ gamma=2.0,
47
+ alpha=0.25,
48
+ loss_weight=1.0),
49
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
50
+ # model training and testing settings
51
+ train_cfg=dict(
52
+ assigner=dict(
53
+ type='MaxIoUAssigner',
54
+ pos_iou_thr=0.5,
55
+ neg_iou_thr=0.4,
56
+ min_pos_iou=0,
57
+ ignore_iof_thr=-1),
58
+ sampler=dict(
59
+ type='PseudoSampler'), # Focal loss should use PseudoSampler
60
+ allowed_border=-1,
61
+ pos_weight=-1,
62
+ debug=False),
63
+ test_cfg=dict(
64
+ nms_pre=1000,
65
+ min_bbox_size=0,
66
+ score_thr=0.05,
67
+ nms=dict(type='nms', iou_threshold=0.5),
68
+ max_per_img=100))
mmdet_code/SR-TOD/configs/_base_/models/retinanet_r50_fpn.py ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='RetinaNet',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_size_divisor=32),
10
+ backbone=dict(
11
+ type='ResNet',
12
+ depth=50,
13
+ num_stages=4,
14
+ out_indices=(0, 1, 2, 3),
15
+ frozen_stages=1,
16
+ norm_cfg=dict(type='BN', requires_grad=True),
17
+ norm_eval=True,
18
+ style='pytorch',
19
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
20
+ neck=dict(
21
+ type='FPN',
22
+ in_channels=[256, 512, 1024, 2048],
23
+ out_channels=256,
24
+ start_level=1,
25
+ add_extra_convs='on_input',
26
+ num_outs=5),
27
+ bbox_head=dict(
28
+ type='RetinaHead',
29
+ num_classes=1,
30
+ in_channels=256,
31
+ stacked_convs=4,
32
+ feat_channels=256,
33
+ anchor_generator=dict(
34
+ type='AnchorGenerator',
35
+ octave_base_scale=2,#4
36
+ scales_per_octave=3,
37
+ ratios=[0.5, 1.0, 2.0],
38
+ strides=[8, 16, 32, 64, 128]),
39
+ bbox_coder=dict(
40
+ type='DeltaXYWHBBoxCoder',
41
+ target_means=[.0, .0, .0, .0],
42
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
43
+ loss_cls=dict(
44
+ type='FocalLoss',
45
+ use_sigmoid=True,
46
+ gamma=2.0,
47
+ alpha=0.25,
48
+ loss_weight=1.0),
49
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
50
+ # model training and testing settings
51
+ train_cfg=dict(
52
+ assigner=dict(
53
+ type='MaxIoUAssigner',
54
+ pos_iou_thr=0.5,
55
+ neg_iou_thr=0.4,
56
+ min_pos_iou=0,
57
+ ignore_iof_thr=-1),
58
+ sampler=dict(
59
+ type='PseudoSampler'), # Focal loss should use PseudoSampler
60
+ allowed_border=-1,
61
+ pos_weight=-1,
62
+ debug=False),
63
+ test_cfg=dict(
64
+ nms_pre=3000,
65
+ min_bbox_size=0,
66
+ score_thr=0.05,
67
+ nms=dict(type='nms', iou_threshold=0.5),
68
+ max_per_img=3000))
69
+
70
+ #optimizer = dict(type='SGD', lr=0.0005, momentum=0.9, weight_decay=0.0001) # single gpu
71
+ # learning policy
72
+ checkpoint_config = dict(interval=4)
73
+ # lr_config = dict(
74
+ # policy='step',
75
+ # warmup='linear',
76
+ # warmup_iters=5000,
77
+ # warmup_ratio=0.001,
78
+ # step=[8, 11])
mmdet_code/SR-TOD/configs/_base_/models/rpn_r50-caffe-c4.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='RPN',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[103.530, 116.280, 123.675],
7
+ std=[1.0, 1.0, 1.0],
8
+ bgr_to_rgb=False,
9
+ pad_size_divisor=32),
10
+ backbone=dict(
11
+ type='ResNet',
12
+ depth=50,
13
+ num_stages=3,
14
+ strides=(1, 2, 2),
15
+ dilations=(1, 1, 1),
16
+ out_indices=(2, ),
17
+ frozen_stages=1,
18
+ norm_cfg=dict(type='BN', requires_grad=False),
19
+ norm_eval=True,
20
+ style='caffe',
21
+ init_cfg=dict(
22
+ type='Pretrained',
23
+ checkpoint='open-mmlab://detectron2/resnet50_caffe')),
24
+ neck=None,
25
+ rpn_head=dict(
26
+ type='RPNHead',
27
+ in_channels=1024,
28
+ feat_channels=1024,
29
+ anchor_generator=dict(
30
+ type='AnchorGenerator',
31
+ scales=[2, 4, 8, 16, 32],
32
+ ratios=[0.5, 1.0, 2.0],
33
+ strides=[16]),
34
+ bbox_coder=dict(
35
+ type='DeltaXYWHBBoxCoder',
36
+ target_means=[.0, .0, .0, .0],
37
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
38
+ loss_cls=dict(
39
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
40
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
41
+ # model training and testing settings
42
+ train_cfg=dict(
43
+ rpn=dict(
44
+ assigner=dict(
45
+ type='MaxIoUAssigner',
46
+ pos_iou_thr=0.7,
47
+ neg_iou_thr=0.3,
48
+ min_pos_iou=0.3,
49
+ ignore_iof_thr=-1),
50
+ sampler=dict(
51
+ type='RandomSampler',
52
+ num=256,
53
+ pos_fraction=0.5,
54
+ neg_pos_ub=-1,
55
+ add_gt_as_proposals=False),
56
+ allowed_border=-1,
57
+ pos_weight=-1,
58
+ debug=False)),
59
+ test_cfg=dict(
60
+ rpn=dict(
61
+ nms_pre=12000,
62
+ max_per_img=2000,
63
+ nms=dict(type='nms', iou_threshold=0.7),
64
+ min_bbox_size=0)))
mmdet_code/SR-TOD/configs/_base_/models/rpn_r50_fpn.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ model = dict(
3
+ type='RPN',
4
+ data_preprocessor=dict(
5
+ type='DetDataPreprocessor',
6
+ mean=[123.675, 116.28, 103.53],
7
+ std=[58.395, 57.12, 57.375],
8
+ bgr_to_rgb=True,
9
+ pad_size_divisor=32),
10
+ backbone=dict(
11
+ type='ResNet',
12
+ depth=50,
13
+ num_stages=4,
14
+ out_indices=(0, 1, 2, 3),
15
+ frozen_stages=1,
16
+ norm_cfg=dict(type='BN', requires_grad=True),
17
+ norm_eval=True,
18
+ style='pytorch',
19
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
20
+ neck=dict(
21
+ type='FPN',
22
+ in_channels=[256, 512, 1024, 2048],
23
+ out_channels=256,
24
+ num_outs=5),
25
+ rpn_head=dict(
26
+ type='RPNHead',
27
+ in_channels=256,
28
+ feat_channels=256,
29
+ anchor_generator=dict(
30
+ type='AnchorGenerator',
31
+ scales=[8],
32
+ ratios=[0.5, 1.0, 2.0],
33
+ strides=[4, 8, 16, 32, 64]),
34
+ bbox_coder=dict(
35
+ type='DeltaXYWHBBoxCoder',
36
+ target_means=[.0, .0, .0, .0],
37
+ target_stds=[1.0, 1.0, 1.0, 1.0]),
38
+ loss_cls=dict(
39
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
40
+ loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
41
+ # model training and testing settings
42
+ train_cfg=dict(
43
+ rpn=dict(
44
+ assigner=dict(
45
+ type='MaxIoUAssigner',
46
+ pos_iou_thr=0.7,
47
+ neg_iou_thr=0.3,
48
+ min_pos_iou=0.3,
49
+ ignore_iof_thr=-1),
50
+ sampler=dict(
51
+ type='RandomSampler',
52
+ num=256,
53
+ pos_fraction=0.5,
54
+ neg_pos_ub=-1,
55
+ add_gt_as_proposals=False),
56
+ allowed_border=-1,
57
+ pos_weight=-1,
58
+ debug=False)),
59
+ test_cfg=dict(
60
+ rpn=dict(
61
+ nms_pre=2000,
62
+ max_per_img=1000,
63
+ nms=dict(type='nms', iou_threshold=0.7),
64
+ min_bbox_size=0)))
mmdet_code/SR-TOD/configs/_base_/models/ssd300.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model settings
2
+ input_size = 300
3
+ model = dict(
4
+ type='SingleStageDetector',
5
+ data_preprocessor=dict(
6
+ type='DetDataPreprocessor',
7
+ mean=[123.675, 116.28, 103.53],
8
+ std=[1, 1, 1],
9
+ bgr_to_rgb=True,
10
+ pad_size_divisor=1),
11
+ backbone=dict(
12
+ type='SSDVGG',
13
+ depth=16,
14
+ with_last_pool=False,
15
+ ceil_mode=True,
16
+ out_indices=(3, 4),
17
+ out_feature_indices=(22, 34),
18
+ init_cfg=dict(
19
+ type='Pretrained', checkpoint='open-mmlab://vgg16_caffe')),
20
+ neck=dict(
21
+ type='SSDNeck',
22
+ in_channels=(512, 1024),
23
+ out_channels=(512, 1024, 512, 256, 256, 256),
24
+ level_strides=(2, 2, 1, 1),
25
+ level_paddings=(1, 1, 0, 0),
26
+ l2_norm_scale=20),
27
+ bbox_head=dict(
28
+ type='SSDHead',
29
+ in_channels=(512, 1024, 512, 256, 256, 256),
30
+ num_classes=80,
31
+ anchor_generator=dict(
32
+ type='SSDAnchorGenerator',
33
+ scale_major=False,
34
+ input_size=input_size,
35
+ basesize_ratio_range=(0.15, 0.9),
36
+ strides=[8, 16, 32, 64, 100, 300],
37
+ ratios=[[2], [2, 3], [2, 3], [2, 3], [2], [2]]),
38
+ bbox_coder=dict(
39
+ type='DeltaXYWHBBoxCoder',
40
+ target_means=[.0, .0, .0, .0],
41
+ target_stds=[0.1, 0.1, 0.2, 0.2])),
42
+ # model training and testing settings
43
+ train_cfg=dict(
44
+ assigner=dict(
45
+ type='MaxIoUAssigner',
46
+ pos_iou_thr=0.5,
47
+ neg_iou_thr=0.5,
48
+ min_pos_iou=0.,
49
+ ignore_iof_thr=-1,
50
+ gt_max_assign_all=False),
51
+ sampler=dict(type='PseudoSampler'),
52
+ smoothl1_beta=1.,
53
+ allowed_border=-1,
54
+ pos_weight=-1,
55
+ neg_pos_ratio=3,
56
+ debug=False),
57
+ test_cfg=dict(
58
+ nms_pre=1000,
59
+ nms=dict(type='nms', iou_threshold=0.45),
60
+ min_bbox_size=0,
61
+ score_thr=0.02,
62
+ max_per_img=200))
63
+ cudnn_benchmark = True
mmdet_code/SR-TOD/configs/_base_/schedules/schedule_1x.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # training schedule for 1x
2
+ train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=12, val_interval=1)
3
+ val_cfg = dict(type='ValLoop')
4
+ test_cfg = dict(type='TestLoop')
5
+
6
+ # learning rate
7
+ param_scheduler = [
8
+ dict(
9
+ type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500),
10
+ dict(
11
+ type='MultiStepLR',
12
+ begin=0,
13
+ end=12,
14
+ by_epoch=True,
15
+ milestones=[8, 11],
16
+ gamma=0.1)
17
+ ]
18
+
19
+ # optimizer
20
+ optim_wrapper = dict(
21
+ type='OptimWrapper',
22
+ #optimizer=dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001))
23
+ #optimizer=dict(type='SGD', lr=0.005, momentum=0.9, weight_decay=0.0001))
24
+ optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001))
25
+
26
+ # Default setting for scaling LR automatically
27
+ # - `enable` means enable scaling LR automatically
28
+ # or not by default.
29
+ # - `base_batch_size` = (8 GPUs) x (2 samples per GPU).
30
+ auto_scale_lr = dict(enable=False, base_batch_size=16)
mmdet_code/SR-TOD/configs/_base_/schedules/schedule_20e.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # training schedule for 20e
2
+ train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=20, val_interval=1)
3
+ val_cfg = dict(type='ValLoop')
4
+ test_cfg = dict(type='TestLoop')
5
+
6
+ # learning rate
7
+ param_scheduler = [
8
+ dict(
9
+ type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500),
10
+ dict(
11
+ type='MultiStepLR',
12
+ begin=0,
13
+ end=20,#end=20,
14
+ by_epoch=True,
15
+ milestones=[16, 19],#milestones=[16, 19],
16
+ gamma=0.1)
17
+ ]
18
+
19
+ # optimizer
20
+ optim_wrapper = dict(
21
+ type='OptimWrapper',
22
+ optimizer=dict(type='SGD', lr=0.0025, momentum=0.9, weight_decay=0.0001))
23
+ #optimizer=dict(type='SGD', lr=0.005, momentum=0.9, weight_decay=0.0001))
24
+ #optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001))
25
+
26
+ # Default setting for scaling LR automatically
27
+ # - `enable` means enable scaling LR automatically
28
+ # or not by default.
29
+ # - `base_batch_size` = (8 GPUs) x (2 samples per GPU).
30
+ auto_scale_lr = dict(enable=False, base_batch_size=16)
mmdet_code/SR-TOD/configs/_base_/schedules/schedule_2x.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # training schedule for 2x
2
+ train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=1)
3
+ val_cfg = dict(type='ValLoop')
4
+ test_cfg = dict(type='TestLoop')
5
+
6
+ # learning rate
7
+ param_scheduler = [
8
+ dict(
9
+ type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500),
10
+ dict(
11
+ type='MultiStepLR',
12
+ begin=0,
13
+ end=24,
14
+ by_epoch=True,
15
+ milestones=[16, 22],
16
+ gamma=0.1)
17
+ ]
18
+
19
+ # optimizer
20
+ optim_wrapper = dict(
21
+ type='OptimWrapper',
22
+ optimizer=dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001))
23
+
24
+ # Default setting for scaling LR automatically
25
+ # - `enable` means enable scaling LR automatically
26
+ # or not by default.
27
+ # - `base_batch_size` = (8 GPUs) x (2 samples per GPU).
28
+ auto_scale_lr = dict(enable=False, base_batch_size=16)
mmdet_code/SR-TOD/configs/albu_example/README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Albu Example
2
+
3
+ > [Albumentations: fast and flexible image augmentations](https://arxiv.org/abs/1809.06839)
4
+
5
+ <!-- [OTHERS] -->
6
+
7
+ ## Abstract
8
+
9
+ Data augmentation is a commonly used technique for increasing both the size and the diversity of labeled training sets by leveraging input transformations that preserve output labels. In computer vision domain, image augmentations have become a common implicit regularization technique to combat overfitting in deep convolutional neural networks and are ubiquitously used to improve performance. While most deep learning frameworks implement basic image transformations, the list is typically limited to some variations and combinations of flipping, rotating, scaling, and cropping. Moreover, the image processing speed varies in existing tools for image augmentation. We present Albumentations, a fast and flexible library for image augmentations with many various image transform operations available, that is also an easy-to-use wrapper around other augmentation libraries. We provide examples of image augmentations for different computer vision tasks and show that Albumentations is faster than other commonly used image augmentation tools on the most of commonly used image transformations.
10
+
11
+ <div align=center>
12
+ <img src="https://user-images.githubusercontent.com/40661020/143870703-74f3ea3f-ae23-4035-9856-746bc3f88464.png" height="400" />
13
+ </div>
14
+
15
+ ## Results and Models
16
+
17
+ | Backbone | Style | Lr schd | Mem (GB) | Inf time (fps) | box AP | mask AP | Config | Download |
18
+ | :------: | :-----: | :-----: | :------: | :------------: | :----: | :-----: | :-------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
19
+ | R-50 | pytorch | 1x | 4.4 | 16.6 | 38.0 | 34.5 | [config](./mask-rcnn_r50_fpn_albu-1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/albu_example/mask_rcnn_r50_fpn_albu_1x_coco/mask_rcnn_r50_fpn_albu_1x_coco_20200208-ab203bcd.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/albu_example/mask_rcnn_r50_fpn_albu_1x_coco/mask_rcnn_r50_fpn_albu_1x_coco_20200208_225520.log.json) |
20
+
21
+ ## Citation
22
+
23
+ ```latex
24
+ @article{2018arXiv180906839B,
25
+ author = {A. Buslaev, A. Parinov, E. Khvedchenya, V.~I. Iglovikov and A.~A. Kalinin},
26
+ title = "{Albumentations: fast and flexible image augmentations}",
27
+ journal = {ArXiv e-prints},
28
+ eprint = {1809.06839},
29
+ year = 2018
30
+ }
31
+ ```
mmdet_code/SR-TOD/configs/albu_example/mask-rcnn_r50_fpn_albu-1x_coco.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = '../mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py'
2
+
3
+ albu_train_transforms = [
4
+ dict(
5
+ type='ShiftScaleRotate',
6
+ shift_limit=0.0625,
7
+ scale_limit=0.0,
8
+ rotate_limit=0,
9
+ interpolation=1,
10
+ p=0.5),
11
+ dict(
12
+ type='RandomBrightnessContrast',
13
+ brightness_limit=[0.1, 0.3],
14
+ contrast_limit=[0.1, 0.3],
15
+ p=0.2),
16
+ dict(
17
+ type='OneOf',
18
+ transforms=[
19
+ dict(
20
+ type='RGBShift',
21
+ r_shift_limit=10,
22
+ g_shift_limit=10,
23
+ b_shift_limit=10,
24
+ p=1.0),
25
+ dict(
26
+ type='HueSaturationValue',
27
+ hue_shift_limit=20,
28
+ sat_shift_limit=30,
29
+ val_shift_limit=20,
30
+ p=1.0)
31
+ ],
32
+ p=0.1),
33
+ dict(type='JpegCompression', quality_lower=85, quality_upper=95, p=0.2),
34
+ dict(type='ChannelShuffle', p=0.1),
35
+ dict(
36
+ type='OneOf',
37
+ transforms=[
38
+ dict(type='Blur', blur_limit=3, p=1.0),
39
+ dict(type='MedianBlur', blur_limit=3, p=1.0)
40
+ ],
41
+ p=0.1),
42
+ ]
43
+ train_pipeline = [
44
+ dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
45
+ dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
46
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
47
+ dict(
48
+ type='Albu',
49
+ transforms=albu_train_transforms,
50
+ bbox_params=dict(
51
+ type='BboxParams',
52
+ format='pascal_voc',
53
+ label_fields=['gt_bboxes_labels', 'gt_ignore_flags'],
54
+ min_visibility=0.0,
55
+ filter_lost_elements=True),
56
+ keymap={
57
+ 'img': 'image',
58
+ 'gt_masks': 'masks',
59
+ 'gt_bboxes': 'bboxes'
60
+ },
61
+ skip_img_without_anno=True),
62
+ dict(type='RandomFlip', prob=0.5),
63
+ dict(type='PackDetInputs')
64
+ ]
65
+
66
+ train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
mmdet_code/SR-TOD/configs/albu_example/metafile.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Models:
2
+ - Name: mask-rcnn_r50_fpn_albu-1x_coco
3
+ In Collection: Mask R-CNN
4
+ Config: mask-rcnn_r50_fpn_albu-1x_coco.py
5
+ Metadata:
6
+ Training Memory (GB): 4.4
7
+ Epochs: 12
8
+ Results:
9
+ - Task: Object Detection
10
+ Dataset: COCO
11
+ Metrics:
12
+ box AP: 38.0
13
+ - Task: Instance Segmentation
14
+ Dataset: COCO
15
+ Metrics:
16
+ mask AP: 34.5
17
+ Weights: https://download.openmmlab.com/mmdetection/v2.0/albu_example/mask_rcnn_r50_fpn_albu_1x_coco/mask_rcnn_r50_fpn_albu_1x_coco_20200208-ab203bcd.pth
mmdet_code/SR-TOD/configs/atss/README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ATSS
2
+
3
+ > [Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection](https://arxiv.org/abs/1912.02424)
4
+
5
+ <!-- [ALGORITHM] -->
6
+
7
+ ## Abstract
8
+
9
+ Object detection has been dominated by anchor-based detectors for several years. Recently, anchor-free detectors have become popular due to the proposal of FPN and Focal Loss. In this paper, we first point out that the essential difference between anchor-based and anchor-free detection is actually how to define positive and negative training samples, which leads to the performance gap between them. If they adopt the same definition of positive and negative samples during training, there is no obvious difference in the final performance, no matter regressing from a box or a point. This shows that how to select positive and negative training samples is important for current object detectors. Then, we propose an Adaptive Training Sample Selection (ATSS) to automatically select positive and negative samples according to statistical characteristics of object. It significantly improves the performance of anchor-based and anchor-free detectors and bridges the gap between them. Finally, we discuss the necessity of tiling multiple anchors per location on the image to detect objects. Extensive experiments conducted on MS COCO support our aforementioned analysis and conclusions. With the newly introduced ATSS, we improve state-of-the-art detectors by a large margin to 50.7% AP without introducing any overhead.
10
+
11
+ <div align=center>
12
+ <img src="https://user-images.githubusercontent.com/40661020/143870776-c81168f5-e8b2-44ee-978b-509e4372c5c9.png"/>
13
+ </div>
14
+
15
+ ## Results and Models
16
+
17
+ | Backbone | Style | Lr schd | Mem (GB) | Inf time (fps) | box AP | Config | Download |
18
+ | :------: | :-----: | :-----: | :------: | :------------: | :----: | :----------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
19
+ | R-50 | pytorch | 1x | 3.7 | 19.7 | 39.4 | [config](./atss_r50_fpn_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r50_fpn_1x_coco/atss_r50_fpn_1x_coco_20200209-985f7bd0.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r50_fpn_1x_coco/atss_r50_fpn_1x_coco_20200209_102539.log.json) |
20
+ | R-101 | pytorch | 1x | 5.6 | 12.3 | 41.5 | [config](./atss_r101_fpn_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r101_fpn_1x_coco/atss_r101_fpn_1x_20200825-dfcadd6f.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r101_fpn_1x_coco/atss_r101_fpn_1x_20200825-dfcadd6f.log.json) |
21
+
22
+ ## Citation
23
+
24
+ ```latex
25
+ @article{zhang2019bridging,
26
+ title = {Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection},
27
+ author = {Zhang, Shifeng and Chi, Cheng and Yao, Yongqiang and Lei, Zhen and Li, Stan Z.},
28
+ journal = {arXiv preprint arXiv:1912.02424},
29
+ year = {2019}
30
+ }
31
+ ```
mmdet_code/SR-TOD/configs/atss/atss_r101_fpn_1x_coco.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = './atss_r50_fpn_1x_coco.py'
2
+ # model = dict(
3
+ # backbone=dict(
4
+ # depth=101,
5
+ # init_cfg=dict(type='Pretrained',
6
+ # checkpoint='torchvision://resnet101')))
7
+ model = dict(
8
+ backbone=dict(
9
+ type='ResNeXt',
10
+ depth=101,
11
+ groups=32,
12
+ base_width=4,
13
+ num_stages=4,
14
+ out_indices=(0, 1, 2, 3),
15
+ frozen_stages=1,
16
+ norm_cfg=dict(type='BN', requires_grad=True),
17
+ style='pytorch',
18
+ init_cfg=dict(
19
+ type='Pretrained', checkpoint='open-mmlab://resnext101_32x4d')))
mmdet_code/SR-TOD/configs/atss/atss_r101_fpn_8xb8-amp-lsj-200e_coco.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ _base_ = './atss_r50_fpn_8xb8-amp-lsj-200e_coco.py'
2
+
3
+ model = dict(
4
+ backbone=dict(
5
+ depth=101,
6
+ init_cfg=dict(type='Pretrained',
7
+ checkpoint='torchvision://resnet101')))
mmdet_code/SR-TOD/configs/atss/atss_r18_fpn_8xb8-amp-lsj-200e_coco.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ _base_ = './atss_r50_fpn_8xb8-amp-lsj-200e_coco.py'
2
+
3
+ model = dict(
4
+ backbone=dict(
5
+ depth=18,
6
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet18')),
7
+ neck=dict(in_channels=[64, 128, 256, 512]))
mmdet_code/SR-TOD/configs/atss/atss_r50_fpn_1x_coco.py ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ '../_base_/datasets/coco_detection_aitod.py',
3
+ '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
4
+ ]
5
+
6
+ # model settings
7
+ model = dict(
8
+ type='ATSS',
9
+ data_preprocessor=dict(
10
+ type='DetDataPreprocessor',
11
+ mean=[123.675, 116.28, 103.53],
12
+ std=[58.395, 57.12, 57.375],
13
+ bgr_to_rgb=True,
14
+ pad_size_divisor=32),
15
+ backbone=dict(
16
+ type='ResNet',
17
+ depth=50,
18
+ num_stages=4,
19
+ out_indices=(0, 1, 2, 3),
20
+ frozen_stages=1,
21
+ norm_cfg=dict(type='BN', requires_grad=True),
22
+ norm_eval=True,
23
+ style='pytorch',
24
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
25
+ neck=dict(
26
+ type='FPN',
27
+ in_channels=[256, 512, 1024, 2048],
28
+ out_channels=256,
29
+ start_level=1,
30
+ add_extra_convs='on_output',
31
+ num_outs=5),
32
+ bbox_head=dict(
33
+ type='ATSSHead',
34
+ num_classes=8,
35
+ in_channels=256,
36
+ stacked_convs=4,
37
+ feat_channels=256,
38
+ anchor_generator=dict(
39
+ type='AnchorGenerator',
40
+ ratios=[1.0],
41
+ octave_base_scale=8,
42
+ scales_per_octave=1,
43
+ strides=[8, 16, 32, 64, 128]),
44
+ bbox_coder=dict(
45
+ type='DeltaXYWHBBoxCoder',
46
+ target_means=[.0, .0, .0, .0],
47
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
48
+ loss_cls=dict(
49
+ type='FocalLoss',
50
+ use_sigmoid=True,
51
+ gamma=2.0,
52
+ alpha=0.25,
53
+ loss_weight=1.0),
54
+ loss_bbox=dict(type='GIoULoss', loss_weight=2.0),
55
+ loss_centerness=dict(
56
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
57
+ # training and testing settings
58
+ train_cfg=dict(
59
+ assigner=dict(type='ATSSAssigner', topk=9),
60
+ allowed_border=-1,
61
+ pos_weight=-1,
62
+ debug=False),
63
+ # test_cfg=dict(
64
+ # nms_pre=1000,
65
+ # min_bbox_size=0,
66
+ # score_thr=0.05,
67
+ # nms=dict(type='nms', iou_threshold=0.6),
68
+ # max_per_img=100))
69
+
70
+ test_cfg=dict(
71
+ nms_pre=3000,
72
+ min_bbox_size=0,
73
+ score_thr=0.05,
74
+ nms=dict(type='nms', iou_threshold=0.5),
75
+ max_per_img=3000))
76
+
77
+ optimizer = dict(type='SGD', lr=0.005, momentum=0.9, weight_decay=0.0001) # single gpu
78
+ # optimizer
79
+ # optim_wrapper = dict(
80
+ # optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001))
mmdet_code/SR-TOD/configs/atss/atss_r50_fpn_8xb8-amp-lsj-200e_coco.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = '../common/lsj-200e_coco-detection.py'
2
+
3
+ image_size = (1024, 1024)
4
+ batch_augments = [dict(type='BatchFixedSizePad', size=image_size)]
5
+
6
+ model = dict(
7
+ type='ATSS',
8
+ data_preprocessor=dict(
9
+ type='DetDataPreprocessor',
10
+ mean=[123.675, 116.28, 103.53],
11
+ std=[58.395, 57.12, 57.375],
12
+ bgr_to_rgb=True,
13
+ pad_size_divisor=32,
14
+ batch_augments=batch_augments),
15
+ backbone=dict(
16
+ type='ResNet',
17
+ depth=50,
18
+ num_stages=4,
19
+ out_indices=(0, 1, 2, 3),
20
+ frozen_stages=1,
21
+ norm_cfg=dict(type='BN', requires_grad=True),
22
+ norm_eval=True,
23
+ style='pytorch',
24
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
25
+ neck=dict(
26
+ type='FPN',
27
+ in_channels=[256, 512, 1024, 2048],
28
+ out_channels=256,
29
+ start_level=1,
30
+ add_extra_convs='on_output',
31
+ num_outs=5),
32
+ bbox_head=dict(
33
+ type='ATSSHead',
34
+ num_classes=80,
35
+ in_channels=256,
36
+ stacked_convs=4,
37
+ feat_channels=256,
38
+ anchor_generator=dict(
39
+ type='AnchorGenerator',
40
+ ratios=[1.0],
41
+ octave_base_scale=8,
42
+ scales_per_octave=1,
43
+ strides=[8, 16, 32, 64, 128]),
44
+ bbox_coder=dict(
45
+ type='DeltaXYWHBBoxCoder',
46
+ target_means=[.0, .0, .0, .0],
47
+ target_stds=[0.1, 0.1, 0.2, 0.2]),
48
+ loss_cls=dict(
49
+ type='FocalLoss',
50
+ use_sigmoid=True,
51
+ gamma=2.0,
52
+ alpha=0.25,
53
+ loss_weight=1.0),
54
+ loss_bbox=dict(type='GIoULoss', loss_weight=2.0),
55
+ loss_centerness=dict(
56
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
57
+ # training and testing settings
58
+ train_cfg=dict(
59
+ assigner=dict(type='ATSSAssigner', topk=9),
60
+ allowed_border=-1,
61
+ pos_weight=-1,
62
+ debug=False),
63
+ test_cfg=dict(
64
+ nms_pre=1000,
65
+ min_bbox_size=0,
66
+ score_thr=0.05,
67
+ nms=dict(type='nms', iou_threshold=0.6),
68
+ max_per_img=100))
69
+
70
+ train_dataloader = dict(batch_size=8, num_workers=4)
71
+
72
+ # Enable automatic-mixed-precision training with AmpOptimWrapper.
73
+ optim_wrapper = dict(
74
+ type='AmpOptimWrapper',
75
+ optimizer=dict(
76
+ type='SGD', lr=0.01 * 4, momentum=0.9, weight_decay=0.00004))
77
+
78
+ # NOTE: `auto_scale_lr` is for automatically scaling LR,
79
+ # USER SHOULD NOT CHANGE ITS VALUES.
80
+ # base_batch_size = (8 GPUs) x (8 samples per GPU)
81
+ auto_scale_lr = dict(base_batch_size=64)
mmdet_code/SR-TOD/configs/atss/metafile.yml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Collections:
2
+ - Name: ATSS
3
+ Metadata:
4
+ Training Data: COCO
5
+ Training Techniques:
6
+ - SGD with Momentum
7
+ - Weight Decay
8
+ Training Resources: 8x V100 GPUs
9
+ Architecture:
10
+ - ATSS
11
+ - FPN
12
+ - ResNet
13
+ Paper:
14
+ URL: https://arxiv.org/abs/1912.02424
15
+ Title: 'Bridging the Gap Between Anchor-based and Anchor-free Detection via Adaptive Training Sample Selection'
16
+ README: configs/atss/README.md
17
+ Code:
18
+ URL: https://github.com/open-mmlab/mmdetection/blob/v2.0.0/mmdet/models/detectors/atss.py#L6
19
+ Version: v2.0.0
20
+
21
+ Models:
22
+ - Name: atss_r50_fpn_1x_coco
23
+ In Collection: ATSS
24
+ Config: configs/atss/atss_r50_fpn_1x_coco.py
25
+ Metadata:
26
+ Training Memory (GB): 3.7
27
+ inference time (ms/im):
28
+ - value: 50.76
29
+ hardware: V100
30
+ backend: PyTorch
31
+ batch size: 1
32
+ mode: FP32
33
+ resolution: (800, 1333)
34
+ Epochs: 12
35
+ Results:
36
+ - Task: Object Detection
37
+ Dataset: COCO
38
+ Metrics:
39
+ box AP: 39.4
40
+ Weights: https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r50_fpn_1x_coco/atss_r50_fpn_1x_coco_20200209-985f7bd0.pth
41
+
42
+ - Name: atss_r101_fpn_1x_coco
43
+ In Collection: ATSS
44
+ Config: configs/atss/atss_r101_fpn_1x_coco.py
45
+ Metadata:
46
+ Training Memory (GB): 5.6
47
+ inference time (ms/im):
48
+ - value: 81.3
49
+ hardware: V100
50
+ backend: PyTorch
51
+ batch size: 1
52
+ mode: FP32
53
+ resolution: (800, 1333)
54
+ Epochs: 12
55
+ Results:
56
+ - Task: Object Detection
57
+ Dataset: COCO
58
+ Metrics:
59
+ box AP: 41.5
60
+ Weights: https://download.openmmlab.com/mmdetection/v2.0/atss/atss_r101_fpn_1x_coco/atss_r101_fpn_1x_20200825-dfcadd6f.pth
mmdet_code/SR-TOD/configs/autoassign/README.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AutoAssign
2
+
3
+ > [AutoAssign: Differentiable Label Assignment for Dense Object Detection](https://arxiv.org/abs/2007.03496)
4
+
5
+ <!-- [ALGORITHM] -->
6
+
7
+ ## Abstract
8
+
9
+ Determining positive/negative samples for object detection is known as label assignment. Here we present an anchor-free detector named AutoAssign. It requires little human knowledge and achieves appearance-aware through a fully differentiable weighting mechanism. During training, to both satisfy the prior distribution of data and adapt to category characteristics, we present Center Weighting to adjust the category-specific prior distributions. To adapt to object appearances, Confidence Weighting is proposed to adjust the specific assign strategy of each instance. The two weighting modules are then combined to generate positive and negative weights to adjust each location's confidence. Extensive experiments on the MS COCO show that our method steadily surpasses other best sampling strategies by large margins with various backbones. Moreover, our best model achieves 52.1% AP, outperforming all existing one-stage detectors. Besides, experiments on other datasets, e.g., PASCAL VOC, Objects365, and WiderFace, demonstrate the broad applicability of AutoAssign.
10
+
11
+ <div align=center>
12
+ <img src="https://user-images.githubusercontent.com/40661020/143870875-33567e44-0584-4470-9a90-0df0fb6c1fe2.png"/>
13
+ </div>
14
+
15
+ ## Results and Models
16
+
17
+ | Backbone | Style | Lr schd | Mem (GB) | box AP | Config | Download |
18
+ | :------: | :---: | :-----: | :------: | :----: | :---------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
19
+ | R-50 | caffe | 1x | 4.08 | 40.4 | [config](./autoassign_r50-caffe_fpn_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/autoassign/auto_assign_r50_fpn_1x_coco/auto_assign_r50_fpn_1x_coco_20210413_115540-5e17991f.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/autoassign/auto_assign_r50_fpn_1x_coco/auto_assign_r50_fpn_1x_coco_20210413_115540-5e17991f.log.json) |
20
+
21
+ **Note**:
22
+
23
+ 1. We find that the performance is unstable with 1x setting and may fluctuate by about 0.3 mAP. mAP 40.3 ~ 40.6 is acceptable. Such fluctuation can also be found in the original implementation.
24
+ 2. You can get a more stable results ~ mAP 40.6 with a schedule total 13 epoch, and learning rate is divided by 10 at 10th and 13th epoch.
25
+
26
+ ## Citation
27
+
28
+ ```latex
29
+ @article{zhu2020autoassign,
30
+ title={AutoAssign: Differentiable Label Assignment for Dense Object Detection},
31
+ author={Zhu, Benjin and Wang, Jianfeng and Jiang, Zhengkai and Zong, Fuhang and Liu, Songtao and Li, Zeming and Sun, Jian},
32
+ journal={arXiv preprint arXiv:2007.03496},
33
+ year={2020}
34
+ }
35
+ ```
mmdet_code/SR-TOD/configs/autoassign/autoassign_r50-caffe_fpn_1x_coco.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # We follow the original implementation which
2
+ # adopts the Caffe pre-trained backbone.
3
+ _base_ = [
4
+ '../_base_/datasets/coco_detection.py',
5
+ '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
6
+ ]
7
+ # model settings
8
+ model = dict(
9
+ type='AutoAssign',
10
+ data_preprocessor=dict(
11
+ type='DetDataPreprocessor',
12
+ mean=[102.9801, 115.9465, 122.7717],
13
+ std=[1.0, 1.0, 1.0],
14
+ bgr_to_rgb=False,
15
+ pad_size_divisor=32),
16
+ backbone=dict(
17
+ type='ResNet',
18
+ depth=50,
19
+ num_stages=4,
20
+ out_indices=(0, 1, 2, 3),
21
+ frozen_stages=1,
22
+ norm_cfg=dict(type='BN', requires_grad=False),
23
+ norm_eval=True,
24
+ style='caffe',
25
+ init_cfg=dict(
26
+ type='Pretrained',
27
+ checkpoint='open-mmlab://detectron2/resnet50_caffe')),
28
+ neck=dict(
29
+ type='FPN',
30
+ in_channels=[256, 512, 1024, 2048],
31
+ out_channels=256,
32
+ start_level=1,
33
+ add_extra_convs=True,
34
+ num_outs=5,
35
+ relu_before_extra_convs=True,
36
+ init_cfg=dict(type='Caffe2Xavier', layer='Conv2d')),
37
+ bbox_head=dict(
38
+ type='AutoAssignHead',
39
+ num_classes=80,
40
+ in_channels=256,
41
+ stacked_convs=4,
42
+ feat_channels=256,
43
+ strides=[8, 16, 32, 64, 128],
44
+ loss_bbox=dict(type='GIoULoss', loss_weight=5.0)),
45
+ train_cfg=None,
46
+ test_cfg=dict(
47
+ nms_pre=1000,
48
+ min_bbox_size=0,
49
+ score_thr=0.05,
50
+ nms=dict(type='nms', iou_threshold=0.6),
51
+ max_per_img=100))
52
+
53
+ # learning rate
54
+ param_scheduler = [
55
+ dict(
56
+ type='LinearLR', start_factor=0.001, by_epoch=False, begin=0,
57
+ end=1000),
58
+ dict(
59
+ type='MultiStepLR',
60
+ begin=0,
61
+ end=12,
62
+ by_epoch=True,
63
+ milestones=[8, 11],
64
+ gamma=0.1)
65
+ ]
66
+
67
+ # optimizer
68
+ optim_wrapper = dict(
69
+ optimizer=dict(lr=0.01), paramwise_cfg=dict(norm_decay_mult=0.))
mmdet_code/SR-TOD/configs/autoassign/metafile.yml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Collections:
2
+ - Name: AutoAssign
3
+ Metadata:
4
+ Training Data: COCO
5
+ Training Techniques:
6
+ - SGD with Momentum
7
+ - Weight Decay
8
+ Training Resources: 8x V100 GPUs
9
+ Architecture:
10
+ - AutoAssign
11
+ - FPN
12
+ - ResNet
13
+ Paper:
14
+ URL: https://arxiv.org/abs/2007.03496
15
+ Title: 'AutoAssign: Differentiable Label Assignment for Dense Object Detection'
16
+ README: configs/autoassign/README.md
17
+ Code:
18
+ URL: https://github.com/open-mmlab/mmdetection/blob/v2.12.0/mmdet/models/detectors/autoassign.py#L6
19
+ Version: v2.12.0
20
+
21
+ Models:
22
+ - Name: autoassign_r50-caffe_fpn_1x_coco
23
+ In Collection: AutoAssign
24
+ Config: configs/autoassign/autoassign_r50-caffe_fpn_1x_coco.py
25
+ Metadata:
26
+ Training Memory (GB): 4.08
27
+ Epochs: 12
28
+ Results:
29
+ - Task: Object Detection
30
+ Dataset: COCO
31
+ Metrics:
32
+ box AP: 40.4
33
+ Weights: https://download.openmmlab.com/mmdetection/v2.0/autoassign/auto_assign_r50_fpn_1x_coco/auto_assign_r50_fpn_1x_coco_20210413_115540-5e17991f.pth
mmdet_code/SR-TOD/configs/boxinst/README.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # BoxInst
2
+
3
+ > [BoxInst: High-Performance Instance Segmentation with Box Annotations](https://arxiv.org/pdf/2012.02310.pdf)
4
+
5
+ <!-- [ALGORITHM] -->
6
+
7
+ ## Abstract
8
+
9
+ We present a high-performance method that can achieve mask-level instance segmentation with only bounding-box annotations for training. While this setting has been studied in the literature, here we show significantly stronger performance with a simple design (e.g., dramatically improving previous best reported mask AP of 21.1% to 31.6% on the COCO dataset). Our core idea is to redesign the loss
10
+ of learning masks in instance segmentation, with no modification to the segmentation network itself. The new loss functions can supervise the mask training without relying on mask annotations. This is made possible with two loss terms, namely, 1) a surrogate term that minimizes the discrepancy between the projections of the ground-truth box and the predicted mask; 2) a pairwise loss that can exploit the prior that proximal pixels with similar colors are very likely to have the same category label. Experiments demonstrate that the redesigned mask loss can yield surprisingly high-quality instance masks with only box annotations. For example, without using any mask annotations, with a ResNet-101 backbone and 3× training schedule, we achieve 33.2% mask AP on COCO test-dev split (vs. 39.1% of the fully supervised counterpart). Our excellent experiment results on COCO and Pascal VOC indicate that our method dramatically narrows the performance gap between weakly and fully supervised instance segmentation.
11
+
12
+ <div align=center>
13
+ <img src="https://user-images.githubusercontent.com/57584090/209087723-756b76d7-5061-4000-a93c-df1194a439a0.png"/>
14
+ </div>
15
+
16
+ ## Results and Models
17
+
18
+ | Backbone | Style | MS train | Lr schd | bbox AP | mask AP | Config | Download |
19
+ | :------: | :-----: | :------: | :-----: | :-----: | :-----: | :-----------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
20
+ | R-50 | pytorch | Y | 1x | 39.6 | 31.1 | [config](./boxinst_r50_fpn_ms-90k_coco.py) | [model](https://download.openmmlab.com/mmdetection/v3.0/boxinst/boxinst_r50_fpn_ms-90k_coco/boxinst_r50_fpn_ms-90k_coco_20221228_163052-6add751a.pth) \| [log](https://download.openmmlab.com/mmdetection/v3.0/boxinst/boxinst_r50_fpn_ms-90k_coco/boxinst_r50_fpn_ms-90k_coco_20221228_163052.log.json) |
21
+ | R-101 | pytorch | Y | 1x | 41.8 | 32.7 | [config](./boxinst_r101_fpn_ms-90k_coco.py) | [model](https://download.openmmlab.com/mmdetection/v3.0/boxinst/boxinst_r101_fpn_ms-90k_coco/boxinst_r101_fpn_ms-90k_coco_20221229_145106-facf375b.pth) \|[log](https://download.openmmlab.com/mmdetection/v3.0/boxinst/boxinst_r101_fpn_ms-90k_coco/boxinst_r101_fpn_ms-90k_coco_20221229_145106.log.json) |
22
+
23
+ ## Citation
24
+
25
+ ```latex
26
+ @inproceedings{tian2020boxinst,
27
+ title = {{BoxInst}: High-Performance Instance Segmentation with Box Annotations},
28
+ author = {Tian, Zhi and Shen, Chunhua and Wang, Xinlong and Chen, Hao},
29
+ booktitle = {Proc. IEEE Conf. Computer Vision and Pattern Recognition (CVPR)},
30
+ year = {2021}
31
+ }
32
+ ```
mmdet_code/SR-TOD/configs/boxinst/boxinst_r101_fpn_ms-90k_coco.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ _base_ = './boxinst_r50_fpn_ms-90k_coco.py'
2
+
3
+ # model settings
4
+ model = dict(
5
+ backbone=dict(
6
+ depth=101,
7
+ init_cfg=dict(type='Pretrained',
8
+ checkpoint='torchvision://resnet101')))
mmdet_code/SR-TOD/configs/boxinst/boxinst_r50_fpn_ms-90k_coco.py ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = '../common/ms-90k_coco.py'
2
+
3
+ # model settings
4
+ model = dict(
5
+ type='BoxInst',
6
+ data_preprocessor=dict(
7
+ type='BoxInstDataPreprocessor',
8
+ mean=[123.675, 116.28, 103.53],
9
+ std=[58.395, 57.12, 57.375],
10
+ bgr_to_rgb=True,
11
+ pad_size_divisor=32,
12
+ mask_stride=4,
13
+ pairwise_size=3,
14
+ pairwise_dilation=2,
15
+ pairwise_color_thresh=0.3,
16
+ bottom_pixels_removed=10),
17
+ backbone=dict(
18
+ type='ResNet',
19
+ depth=50,
20
+ num_stages=4,
21
+ out_indices=(0, 1, 2, 3),
22
+ frozen_stages=1,
23
+ norm_cfg=dict(type='BN', requires_grad=True),
24
+ norm_eval=True,
25
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50'),
26
+ style='pytorch'),
27
+ neck=dict(
28
+ type='FPN',
29
+ in_channels=[256, 512, 1024, 2048],
30
+ out_channels=256,
31
+ start_level=1,
32
+ add_extra_convs='on_output', # use P5
33
+ num_outs=5,
34
+ relu_before_extra_convs=True),
35
+ bbox_head=dict(
36
+ type='BoxInstBboxHead',
37
+ num_params=593,
38
+ num_classes=80,
39
+ in_channels=256,
40
+ stacked_convs=4,
41
+ feat_channels=256,
42
+ strides=[8, 16, 32, 64, 128],
43
+ norm_on_bbox=True,
44
+ centerness_on_reg=True,
45
+ dcn_on_last_conv=False,
46
+ center_sampling=True,
47
+ conv_bias=True,
48
+ loss_cls=dict(
49
+ type='FocalLoss',
50
+ use_sigmoid=True,
51
+ gamma=2.0,
52
+ alpha=0.25,
53
+ loss_weight=1.0),
54
+ loss_bbox=dict(type='GIoULoss', loss_weight=1.0),
55
+ loss_centerness=dict(
56
+ type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
57
+ mask_head=dict(
58
+ type='BoxInstMaskHead',
59
+ num_layers=3,
60
+ feat_channels=16,
61
+ size_of_interest=8,
62
+ mask_out_stride=4,
63
+ topk_masks_per_img=64,
64
+ mask_feature_head=dict(
65
+ in_channels=256,
66
+ feat_channels=128,
67
+ start_level=0,
68
+ end_level=2,
69
+ out_channels=16,
70
+ mask_stride=8,
71
+ num_stacked_convs=4,
72
+ norm_cfg=dict(type='BN', requires_grad=True)),
73
+ loss_mask=dict(
74
+ type='DiceLoss',
75
+ use_sigmoid=True,
76
+ activate=True,
77
+ eps=5e-6,
78
+ loss_weight=1.0)),
79
+ # model training and testing settings
80
+ test_cfg=dict(
81
+ nms_pre=1000,
82
+ min_bbox_size=0,
83
+ score_thr=0.05,
84
+ nms=dict(type='nms', iou_threshold=0.6),
85
+ max_per_img=100,
86
+ mask_thr=0.5))
87
+
88
+ # optimizer
89
+ optim_wrapper = dict(optimizer=dict(lr=0.01))
90
+
91
+ # evaluator
92
+ val_evaluator = dict(metric=['bbox', 'segm'])
93
+ test_evaluator = val_evaluator
mmdet_code/SR-TOD/configs/boxinst/metafile.yml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Collections:
2
+ - Name: BoxInst
3
+ Metadata:
4
+ Training Data: COCO
5
+ Training Techniques:
6
+ - SGD with Momentum
7
+ - Weight Decay
8
+ Training Resources: 8x A100 GPUs
9
+ Architecture:
10
+ - ResNet
11
+ - FPN
12
+ - CondInst
13
+ Paper:
14
+ URL: https://arxiv.org/abs/2012.02310
15
+ Title: 'BoxInst: High-Performance Instance Segmentation with Box Annotations'
16
+ README: configs/boxinst/README.md
17
+ Code:
18
+ URL: https://github.com/open-mmlab/mmdetection/blob/v3.0.0rc6/mmdet/models/detectors/boxinst.py#L8
19
+ Version: v3.0.0rc6
20
+
21
+ Models:
22
+ - Name: boxinst_r50_fpn_ms-90k_coco
23
+ In Collection: BoxInst
24
+ Config: configs/boxinst/boxinst_r50_fpn_ms-90k_coco.py
25
+ Metadata:
26
+ Iterations: 90000
27
+ Results:
28
+ - Task: Object Detection
29
+ Dataset: COCO
30
+ Metrics:
31
+ box AP: 39.4
32
+ - Task: Instance Segmentation
33
+ Dataset: COCO
34
+ Metrics:
35
+ mask AP: 30.8
36
+ Weights: https://download.openmmlab.com/mmdetection/v3.0/boxinst/boxinst_r50_fpn_ms-90k_coco/boxinst_r50_fpn_ms-90k_coco_20221228_163052-6add751a.pth
37
+
38
+ - Name: boxinst_r101_fpn_ms-90k_coco
39
+ In Collection: BoxInst
40
+ Config: configs/boxinst/boxinst_r101_fpn_ms-90k_coco.py
41
+ Metadata:
42
+ Iterations: 90000
43
+ Results:
44
+ - Task: Object Detection
45
+ Dataset: COCO
46
+ Metrics:
47
+ box AP: 41.8
48
+ - Task: Instance Segmentation
49
+ Dataset: COCO
50
+ Metrics:
51
+ mask AP: 32.7
52
+ Weights: https://download.openmmlab.com/mmdetection/v3.0/boxinst/boxinst_r101_fpn_ms-90k_coco/boxinst_r101_fpn_ms-90k_coco_20221229_145106-facf375b.pth
mmdet_code/SR-TOD/configs/bytetrack/README.md ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ByteTrack: Multi-Object Tracking by Associating Every Detection Box
2
+
3
+ ## Abstract
4
+
5
+ <!-- [ABSTRACT] -->
6
+
7
+ Multi-object tracking (MOT) aims at estimating bounding boxes and identities of objects in videos. Most methods obtain identities by associating detection boxes whose scores are higher than a threshold. The objects with low detection scores, e.g. occluded objects, are simply thrown away, which brings non-negligible true object missing and fragmented trajectories. To solve this problem, we present a simple, effective and generic association method, tracking by associating every detection box instead of only the high score ones. For the low score detection boxes, we utilize their similarities with tracklets to recover true objects and filter out the background detections. When applied to 9 different state-of-the-art trackers, our method achieves consistent improvement on IDF1 score ranging from 1 to 10 points. To put forwards the state-of-the-art performance of MOT, we design a simple and strong tracker, named ByteTrack. For the first time, we achieve 80.3 MOTA, 77.3 IDF1 and 63.1 HOTA on the test set of MOT17 with 30 FPS running speed on a single V100 GPU.
8
+
9
+ <!-- [IMAGE] -->
10
+
11
+ <div align="center">
12
+ <img src="https://user-images.githubusercontent.com/26813582/147467498-b8d16d8c-8472-4830-8bac-b107c49f7c6f.png"/>
13
+ </div>
14
+
15
+ ## Citation
16
+
17
+ <!-- [ALGORITHM] -->
18
+
19
+ ```latex
20
+ @inproceedings{zhang2021bytetrack,
21
+ title={ByteTrack: Multi-Object Tracking by Associating Every Detection Box},
22
+ author={Zhang, Yifu and Sun, Peize and Jiang, Yi and Yu, Dongdong and Yuan, Zehuan and Luo, Ping and Liu, Wenyu and Wang, Xinggang},
23
+ journal={arXiv preprint arXiv:2110.06864},
24
+ year={2021}
25
+ }
26
+ ```
27
+
28
+ ## Results and models on MOT17
29
+
30
+ Please note that the performance on `MOT17-half-val` is comparable with the performance reported in the manuscript, while the performance on `MOT17-test` is lower than the performance reported in the manuscript.
31
+
32
+ The reason is that ByteTrack tunes customized hyper-parameters (e.g., image resolution and the high threshold of detection score) for each video in `MOT17-test` set, while we use unified parameters.
33
+
34
+ | Method | Detector | Train Set | Test Set | Public | Inf time (fps) | HOTA | MOTA | IDF1 | FP | FN | IDSw. | Config | Download |
35
+ | :-------: | :------: | :---------------------------: | :------------: | :----: | :------------: | :--: | :--: | :--: | :---: | :---: | :---: | :-------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
36
+ | ByteTrack | YOLOX-X | CrowdHuman + MOT17-half-train | MOT17-half-val | N | - | 67.5 | 78.6 | 78.5 | 12852 | 21060 | 672 | [config](bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py) | [model](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot17-private-half_20211218_205500-1985c9f0.pth) \| [log](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot17-private-half_20211218_205500.log.json) |
37
+ | ByteTrack | YOLOX-X | CrowdHuman + MOT17-half-train | MOT17-test | N | - | 61.7 | 78.1 | 74.8 | 36705 | 85032 | 2049 | [config](bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17test.py) | [model](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot17-private-half_20211218_205500-1985c9f0.pth) \| [log](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot17-private-half_20211218_205500.log.json) |
38
+
39
+ ## Results and models on MOT20
40
+
41
+ Since there are only 4 videos in `MOT20-train`, ByteTrack is validated on `MOT17-train` rather than `MOT20-half-train`.
42
+
43
+ Please note that the MOTA on `MOT20-test` is slightly lower than that reported in the manuscript, because we don't tune the threshold for each video.
44
+
45
+ | Method | Detector | Train Set | Test Set | Public | Inf time (fps) | HOTA | MOTA | IDF1 | FP | FN | IDSw. | Config | Download |
46
+ | :-------: | :------: | :----------------------: | :---------: | :----: | :------------: | :--: | :--: | :--: | :----: | :----: | :---: | :------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
47
+ | ByteTrack | YOLOX-X | CrowdHuman + MOT20-train | MOT17-train | N | - | 57.3 | 64.9 | 71.8 | 33,747 | 83,385 | 1,263 | [config](bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test.py) | [model](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot20-private_20220506_101040-9ce38a60.pth) \| [log](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot20-private_20220506_101040.log.json) |
48
+ | ByteTrack | YOLOX-X | CrowdHuman + MOT20-train | MOT20-test | N | - | 61.5 | 77.0 | 75.4 | 33,083 | 84,433 | 1,345 | [config](bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test.py) | [model](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot20-private_20220506_101040-9ce38a60.pth) \| [log](https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot20-private_20220506_101040.log.json) |
49
+
50
+ ## Get started
51
+
52
+ ### 1. Development Environment Setup
53
+
54
+ Tracking Development Environment Setup can refer to this [document](../../docs/en/get_started.md).
55
+
56
+ ### 2. Dataset Prepare
57
+
58
+ Tracking Dataset Prepare can refer to this [document](../../docs/en/user_guides/tracking_dataset_prepare.md).
59
+
60
+ ### 3. Training
61
+
62
+ Due to the influence of parameters such as learning rate in default configuration file, we recommend using 8 GPUs for training in order to reproduce accuracy. You can use the following command to start the training.
63
+
64
+ **3.1 Joint training and tracking**
65
+
66
+ Some algorithm like ByteTrack, OCSORT don't need reid model, so we provide joint training and tracking for convenient.
67
+
68
+ ```shell
69
+ # Training Bytetrack on crowdhuman and mot17-half-train dataset with following command
70
+ # The number after config file represents the number of GPUs used. Here we use 8 GPUs
71
+ bash tools/dist_train.sh configs/bytetrack/bytetrack_yolox_x_8xb4-80e_crowdhuman-mot17halftrain_test-mot17halfval.py 8
72
+ ```
73
+
74
+ **3.2 Separate training and tracking**
75
+
76
+ Of course, we provide train detector independently like SORT, DeepSORT, StrongSORT. Then use this detector to track.
77
+
78
+ ```shell
79
+ # Training Bytetrack on crowdhuman and mot17-half-train dataset with following command
80
+ # The number after config file represents the number of GPUs used. Here we use 8 GPUs
81
+ bash tools/dist_train.sh configs/bytetrack/yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py 8
82
+ ```
83
+
84
+ If you want to know about more detailed usage of `train.py/dist_train.sh/slurm_train.sh`,
85
+ please refer to this [document](../../docs/en/user_guides/tracking_train_test.md).
86
+
87
+ ### 4. Testing and evaluation
88
+
89
+ ### 4.1 Example on MOTxx-halfval dataset
90
+
91
+ **4.1.1 use joint trained detector to evaluating and testing**
92
+
93
+ ```shell
94
+ bash tools/dist_test_tracking.sh configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py 8 --checkpoint ${CHECKPOINT_FILE}
95
+ ```
96
+
97
+ **4.1.2 use separate trained detector to evaluating and testing**
98
+
99
+ ```shell
100
+ bash tools/dist_test_tracking.sh configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py 8 --detector ${CHECKPOINT_FILE}
101
+ ```
102
+
103
+ **4.1.3 use video_baesd to evaluating and testing**
104
+
105
+ we also provide two_ways(img_based or video_based) to evaluating and testing.
106
+ if you want to use video_based to evaluating and testing, you can modify config as follows
107
+
108
+ ```
109
+ val_dataloader = dict(
110
+ sampler=dict(type='DefaultSampler', shuffle=False, round_up=False))
111
+ ```
112
+
113
+ #### 4.2 Example on MOTxx-test dataset
114
+
115
+ If you want to get the results of the [MOT Challenge](https://motchallenge.net/) test set, please use the following command to generate result files that can be used for submission. It will be stored in `./mot_17_test_res`, you can modify the saved path in `test_evaluator` of the config.
116
+
117
+ ```shell
118
+ bash tools/dist_test_tracking.sh configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17test.py 8 --checkpoint ${CHECKPOINT_FILE}
119
+ ```
120
+
121
+ If you want to know about more detailed usage of `test_tracking.py/dist_test_tracking.sh/slurm_test_tracking.sh`,
122
+ please refer to this [document](../../docs/en/user_guides/tracking_train_test.md).
123
+
124
+ ### 5.Inference
125
+
126
+ Use a single GPU to predict a video and save it as a video.
127
+
128
+ ```shell
129
+ python demo/mot_demo.py demo/demo_mot.mp4 configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py --checkpoint ${CHECKPOINT_FILE} --out mot.mp4
130
+ ```
131
+
132
+ If you want to know about more detailed usage of `mot_demo.py`, please refer to this [document](../../docs/en/user_guides/tracking_inference.md).
mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-80e_crowdhuman-mot17halftrain_test-mot17halfval.py ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = ['../yolox/yolox_x_8xb8-300e_coco.py']
2
+
3
+ dataset_type = 'MOTChallengeDataset'
4
+ data_root = 'data/MOT17/'
5
+
6
+ img_scale = (1440, 800) # weight, height
7
+ batch_size = 4
8
+
9
+ detector = _base_.model
10
+ detector.pop('data_preprocessor')
11
+ detector.bbox_head.update(dict(num_classes=1))
12
+ detector.test_cfg.nms.update(dict(iou_threshold=0.7))
13
+ detector['init_cfg'] = dict(
14
+ type='Pretrained',
15
+ checkpoint= # noqa: E251
16
+ 'https://download.openmmlab.com/mmdetection/v2.0/yolox/yolox_x_8x8_300e_coco/yolox_x_8x8_300e_coco_20211126_140254-1ef88d67.pth' # noqa: E501
17
+ )
18
+ del _base_.model
19
+
20
+ model = dict(
21
+ type='ByteTrack',
22
+ data_preprocessor=dict(
23
+ type='TrackDataPreprocessor',
24
+ pad_size_divisor=32,
25
+ # in bytetrack, we provide joint train detector and evaluate tracking
26
+ # performance, use_det_processor means use independent detector
27
+ # data_preprocessor. of course, you can train detector independently
28
+ # like strongsort
29
+ use_det_processor=True,
30
+ batch_augments=[
31
+ dict(
32
+ type='BatchSyncRandomResize',
33
+ random_size_range=(576, 1024),
34
+ size_divisor=32,
35
+ interval=10)
36
+ ]),
37
+ detector=detector,
38
+ tracker=dict(
39
+ type='ByteTracker',
40
+ motion=dict(type='KalmanFilter'),
41
+ obj_score_thrs=dict(high=0.6, low=0.1),
42
+ init_track_thr=0.7,
43
+ weight_iou_with_det_scores=True,
44
+ match_iou_thrs=dict(high=0.1, low=0.5, tentative=0.3),
45
+ num_frames_retain=30))
46
+
47
+ train_pipeline = [
48
+ dict(
49
+ type='Mosaic',
50
+ img_scale=img_scale,
51
+ pad_val=114.0,
52
+ bbox_clip_border=False),
53
+ dict(
54
+ type='RandomAffine',
55
+ scaling_ratio_range=(0.1, 2),
56
+ border=(-img_scale[0] // 2, -img_scale[1] // 2),
57
+ bbox_clip_border=False),
58
+ dict(
59
+ type='MixUp',
60
+ img_scale=img_scale,
61
+ ratio_range=(0.8, 1.6),
62
+ pad_val=114.0,
63
+ bbox_clip_border=False),
64
+ dict(type='YOLOXHSVRandomAug'),
65
+ dict(type='RandomFlip', prob=0.5),
66
+ dict(
67
+ type='Resize',
68
+ scale=img_scale,
69
+ keep_ratio=True,
70
+ clip_object_border=False),
71
+ dict(type='Pad', size_divisor=32, pad_val=dict(img=(114.0, 114.0, 114.0))),
72
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(1, 1), keep_empty=False),
73
+ dict(type='PackDetInputs')
74
+ ]
75
+
76
+ test_pipeline = [
77
+ dict(
78
+ type='TransformBroadcaster',
79
+ transforms=[
80
+ dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
81
+ dict(type='Resize', scale=img_scale, keep_ratio=True),
82
+ dict(
83
+ type='Pad',
84
+ size_divisor=32,
85
+ pad_val=dict(img=(114.0, 114.0, 114.0))),
86
+ dict(type='LoadTrackAnnotations'),
87
+ ]),
88
+ dict(type='PackTrackInputs')
89
+ ]
90
+ train_dataloader = dict(
91
+ _delete_=True,
92
+ batch_size=batch_size,
93
+ num_workers=4,
94
+ persistent_workers=True,
95
+ pin_memory=True,
96
+ sampler=dict(type='DefaultSampler', shuffle=True),
97
+ dataset=dict(
98
+ type='MultiImageMixDataset',
99
+ dataset=dict(
100
+ type='ConcatDataset',
101
+ datasets=[
102
+ dict(
103
+ type='CocoDataset',
104
+ data_root='data/MOT17',
105
+ ann_file='annotations/half-train_cocoformat.json',
106
+ data_prefix=dict(img='train'),
107
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
108
+ metainfo=dict(classes=('pedestrian', )),
109
+ pipeline=[
110
+ dict(
111
+ type='LoadImageFromFile',
112
+ backend_args=_base_.backend_args),
113
+ dict(type='LoadAnnotations', with_bbox=True),
114
+ ]),
115
+ dict(
116
+ type='CocoDataset',
117
+ data_root='data/crowdhuman',
118
+ ann_file='annotations/crowdhuman_train.json',
119
+ data_prefix=dict(img='train'),
120
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
121
+ metainfo=dict(classes=('pedestrian', )),
122
+ pipeline=[
123
+ dict(
124
+ type='LoadImageFromFile',
125
+ backend_args=_base_.backend_args),
126
+ dict(type='LoadAnnotations', with_bbox=True),
127
+ ]),
128
+ dict(
129
+ type='CocoDataset',
130
+ data_root='data/crowdhuman',
131
+ ann_file='annotations/crowdhuman_val.json',
132
+ data_prefix=dict(img='val'),
133
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
134
+ metainfo=dict(classes=('pedestrian', )),
135
+ pipeline=[
136
+ dict(
137
+ type='LoadImageFromFile',
138
+ backend_args=_base_.backend_args),
139
+ dict(type='LoadAnnotations', with_bbox=True),
140
+ ]),
141
+ ]),
142
+ pipeline=train_pipeline))
143
+
144
+ val_dataloader = dict(
145
+ _delete_=True,
146
+ batch_size=1,
147
+ num_workers=2,
148
+ persistent_workers=True,
149
+ pin_memory=True,
150
+ drop_last=False,
151
+ # video_based
152
+ # sampler=dict(type='DefaultSampler', shuffle=False, round_up=False),
153
+ sampler=dict(type='TrackImgSampler'), # image_based
154
+ dataset=dict(
155
+ type=dataset_type,
156
+ data_root=data_root,
157
+ ann_file='annotations/half-val_cocoformat.json',
158
+ data_prefix=dict(img_path='train'),
159
+ test_mode=True,
160
+ pipeline=test_pipeline))
161
+ test_dataloader = val_dataloader
162
+
163
+ # optimizer
164
+ # default 8 gpu
165
+ base_lr = 0.001 / 8 * batch_size
166
+ optim_wrapper = dict(optimizer=dict(lr=base_lr))
167
+
168
+ # some hyper parameters
169
+ # training settings
170
+ max_epochs = 80
171
+ num_last_epochs = 10
172
+ interval = 5
173
+
174
+ train_cfg = dict(
175
+ type='EpochBasedTrainLoop',
176
+ max_epochs=max_epochs,
177
+ val_begin=70,
178
+ val_interval=1)
179
+
180
+ # learning policy
181
+ param_scheduler = [
182
+ dict(
183
+ # use quadratic formula to warm up 1 epochs
184
+ type='QuadraticWarmupLR',
185
+ by_epoch=True,
186
+ begin=0,
187
+ end=1,
188
+ convert_to_iter_based=True),
189
+ dict(
190
+ # use cosine lr from 1 to 70 epoch
191
+ type='CosineAnnealingLR',
192
+ eta_min=base_lr * 0.05,
193
+ begin=1,
194
+ T_max=max_epochs - num_last_epochs,
195
+ end=max_epochs - num_last_epochs,
196
+ by_epoch=True,
197
+ convert_to_iter_based=True),
198
+ dict(
199
+ # use fixed lr during last 10 epochs
200
+ type='ConstantLR',
201
+ by_epoch=True,
202
+ factor=1,
203
+ begin=max_epochs - num_last_epochs,
204
+ end=max_epochs,
205
+ )
206
+ ]
207
+
208
+ custom_hooks = [
209
+ dict(
210
+ type='YOLOXModeSwitchHook',
211
+ num_last_epochs=num_last_epochs,
212
+ priority=48),
213
+ dict(type='SyncNormHook', priority=48),
214
+ dict(
215
+ type='EMAHook',
216
+ ema_type='ExpMomentumEMA',
217
+ momentum=0.0001,
218
+ update_buffers=True,
219
+ priority=49)
220
+ ]
221
+
222
+ default_hooks = dict(
223
+ checkpoint=dict(
224
+ _delete_=True, type='CheckpointHook', interval=1, max_keep_ckpts=10),
225
+ visualization=dict(type='TrackVisualizationHook', draw=False))
226
+
227
+ vis_backends = [dict(type='LocalVisBackend')]
228
+ visualizer = dict(
229
+ type='TrackLocalVisualizer', vis_backends=vis_backends, name='visualizer')
230
+
231
+ # evaluator
232
+ val_evaluator = dict(
233
+ _delete_=True,
234
+ type='MOTChallengeMetric',
235
+ metric=['HOTA', 'CLEAR', 'Identity'],
236
+ postprocess_tracklet_cfg=[
237
+ dict(type='InterpolateTracklets', min_num_frames=5, max_num_frames=20)
238
+ ])
239
+ test_evaluator = val_evaluator
240
+
241
+ # NOTE: `auto_scale_lr` is for automatically scaling LR,
242
+ # USER SHOULD NOT CHANGE ITS VALUES.
243
+ # base_batch_size = (8 GPUs) x (4 samples per GPU)
244
+ auto_scale_lr = dict(base_batch_size=32)
245
+
246
+ del detector
247
+ del _base_.tta_model
248
+ del _base_.tta_pipeline
249
+ del _base_.train_dataset
mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-80e_crowdhuman-mot20train_test-mot20test.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ './bytetrack_yolox_x_8xb4-80e_crowdhuman-mot17halftrain_'
3
+ 'test-mot17halfval.py'
4
+ ]
5
+
6
+ dataset_type = 'MOTChallengeDataset'
7
+
8
+ img_scale = (1600, 896) # weight, height
9
+
10
+ model = dict(
11
+ data_preprocessor=dict(
12
+ type='TrackDataPreprocessor',
13
+ use_det_processor=True,
14
+ pad_size_divisor=32,
15
+ batch_augments=[
16
+ dict(type='BatchSyncRandomResize', random_size_range=(640, 1152))
17
+ ]),
18
+ tracker=dict(
19
+ weight_iou_with_det_scores=False,
20
+ match_iou_thrs=dict(high=0.3),
21
+ ))
22
+
23
+ train_pipeline = [
24
+ dict(
25
+ type='Mosaic',
26
+ img_scale=img_scale,
27
+ pad_val=114.0,
28
+ bbox_clip_border=True),
29
+ dict(
30
+ type='RandomAffine',
31
+ scaling_ratio_range=(0.1, 2),
32
+ border=(-img_scale[0] // 2, -img_scale[1] // 2),
33
+ bbox_clip_border=True),
34
+ dict(
35
+ type='MixUp',
36
+ img_scale=img_scale,
37
+ ratio_range=(0.8, 1.6),
38
+ pad_val=114.0,
39
+ bbox_clip_border=True),
40
+ dict(type='YOLOXHSVRandomAug'),
41
+ dict(type='RandomFlip', prob=0.5),
42
+ dict(
43
+ type='Resize',
44
+ scale=img_scale,
45
+ keep_ratio=True,
46
+ clip_object_border=True),
47
+ dict(type='Pad', size_divisor=32, pad_val=dict(img=(114.0, 114.0, 114.0))),
48
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(1, 1), keep_empty=False),
49
+ dict(type='PackDetInputs')
50
+ ]
51
+
52
+ test_pipeline = [
53
+ dict(
54
+ type='TransformBroadcaster',
55
+ transforms=[
56
+ dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
57
+ dict(type='Resize', scale=img_scale, keep_ratio=True),
58
+ dict(
59
+ type='Pad',
60
+ size_divisor=32,
61
+ pad_val=dict(img=(114.0, 114.0, 114.0))),
62
+ dict(type='LoadTrackAnnotations'),
63
+ ]),
64
+ dict(type='PackTrackInputs')
65
+ ]
66
+ train_dataloader = dict(
67
+ dataset=dict(
68
+ type='MultiImageMixDataset',
69
+ dataset=dict(
70
+ type='ConcatDataset',
71
+ datasets=[
72
+ dict(
73
+ type='CocoDataset',
74
+ data_root='data/MOT20',
75
+ ann_file='annotations/train_cocoformat.json',
76
+ # TODO: mmdet use img as key, but img_path is needed
77
+ data_prefix=dict(img='train'),
78
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
79
+ metainfo=dict(classes=('pedestrian', )),
80
+ pipeline=[
81
+ dict(
82
+ type='LoadImageFromFile',
83
+ backend_args=_base_.backend_args),
84
+ dict(type='LoadAnnotations', with_bbox=True),
85
+ ]),
86
+ dict(
87
+ type='CocoDataset',
88
+ data_root='data/crowdhuman',
89
+ ann_file='annotations/crowdhuman_train.json',
90
+ data_prefix=dict(img='train'),
91
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
92
+ metainfo=dict(classes=('pedestrian', )),
93
+ pipeline=[
94
+ dict(
95
+ type='LoadImageFromFile',
96
+ backend_args=_base_.backend_args),
97
+ dict(type='LoadAnnotations', with_bbox=True),
98
+ ]),
99
+ dict(
100
+ type='CocoDataset',
101
+ data_root='data/crowdhuman',
102
+ ann_file='annotations/crowdhuman_val.json',
103
+ data_prefix=dict(img='val'),
104
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
105
+ metainfo=dict(classes=('pedestrian', )),
106
+ pipeline=[
107
+ dict(
108
+ type='LoadImageFromFile',
109
+ backend_args=_base_.backend_args),
110
+ dict(type='LoadAnnotations', with_bbox=True),
111
+ ]),
112
+ ]),
113
+ pipeline=train_pipeline))
114
+ val_dataloader = dict(
115
+ dataset=dict(ann_file='annotations/train_cocoformat.json'))
116
+
117
+ test_dataloader = dict(
118
+ dataset=dict(
119
+ data_root='data/MOT20', ann_file='annotations/test_cocoformat.json'))
120
+
121
+ test_evaluator = dict(
122
+ type='MOTChallengeMetrics',
123
+ postprocess_tracklet_cfg=[
124
+ dict(type='InterpolateTracklets', min_num_frames=5, max_num_frames=20)
125
+ ],
126
+ format_only=True,
127
+ outfile_prefix='./mot_20_test_res')
mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ './bytetrack_yolox_x_8xb4-80e_crowdhuman-mot17halftrain_'
3
+ 'test-mot17halfval.py'
4
+ ]
5
+
6
+ # fp16 settings
7
+ optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic')
8
+ val_cfg = dict(type='ValLoop', fp16=True)
9
+ test_cfg = dict(type='TestLoop', fp16=True)
mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17test.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ './bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-'
3
+ 'mot17halftrain_test-mot17halfval.py'
4
+ ]
5
+
6
+ test_dataloader = dict(
7
+ dataset=dict(
8
+ data_root='data/MOT17/',
9
+ ann_file='annotations/test_cocoformat.json',
10
+ data_prefix=dict(img_path='test')))
11
+ test_evaluator = dict(
12
+ type='MOTChallengeMetrics',
13
+ postprocess_tracklet_cfg=[
14
+ dict(type='InterpolateTracklets', min_num_frames=5, max_num_frames=20)
15
+ ],
16
+ format_only=True,
17
+ outfile_prefix='./mot_17_test_res')
mmdet_code/SR-TOD/configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ './bytetrack_yolox_x_8xb4-80e_crowdhuman-mot20train_test-mot20test.py'
3
+ ]
4
+
5
+ # fp16 settings
6
+ optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic')
7
+ val_cfg = dict(type='ValLoop', fp16=True)
8
+ test_cfg = dict(type='TestLoop', fp16=True)
mmdet_code/SR-TOD/configs/bytetrack/metafile.yml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Collections:
2
+ - Name: ByteTrack
3
+ Metadata:
4
+ Training Techniques:
5
+ - SGD with Momentum
6
+ Training Resources: 8x V100 GPUs
7
+ Architecture:
8
+ - YOLOX
9
+ Paper:
10
+ URL: https://arxiv.org/abs/2110.06864
11
+ Title: ByteTrack Multi-Object Tracking by Associating Every Detection Box
12
+ README: configs/bytetrack/README.md
13
+
14
+ Models:
15
+ - Name: bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval
16
+ In Collection: ByteTrack
17
+ Config: configs/bytetrack/bytetrack_yolox_x_8xb4-80e_crowdhuman-mot17halftrain_test-mot17halfval.py
18
+ Metadata:
19
+ Training Data: CrowdHuman + MOT17-half-train
20
+ Results:
21
+ - Task: Multiple Object Tracking
22
+ Dataset: MOT17-half-val
23
+ Metrics:
24
+ HOTA: 67.5
25
+ MOTA: 78.6
26
+ IDF1: 78.5
27
+ Weights: https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot17-private-half_20211218_205500-1985c9f0.pth
28
+
29
+ - Name: bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17test
30
+ In Collection: ByteTrack
31
+ Config: configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17test.py
32
+ Metadata:
33
+ Training Data: CrowdHuman + MOT17-half-train
34
+ Results:
35
+ - Task: Multiple Object Tracking
36
+ Dataset: MOT17-test
37
+ Metrics:
38
+ MOTA: 78.1
39
+ IDF1: 74.8
40
+ Weights: https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot17-private-half_20211218_205500-1985c9f0.pth
41
+
42
+ - Name: bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test
43
+ In Collection: ByteTrack
44
+ Config: configs/bytetrack/bytetrack_yolox_x_8xb4-amp-80e_crowdhuman-mot20train_test-mot20test.py
45
+ Metadata:
46
+ Training Data: CrowdHuman + MOT20-train
47
+ Results:
48
+ - Task: Multiple Object Tracking
49
+ Dataset: MOT20-test
50
+ Metrics:
51
+ MOTA: 77.0
52
+ IDF1: 75.4
53
+ Weights: https://download.openmmlab.com/mmtracking/mot/bytetrack/bytetrack_yolox_x/bytetrack_yolox_x_crowdhuman_mot20-private_20220506_101040-9ce38a60.pth
mmdet_code/SR-TOD/configs/bytetrack/yolox_x_8xb4-amp-80e_crowdhuman-mot17halftrain_test-mot17halfval.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ '../strongsort/yolox_x_8xb4-80e_crowdhuman-mot17halftrain_test-mot17halfval.py' # noqa: E501
3
+ ]
4
+
5
+ # fp16 settings
6
+ optim_wrapper = dict(type='AmpOptimWrapper', loss_scale='dynamic')
mmdet_code/SR-TOD/configs/carafe/README.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CARAFE
2
+
3
+ > [CARAFE: Content-Aware ReAssembly of FEatures](https://arxiv.org/abs/1905.02188)
4
+
5
+ <!-- [ALGORITHM] -->
6
+
7
+ ## Abstract
8
+
9
+ Feature upsampling is a key operation in a number of modern convolutional network architectures, e.g. feature pyramids. Its design is critical for dense prediction tasks such as object detection and semantic/instance segmentation. In this work, we propose Content-Aware ReAssembly of FEatures (CARAFE), a universal, lightweight and highly effective operator to fulfill this goal. CARAFE has several appealing properties: (1) Large field of view. Unlike previous works (e.g. bilinear interpolation) that only exploit sub-pixel neighborhood, CARAFE can aggregate contextual information within a large receptive field. (2) Content-aware handling. Instead of using a fixed kernel for all samples (e.g. deconvolution), CARAFE enables instance-specific content-aware handling, which generates adaptive kernels on-the-fly. (3) Lightweight and fast to compute. CARAFE introduces little computational overhead and can be readily integrated into modern network architectures. We conduct comprehensive evaluations on standard benchmarks in object detection, instance/semantic segmentation and inpainting. CARAFE shows consistent and substantial gains across all the tasks (1.2%, 1.3%, 1.8%, 1.1db respectively) with negligible computational overhead. It has great potential to serve as a strong building block for future research. It has great potential to serve as a strong building block for future research.
10
+
11
+ <div align=center>
12
+ <img src="https://user-images.githubusercontent.com/40661020/143872016-48225685-0e59-49cf-bd65-a50ee04ca8a2.png"/>
13
+ </div>
14
+
15
+ ## Results and Models
16
+
17
+ The results on COCO 2017 val is shown in the below table.
18
+
19
+ | Method | Backbone | Style | Lr schd | Test Proposal Num | Inf time (fps) | Box AP | Mask AP | Config | Download |
20
+ | :--------------------: | :------: | :-----: | :-----: | :---------------: | :------------: | :----: | :-----: | :-----------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
21
+ | Faster R-CNN w/ CARAFE | R-50-FPN | pytorch | 1x | 1000 | 16.5 | 38.6 | 38.6 | [config](./faster-rcnn_r50_fpn-carafe_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/carafe/faster_rcnn_r50_fpn_carafe_1x_coco/faster_rcnn_r50_fpn_carafe_1x_coco_bbox_mAP-0.386_20200504_175733-385a75b7.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/carafe/faster_rcnn_r50_fpn_carafe_1x_coco/faster_rcnn_r50_fpn_carafe_1x_coco_20200504_175733.log.json) |
22
+ | - | - | - | - | 2000 | | | | | |
23
+ | Mask R-CNN w/ CARAFE | R-50-FPN | pytorch | 1x | 1000 | 14.0 | 39.3 | 35.8 | [config](./mask-rcnn_r50_fpn-carafe_1x_coco.py) | [model](https://download.openmmlab.com/mmdetection/v2.0/carafe/mask_rcnn_r50_fpn_carafe_1x_coco/mask_rcnn_r50_fpn_carafe_1x_coco_bbox_mAP-0.393__segm_mAP-0.358_20200503_135957-8687f195.pth) \| [log](https://download.openmmlab.com/mmdetection/v2.0/carafe/mask_rcnn_r50_fpn_carafe_1x_coco/mask_rcnn_r50_fpn_carafe_1x_coco_20200503_135957.log.json) |
24
+ | - | - | - | - | 2000 | | | | | |
25
+
26
+ ## Implementation
27
+
28
+ The CUDA implementation of CARAFE can be find at https://github.com/myownskyW7/CARAFE.
29
+
30
+ ## Citation
31
+
32
+ We provide config files to reproduce the object detection & instance segmentation results in the ICCV 2019 Oral paper for [CARAFE: Content-Aware ReAssembly of FEatures](https://arxiv.org/abs/1905.02188).
33
+
34
+ ```latex
35
+ @inproceedings{Wang_2019_ICCV,
36
+ title = {CARAFE: Content-Aware ReAssembly of FEatures},
37
+ author = {Wang, Jiaqi and Chen, Kai and Xu, Rui and Liu, Ziwei and Loy, Chen Change and Lin, Dahua},
38
+ booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
39
+ month = {October},
40
+ year = {2019}
41
+ }
42
+ ```
mmdet_code/SR-TOD/configs/carafe/faster-rcnn_r50_fpn-carafe_1x_coco.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py'
2
+ model = dict(
3
+ data_preprocessor=dict(pad_size_divisor=64),
4
+ neck=dict(
5
+ type='FPN_CARAFE',
6
+ in_channels=[256, 512, 1024, 2048],
7
+ out_channels=256,
8
+ num_outs=5,
9
+ start_level=0,
10
+ end_level=-1,
11
+ norm_cfg=None,
12
+ act_cfg=None,
13
+ order=('conv', 'norm', 'act'),
14
+ upsample_cfg=dict(
15
+ type='carafe',
16
+ up_kernel=5,
17
+ up_group=1,
18
+ encoder_kernel=3,
19
+ encoder_dilation=1,
20
+ compressed_channels=64)))