Spaces:
Runtime error
Runtime error
onuralpszr
commited on
Commit
•
b291f6a
1
Parent(s):
7b2c66b
feat: ✨ YOLO-World-Seg files uploaded
Browse filesSigned-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This view is limited to 50 files because it contains too many changes.
See raw diff
- .DS_Store +0 -0
- LICENSE +1347 -0
- app.py +10 -1
- assets/yolo_arch.png +0 -0
- assets/yolo_logo.png +0 -0
- configs/finetune_coco/yolo_world_l_dual_vlpan_2e-4_80e_8gpus_finetune_coco.py +184 -0
- configs/finetune_coco/yolo_world_l_efficient_neck_2e-4_80e_8gpus_finetune_coco.py +161 -0
- configs/pretrain/yolo_world_l_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py +172 -0
- configs/pretrain/yolo_world_l_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_val.py +172 -0
- configs/pretrain/yolo_world_m_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py +172 -0
- configs/pretrain/yolo_world_s_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py +172 -0
- configs/pretrain/yolo_world_x_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py +172 -0
- configs/segmentation/yolo_world_seg_l_dual_vlpan_2e-4_80e_8gpus_allmodules_finetune_lvis.py +226 -0
- configs/segmentation/yolo_world_seg_l_dual_vlpan_2e-4_80e_8gpus_seghead_finetune_lvis.py +237 -0
- configs/segmentation/yolo_world_seg_m_dual_vlpan_2e-4_80e_8gpus_allmodules_finetune_lvis.py +226 -0
- configs/segmentation/yolo_world_seg_m_dual_vlpan_2e-4_80e_8gpus_seghead_finetune_lvis.py +237 -0
- data/texts/coco_class_texts.json +1 -0
- data/texts/lvis_v1_class_texts.json +1 -0
- data/texts/obj365v1_class_texts.json +1 -0
- pyproject.toml +56 -0
- requirements.txt +6 -12
- third_party/mmyolo/.circleci/config.yml +34 -0
- third_party/mmyolo/.circleci/docker/Dockerfile +11 -0
- third_party/mmyolo/.circleci/test.yml +213 -0
- third_party/mmyolo/.dev_scripts/gather_models.py +312 -0
- third_party/mmyolo/.dev_scripts/print_registers.py +448 -0
- third_party/mmyolo/.github/CODE_OF_CONDUCT.md +76 -0
- third_party/mmyolo/.github/CONTRIBUTING.md +1 -0
- third_party/mmyolo/.github/ISSUE_TEMPLATE/1-bug-report.yml +67 -0
- third_party/mmyolo/.github/ISSUE_TEMPLATE/2-feature-request.yml +32 -0
- third_party/mmyolo/.github/ISSUE_TEMPLATE/3-new-model.yml +30 -0
- third_party/mmyolo/.github/ISSUE_TEMPLATE/4-documentation.yml +22 -0
- third_party/mmyolo/.github/ISSUE_TEMPLATE/5-reimplementation.yml +87 -0
- third_party/mmyolo/.github/ISSUE_TEMPLATE/config.yml +9 -0
- third_party/mmyolo/.github/pull_request_template.md +25 -0
- third_party/mmyolo/.github/workflows/deploy.yml +28 -0
- third_party/mmyolo/.gitignore +126 -0
- third_party/mmyolo/.pre-commit-config-zh-cn.yaml +60 -0
- third_party/mmyolo/.pre-commit-config.yaml +60 -0
- third_party/mmyolo/.readthedocs.yml +8 -0
- third_party/mmyolo/LICENSE +674 -0
- third_party/mmyolo/MANIFEST.in +6 -0
- third_party/mmyolo/README.md +428 -0
- third_party/mmyolo/README_zh-CN.md +468 -0
- third_party/mmyolo/configs/_base_/default_runtime.py +43 -0
- third_party/mmyolo/configs/_base_/det_p5_tta.py +58 -0
- third_party/mmyolo/configs/_base_/pose/coco.py +181 -0
- third_party/mmyolo/configs/deploy/base_dynamic.py +17 -0
- third_party/mmyolo/configs/deploy/base_static.py +23 -0
- third_party/mmyolo/configs/deploy/detection_onnxruntime_dynamic.py +15 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
LICENSE
ADDED
@@ -0,0 +1,1347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
635 |
+
Copyright (C) <year> <name of author>
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU General Public License
|
648 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If the program does terminal interaction, make it output a short
|
653 |
+
notice like this when it starts in an interactive mode:
|
654 |
+
|
655 |
+
<program> Copyright (C) <year> <name of author>
|
656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
+
This is free software, and you are welcome to redistribute it
|
658 |
+
under certain conditions; type `show c' for details.
|
659 |
+
|
660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
+
parts of the General Public License. Of course, your program's commands
|
662 |
+
might be different; for a GUI interface, you would use an "about box".
|
663 |
+
|
664 |
+
You should also get your employer (if you work as a programmer) or school,
|
665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
+
<https://www.gnu.org/licenses/>.
|
668 |
+
|
669 |
+
The GNU General Public License does not permit incorporating your program
|
670 |
+
into proprietary programs. If your program is a subroutine library, you
|
671 |
+
may consider it more useful to permit linking proprietary applications with
|
672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
+
Public License instead of this License. But first, please read
|
674 |
+
<https://www.gnu.org/licenses/why-not-lgpl.html>. GNU GENERAL PUBLIC LICENSE
|
675 |
+
Version 3, 29 June 2007
|
676 |
+
|
677 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
678 |
+
Everyone is permitted to copy and distribute verbatim copies
|
679 |
+
of this license document, but changing it is not allowed.
|
680 |
+
|
681 |
+
Preamble
|
682 |
+
|
683 |
+
The GNU General Public License is a free, copyleft license for
|
684 |
+
software and other kinds of works.
|
685 |
+
|
686 |
+
The licenses for most software and other practical works are designed
|
687 |
+
to take away your freedom to share and change the works. By contrast,
|
688 |
+
the GNU General Public License is intended to guarantee your freedom to
|
689 |
+
share and change all versions of a program--to make sure it remains free
|
690 |
+
software for all its users. We, the Free Software Foundation, use the
|
691 |
+
GNU General Public License for most of our software; it applies also to
|
692 |
+
any other work released this way by its authors. You can apply it to
|
693 |
+
your programs, too.
|
694 |
+
|
695 |
+
When we speak of free software, we are referring to freedom, not
|
696 |
+
price. Our General Public Licenses are designed to make sure that you
|
697 |
+
have the freedom to distribute copies of free software (and charge for
|
698 |
+
them if you wish), that you receive source code or can get it if you
|
699 |
+
want it, that you can change the software or use pieces of it in new
|
700 |
+
free programs, and that you know you can do these things.
|
701 |
+
|
702 |
+
To protect your rights, we need to prevent others from denying you
|
703 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
704 |
+
certain responsibilities if you distribute copies of the software, or if
|
705 |
+
you modify it: responsibilities to respect the freedom of others.
|
706 |
+
|
707 |
+
For example, if you distribute copies of such a program, whether
|
708 |
+
gratis or for a fee, you must pass on to the recipients the same
|
709 |
+
freedoms that you received. You must make sure that they, too, receive
|
710 |
+
or can get the source code. And you must show them these terms so they
|
711 |
+
know their rights.
|
712 |
+
|
713 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
714 |
+
(1) assert copyright on the software, and (2) offer you this License
|
715 |
+
giving you legal permission to copy, distribute and/or modify it.
|
716 |
+
|
717 |
+
For the developers' and authors' protection, the GPL clearly explains
|
718 |
+
that there is no warranty for this free software. For both users' and
|
719 |
+
authors' sake, the GPL requires that modified versions be marked as
|
720 |
+
changed, so that their problems will not be attributed erroneously to
|
721 |
+
authors of previous versions.
|
722 |
+
|
723 |
+
Some devices are designed to deny users access to install or run
|
724 |
+
modified versions of the software inside them, although the manufacturer
|
725 |
+
can do so. This is fundamentally incompatible with the aim of
|
726 |
+
protecting users' freedom to change the software. The systematic
|
727 |
+
pattern of such abuse occurs in the area of products for individuals to
|
728 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
729 |
+
have designed this version of the GPL to prohibit the practice for those
|
730 |
+
products. If such problems arise substantially in other domains, we
|
731 |
+
stand ready to extend this provision to those domains in future versions
|
732 |
+
of the GPL, as needed to protect the freedom of users.
|
733 |
+
|
734 |
+
Finally, every program is threatened constantly by software patents.
|
735 |
+
States should not allow patents to restrict development and use of
|
736 |
+
software on general-purpose computers, but in those that do, we wish to
|
737 |
+
avoid the special danger that patents applied to a free program could
|
738 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
739 |
+
patents cannot be used to render the program non-free.
|
740 |
+
|
741 |
+
The precise terms and conditions for copying, distribution and
|
742 |
+
modification follow.
|
743 |
+
|
744 |
+
TERMS AND CONDITIONS
|
745 |
+
|
746 |
+
0. Definitions.
|
747 |
+
|
748 |
+
"This License" refers to version 3 of the GNU General Public License.
|
749 |
+
|
750 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
751 |
+
works, such as semiconductor masks.
|
752 |
+
|
753 |
+
"The Program" refers to any copyrightable work licensed under this
|
754 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
755 |
+
"recipients" may be individuals or organizations.
|
756 |
+
|
757 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
758 |
+
in a fashion requiring copyright permission, other than the making of an
|
759 |
+
exact copy. The resulting work is called a "modified version" of the
|
760 |
+
earlier work or a work "based on" the earlier work.
|
761 |
+
|
762 |
+
A "covered work" means either the unmodified Program or a work based
|
763 |
+
on the Program.
|
764 |
+
|
765 |
+
To "propagate" a work means to do anything with it that, without
|
766 |
+
permission, would make you directly or secondarily liable for
|
767 |
+
infringement under applicable copyright law, except executing it on a
|
768 |
+
computer or modifying a private copy. Propagation includes copying,
|
769 |
+
distribution (with or without modification), making available to the
|
770 |
+
public, and in some countries other activities as well.
|
771 |
+
|
772 |
+
To "convey" a work means any kind of propagation that enables other
|
773 |
+
parties to make or receive copies. Mere interaction with a user through
|
774 |
+
a computer network, with no transfer of a copy, is not conveying.
|
775 |
+
|
776 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
777 |
+
to the extent that it includes a convenient and prominently visible
|
778 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
779 |
+
tells the user that there is no warranty for the work (except to the
|
780 |
+
extent that warranties are provided), that licensees may convey the
|
781 |
+
work under this License, and how to view a copy of this License. If
|
782 |
+
the interface presents a list of user commands or options, such as a
|
783 |
+
menu, a prominent item in the list meets this criterion.
|
784 |
+
|
785 |
+
1. Source Code.
|
786 |
+
|
787 |
+
The "source code" for a work means the preferred form of the work
|
788 |
+
for making modifications to it. "Object code" means any non-source
|
789 |
+
form of a work.
|
790 |
+
|
791 |
+
A "Standard Interface" means an interface that either is an official
|
792 |
+
standard defined by a recognized standards body, or, in the case of
|
793 |
+
interfaces specified for a particular programming language, one that
|
794 |
+
is widely used among developers working in that language.
|
795 |
+
|
796 |
+
The "System Libraries" of an executable work include anything, other
|
797 |
+
than the work as a whole, that (a) is included in the normal form of
|
798 |
+
packaging a Major Component, but which is not part of that Major
|
799 |
+
Component, and (b) serves only to enable use of the work with that
|
800 |
+
Major Component, or to implement a Standard Interface for which an
|
801 |
+
implementation is available to the public in source code form. A
|
802 |
+
"Major Component", in this context, means a major essential component
|
803 |
+
(kernel, window system, and so on) of the specific operating system
|
804 |
+
(if any) on which the executable work runs, or a compiler used to
|
805 |
+
produce the work, or an object code interpreter used to run it.
|
806 |
+
|
807 |
+
The "Corresponding Source" for a work in object code form means all
|
808 |
+
the source code needed to generate, install, and (for an executable
|
809 |
+
work) run the object code and to modify the work, including scripts to
|
810 |
+
control those activities. However, it does not include the work's
|
811 |
+
System Libraries, or general-purpose tools or generally available free
|
812 |
+
programs which are used unmodified in performing those activities but
|
813 |
+
which are not part of the work. For example, Corresponding Source
|
814 |
+
includes interface definition files associated with source files for
|
815 |
+
the work, and the source code for shared libraries and dynamically
|
816 |
+
linked subprograms that the work is specifically designed to require,
|
817 |
+
such as by intimate data communication or control flow between those
|
818 |
+
subprograms and other parts of the work.
|
819 |
+
|
820 |
+
The Corresponding Source need not include anything that users
|
821 |
+
can regenerate automatically from other parts of the Corresponding
|
822 |
+
Source.
|
823 |
+
|
824 |
+
The Corresponding Source for a work in source code form is that
|
825 |
+
same work.
|
826 |
+
|
827 |
+
2. Basic Permissions.
|
828 |
+
|
829 |
+
All rights granted under this License are granted for the term of
|
830 |
+
copyright on the Program, and are irrevocable provided the stated
|
831 |
+
conditions are met. This License explicitly affirms your unlimited
|
832 |
+
permission to run the unmodified Program. The output from running a
|
833 |
+
covered work is covered by this License only if the output, given its
|
834 |
+
content, constitutes a covered work. This License acknowledges your
|
835 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
836 |
+
|
837 |
+
You may make, run and propagate covered works that you do not
|
838 |
+
convey, without conditions so long as your license otherwise remains
|
839 |
+
in force. You may convey covered works to others for the sole purpose
|
840 |
+
of having them make modifications exclusively for you, or provide you
|
841 |
+
with facilities for running those works, provided that you comply with
|
842 |
+
the terms of this License in conveying all material for which you do
|
843 |
+
not control copyright. Those thus making or running the covered works
|
844 |
+
for you must do so exclusively on your behalf, under your direction
|
845 |
+
and control, on terms that prohibit them from making any copies of
|
846 |
+
your copyrighted material outside their relationship with you.
|
847 |
+
|
848 |
+
Conveying under any other circumstances is permitted solely under
|
849 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
850 |
+
makes it unnecessary.
|
851 |
+
|
852 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
853 |
+
|
854 |
+
No covered work shall be deemed part of an effective technological
|
855 |
+
measure under any applicable law fulfilling obligations under article
|
856 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
857 |
+
similar laws prohibiting or restricting circumvention of such
|
858 |
+
measures.
|
859 |
+
|
860 |
+
When you convey a covered work, you waive any legal power to forbid
|
861 |
+
circumvention of technological measures to the extent such circumvention
|
862 |
+
is effected by exercising rights under this License with respect to
|
863 |
+
the covered work, and you disclaim any intention to limit operation or
|
864 |
+
modification of the work as a means of enforcing, against the work's
|
865 |
+
users, your or third parties' legal rights to forbid circumvention of
|
866 |
+
technological measures.
|
867 |
+
|
868 |
+
4. Conveying Verbatim Copies.
|
869 |
+
|
870 |
+
You may convey verbatim copies of the Program's source code as you
|
871 |
+
receive it, in any medium, provided that you conspicuously and
|
872 |
+
appropriately publish on each copy an appropriate copyright notice;
|
873 |
+
keep intact all notices stating that this License and any
|
874 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
875 |
+
keep intact all notices of the absence of any warranty; and give all
|
876 |
+
recipients a copy of this License along with the Program.
|
877 |
+
|
878 |
+
You may charge any price or no price for each copy that you convey,
|
879 |
+
and you may offer support or warranty protection for a fee.
|
880 |
+
|
881 |
+
5. Conveying Modified Source Versions.
|
882 |
+
|
883 |
+
You may convey a work based on the Program, or the modifications to
|
884 |
+
produce it from the Program, in the form of source code under the
|
885 |
+
terms of section 4, provided that you also meet all of these conditions:
|
886 |
+
|
887 |
+
a) The work must carry prominent notices stating that you modified
|
888 |
+
it, and giving a relevant date.
|
889 |
+
|
890 |
+
b) The work must carry prominent notices stating that it is
|
891 |
+
released under this License and any conditions added under section
|
892 |
+
7. This requirement modifies the requirement in section 4 to
|
893 |
+
"keep intact all notices".
|
894 |
+
|
895 |
+
c) You must license the entire work, as a whole, under this
|
896 |
+
License to anyone who comes into possession of a copy. This
|
897 |
+
License will therefore apply, along with any applicable section 7
|
898 |
+
additional terms, to the whole of the work, and all its parts,
|
899 |
+
regardless of how they are packaged. This License gives no
|
900 |
+
permission to license the work in any other way, but it does not
|
901 |
+
invalidate such permission if you have separately received it.
|
902 |
+
|
903 |
+
d) If the work has interactive user interfaces, each must display
|
904 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
905 |
+
interfaces that do not display Appropriate Legal Notices, your
|
906 |
+
work need not make them do so.
|
907 |
+
|
908 |
+
A compilation of a covered work with other separate and independent
|
909 |
+
works, which are not by their nature extensions of the covered work,
|
910 |
+
and which are not combined with it such as to form a larger program,
|
911 |
+
in or on a volume of a storage or distribution medium, is called an
|
912 |
+
"aggregate" if the compilation and its resulting copyright are not
|
913 |
+
used to limit the access or legal rights of the compilation's users
|
914 |
+
beyond what the individual works permit. Inclusion of a covered work
|
915 |
+
in an aggregate does not cause this License to apply to the other
|
916 |
+
parts of the aggregate.
|
917 |
+
|
918 |
+
6. Conveying Non-Source Forms.
|
919 |
+
|
920 |
+
You may convey a covered work in object code form under the terms
|
921 |
+
of sections 4 and 5, provided that you also convey the
|
922 |
+
machine-readable Corresponding Source under the terms of this License,
|
923 |
+
in one of these ways:
|
924 |
+
|
925 |
+
a) Convey the object code in, or embodied in, a physical product
|
926 |
+
(including a physical distribution medium), accompanied by the
|
927 |
+
Corresponding Source fixed on a durable physical medium
|
928 |
+
customarily used for software interchange.
|
929 |
+
|
930 |
+
b) Convey the object code in, or embodied in, a physical product
|
931 |
+
(including a physical distribution medium), accompanied by a
|
932 |
+
written offer, valid for at least three years and valid for as
|
933 |
+
long as you offer spare parts or customer support for that product
|
934 |
+
model, to give anyone who possesses the object code either (1) a
|
935 |
+
copy of the Corresponding Source for all the software in the
|
936 |
+
product that is covered by this License, on a durable physical
|
937 |
+
medium customarily used for software interchange, for a price no
|
938 |
+
more than your reasonable cost of physically performing this
|
939 |
+
conveying of source, or (2) access to copy the
|
940 |
+
Corresponding Source from a network server at no charge.
|
941 |
+
|
942 |
+
c) Convey individual copies of the object code with a copy of the
|
943 |
+
written offer to provide the Corresponding Source. This
|
944 |
+
alternative is allowed only occasionally and noncommercially, and
|
945 |
+
only if you received the object code with such an offer, in accord
|
946 |
+
with subsection 6b.
|
947 |
+
|
948 |
+
d) Convey the object code by offering access from a designated
|
949 |
+
place (gratis or for a charge), and offer equivalent access to the
|
950 |
+
Corresponding Source in the same way through the same place at no
|
951 |
+
further charge. You need not require recipients to copy the
|
952 |
+
Corresponding Source along with the object code. If the place to
|
953 |
+
copy the object code is a network server, the Corresponding Source
|
954 |
+
may be on a different server (operated by you or a third party)
|
955 |
+
that supports equivalent copying facilities, provided you maintain
|
956 |
+
clear directions next to the object code saying where to find the
|
957 |
+
Corresponding Source. Regardless of what server hosts the
|
958 |
+
Corresponding Source, you remain obligated to ensure that it is
|
959 |
+
available for as long as needed to satisfy these requirements.
|
960 |
+
|
961 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
962 |
+
you inform other peers where the object code and Corresponding
|
963 |
+
Source of the work are being offered to the general public at no
|
964 |
+
charge under subsection 6d.
|
965 |
+
|
966 |
+
A separable portion of the object code, whose source code is excluded
|
967 |
+
from the Corresponding Source as a System Library, need not be
|
968 |
+
included in conveying the object code work.
|
969 |
+
|
970 |
+
A "User Product" is either (1) a "consumer product", which means any
|
971 |
+
tangible personal property which is normally used for personal, family,
|
972 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
973 |
+
into a dwelling. In determining whether a product is a consumer product,
|
974 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
975 |
+
product received by a particular user, "normally used" refers to a
|
976 |
+
typical or common use of that class of product, regardless of the status
|
977 |
+
of the particular user or of the way in which the particular user
|
978 |
+
actually uses, or expects or is expected to use, the product. A product
|
979 |
+
is a consumer product regardless of whether the product has substantial
|
980 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
981 |
+
the only significant mode of use of the product.
|
982 |
+
|
983 |
+
"Installation Information" for a User Product means any methods,
|
984 |
+
procedures, authorization keys, or other information required to install
|
985 |
+
and execute modified versions of a covered work in that User Product from
|
986 |
+
a modified version of its Corresponding Source. The information must
|
987 |
+
suffice to ensure that the continued functioning of the modified object
|
988 |
+
code is in no case prevented or interfered with solely because
|
989 |
+
modification has been made.
|
990 |
+
|
991 |
+
If you convey an object code work under this section in, or with, or
|
992 |
+
specifically for use in, a User Product, and the conveying occurs as
|
993 |
+
part of a transaction in which the right of possession and use of the
|
994 |
+
User Product is transferred to the recipient in perpetuity or for a
|
995 |
+
fixed term (regardless of how the transaction is characterized), the
|
996 |
+
Corresponding Source conveyed under this section must be accompanied
|
997 |
+
by the Installation Information. But this requirement does not apply
|
998 |
+
if neither you nor any third party retains the ability to install
|
999 |
+
modified object code on the User Product (for example, the work has
|
1000 |
+
been installed in ROM).
|
1001 |
+
|
1002 |
+
The requirement to provide Installation Information does not include a
|
1003 |
+
requirement to continue to provide support service, warranty, or updates
|
1004 |
+
for a work that has been modified or installed by the recipient, or for
|
1005 |
+
the User Product in which it has been modified or installed. Access to a
|
1006 |
+
network may be denied when the modification itself materially and
|
1007 |
+
adversely affects the operation of the network or violates the rules and
|
1008 |
+
protocols for communication across the network.
|
1009 |
+
|
1010 |
+
Corresponding Source conveyed, and Installation Information provided,
|
1011 |
+
in accord with this section must be in a format that is publicly
|
1012 |
+
documented (and with an implementation available to the public in
|
1013 |
+
source code form), and must require no special password or key for
|
1014 |
+
unpacking, reading or copying.
|
1015 |
+
|
1016 |
+
7. Additional Terms.
|
1017 |
+
|
1018 |
+
"Additional permissions" are terms that supplement the terms of this
|
1019 |
+
License by making exceptions from one or more of its conditions.
|
1020 |
+
Additional permissions that are applicable to the entire Program shall
|
1021 |
+
be treated as though they were included in this License, to the extent
|
1022 |
+
that they are valid under applicable law. If additional permissions
|
1023 |
+
apply only to part of the Program, that part may be used separately
|
1024 |
+
under those permissions, but the entire Program remains governed by
|
1025 |
+
this License without regard to the additional permissions.
|
1026 |
+
|
1027 |
+
When you convey a copy of a covered work, you may at your option
|
1028 |
+
remove any additional permissions from that copy, or from any part of
|
1029 |
+
it. (Additional permissions may be written to require their own
|
1030 |
+
removal in certain cases when you modify the work.) You may place
|
1031 |
+
additional permissions on material, added by you to a covered work,
|
1032 |
+
for which you have or can give appropriate copyright permission.
|
1033 |
+
|
1034 |
+
Notwithstanding any other provision of this License, for material you
|
1035 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
1036 |
+
that material) supplement the terms of this License with terms:
|
1037 |
+
|
1038 |
+
a) Disclaiming warranty or limiting liability differently from the
|
1039 |
+
terms of sections 15 and 16 of this License; or
|
1040 |
+
|
1041 |
+
b) Requiring preservation of specified reasonable legal notices or
|
1042 |
+
author attributions in that material or in the Appropriate Legal
|
1043 |
+
Notices displayed by works containing it; or
|
1044 |
+
|
1045 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
1046 |
+
requiring that modified versions of such material be marked in
|
1047 |
+
reasonable ways as different from the original version; or
|
1048 |
+
|
1049 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
1050 |
+
authors of the material; or
|
1051 |
+
|
1052 |
+
e) Declining to grant rights under trademark law for use of some
|
1053 |
+
trade names, trademarks, or service marks; or
|
1054 |
+
|
1055 |
+
f) Requiring indemnification of licensors and authors of that
|
1056 |
+
material by anyone who conveys the material (or modified versions of
|
1057 |
+
it) with contractual assumptions of liability to the recipient, for
|
1058 |
+
any liability that these contractual assumptions directly impose on
|
1059 |
+
those licensors and authors.
|
1060 |
+
|
1061 |
+
All other non-permissive additional terms are considered "further
|
1062 |
+
restrictions" within the meaning of section 10. If the Program as you
|
1063 |
+
received it, or any part of it, contains a notice stating that it is
|
1064 |
+
governed by this License along with a term that is a further
|
1065 |
+
restriction, you may remove that term. If a license document contains
|
1066 |
+
a further restriction but permits relicensing or conveying under this
|
1067 |
+
License, you may add to a covered work material governed by the terms
|
1068 |
+
of that license document, provided that the further restriction does
|
1069 |
+
not survive such relicensing or conveying.
|
1070 |
+
|
1071 |
+
If you add terms to a covered work in accord with this section, you
|
1072 |
+
must place, in the relevant source files, a statement of the
|
1073 |
+
additional terms that apply to those files, or a notice indicating
|
1074 |
+
where to find the applicable terms.
|
1075 |
+
|
1076 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
1077 |
+
form of a separately written license, or stated as exceptions;
|
1078 |
+
the above requirements apply either way.
|
1079 |
+
|
1080 |
+
8. Termination.
|
1081 |
+
|
1082 |
+
You may not propagate or modify a covered work except as expressly
|
1083 |
+
provided under this License. Any attempt otherwise to propagate or
|
1084 |
+
modify it is void, and will automatically terminate your rights under
|
1085 |
+
this License (including any patent licenses granted under the third
|
1086 |
+
paragraph of section 11).
|
1087 |
+
|
1088 |
+
However, if you cease all violation of this License, then your
|
1089 |
+
license from a particular copyright holder is reinstated (a)
|
1090 |
+
provisionally, unless and until the copyright holder explicitly and
|
1091 |
+
finally terminates your license, and (b) permanently, if the copyright
|
1092 |
+
holder fails to notify you of the violation by some reasonable means
|
1093 |
+
prior to 60 days after the cessation.
|
1094 |
+
|
1095 |
+
Moreover, your license from a particular copyright holder is
|
1096 |
+
reinstated permanently if the copyright holder notifies you of the
|
1097 |
+
violation by some reasonable means, this is the first time you have
|
1098 |
+
received notice of violation of this License (for any work) from that
|
1099 |
+
copyright holder, and you cure the violation prior to 30 days after
|
1100 |
+
your receipt of the notice.
|
1101 |
+
|
1102 |
+
Termination of your rights under this section does not terminate the
|
1103 |
+
licenses of parties who have received copies or rights from you under
|
1104 |
+
this License. If your rights have been terminated and not permanently
|
1105 |
+
reinstated, you do not qualify to receive new licenses for the same
|
1106 |
+
material under section 10.
|
1107 |
+
|
1108 |
+
9. Acceptance Not Required for Having Copies.
|
1109 |
+
|
1110 |
+
You are not required to accept this License in order to receive or
|
1111 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
1112 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
1113 |
+
to receive a copy likewise does not require acceptance. However,
|
1114 |
+
nothing other than this License grants you permission to propagate or
|
1115 |
+
modify any covered work. These actions infringe copyright if you do
|
1116 |
+
not accept this License. Therefore, by modifying or propagating a
|
1117 |
+
covered work, you indicate your acceptance of this License to do so.
|
1118 |
+
|
1119 |
+
10. Automatic Licensing of Downstream Recipients.
|
1120 |
+
|
1121 |
+
Each time you convey a covered work, the recipient automatically
|
1122 |
+
receives a license from the original licensors, to run, modify and
|
1123 |
+
propagate that work, subject to this License. You are not responsible
|
1124 |
+
for enforcing compliance by third parties with this License.
|
1125 |
+
|
1126 |
+
An "entity transaction" is a transaction transferring control of an
|
1127 |
+
organization, or substantially all assets of one, or subdividing an
|
1128 |
+
organization, or merging organizations. If propagation of a covered
|
1129 |
+
work results from an entity transaction, each party to that
|
1130 |
+
transaction who receives a copy of the work also receives whatever
|
1131 |
+
licenses to the work the party's predecessor in interest had or could
|
1132 |
+
give under the previous paragraph, plus a right to possession of the
|
1133 |
+
Corresponding Source of the work from the predecessor in interest, if
|
1134 |
+
the predecessor has it or can get it with reasonable efforts.
|
1135 |
+
|
1136 |
+
You may not impose any further restrictions on the exercise of the
|
1137 |
+
rights granted or affirmed under this License. For example, you may
|
1138 |
+
not impose a license fee, royalty, or other charge for exercise of
|
1139 |
+
rights granted under this License, and you may not initiate litigation
|
1140 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
1141 |
+
any patent claim is infringed by making, using, selling, offering for
|
1142 |
+
sale, or importing the Program or any portion of it.
|
1143 |
+
|
1144 |
+
11. Patents.
|
1145 |
+
|
1146 |
+
A "contributor" is a copyright holder who authorizes use under this
|
1147 |
+
License of the Program or a work on which the Program is based. The
|
1148 |
+
work thus licensed is called the contributor's "contributor version".
|
1149 |
+
|
1150 |
+
A contributor's "essential patent claims" are all patent claims
|
1151 |
+
owned or controlled by the contributor, whether already acquired or
|
1152 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
1153 |
+
by this License, of making, using, or selling its contributor version,
|
1154 |
+
but do not include claims that would be infringed only as a
|
1155 |
+
consequence of further modification of the contributor version. For
|
1156 |
+
purposes of this definition, "control" includes the right to grant
|
1157 |
+
patent sublicenses in a manner consistent with the requirements of
|
1158 |
+
this License.
|
1159 |
+
|
1160 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
1161 |
+
patent license under the contributor's essential patent claims, to
|
1162 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
1163 |
+
propagate the contents of its contributor version.
|
1164 |
+
|
1165 |
+
In the following three paragraphs, a "patent license" is any express
|
1166 |
+
agreement or commitment, however denominated, not to enforce a patent
|
1167 |
+
(such as an express permission to practice a patent or covenant not to
|
1168 |
+
sue for patent infringement). To "grant" such a patent license to a
|
1169 |
+
party means to make such an agreement or commitment not to enforce a
|
1170 |
+
patent against the party.
|
1171 |
+
|
1172 |
+
If you convey a covered work, knowingly relying on a patent license,
|
1173 |
+
and the Corresponding Source of the work is not available for anyone
|
1174 |
+
to copy, free of charge and under the terms of this License, through a
|
1175 |
+
publicly available network server or other readily accessible means,
|
1176 |
+
then you must either (1) cause the Corresponding Source to be so
|
1177 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
1178 |
+
patent license for this particular work, or (3) arrange, in a manner
|
1179 |
+
consistent with the requirements of this License, to extend the patent
|
1180 |
+
license to downstream recipients. "Knowingly relying" means you have
|
1181 |
+
actual knowledge that, but for the patent license, your conveying the
|
1182 |
+
covered work in a country, or your recipient's use of the covered work
|
1183 |
+
in a country, would infringe one or more identifiable patents in that
|
1184 |
+
country that you have reason to believe are valid.
|
1185 |
+
|
1186 |
+
If, pursuant to or in connection with a single transaction or
|
1187 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
1188 |
+
covered work, and grant a patent license to some of the parties
|
1189 |
+
receiving the covered work authorizing them to use, propagate, modify
|
1190 |
+
or convey a specific copy of the covered work, then the patent license
|
1191 |
+
you grant is automatically extended to all recipients of the covered
|
1192 |
+
work and works based on it.
|
1193 |
+
|
1194 |
+
A patent license is "discriminatory" if it does not include within
|
1195 |
+
the scope of its coverage, prohibits the exercise of, or is
|
1196 |
+
conditioned on the non-exercise of one or more of the rights that are
|
1197 |
+
specifically granted under this License. You may not convey a covered
|
1198 |
+
work if you are a party to an arrangement with a third party that is
|
1199 |
+
in the business of distributing software, under which you make payment
|
1200 |
+
to the third party based on the extent of your activity of conveying
|
1201 |
+
the work, and under which the third party grants, to any of the
|
1202 |
+
parties who would receive the covered work from you, a discriminatory
|
1203 |
+
patent license (a) in connection with copies of the covered work
|
1204 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
1205 |
+
for and in connection with specific products or compilations that
|
1206 |
+
contain the covered work, unless you entered into that arrangement,
|
1207 |
+
or that patent license was granted, prior to 28 March 2007.
|
1208 |
+
|
1209 |
+
Nothing in this License shall be construed as excluding or limiting
|
1210 |
+
any implied license or other defenses to infringement that may
|
1211 |
+
otherwise be available to you under applicable patent law.
|
1212 |
+
|
1213 |
+
12. No Surrender of Others' Freedom.
|
1214 |
+
|
1215 |
+
If conditions are imposed on you (whether by court order, agreement or
|
1216 |
+
otherwise) that contradict the conditions of this License, they do not
|
1217 |
+
excuse you from the conditions of this License. If you cannot convey a
|
1218 |
+
covered work so as to satisfy simultaneously your obligations under this
|
1219 |
+
License and any other pertinent obligations, then as a consequence you may
|
1220 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
1221 |
+
to collect a royalty for further conveying from those to whom you convey
|
1222 |
+
the Program, the only way you could satisfy both those terms and this
|
1223 |
+
License would be to refrain entirely from conveying the Program.
|
1224 |
+
|
1225 |
+
13. Use with the GNU Affero General Public License.
|
1226 |
+
|
1227 |
+
Notwithstanding any other provision of this License, you have
|
1228 |
+
permission to link or combine any covered work with a work licensed
|
1229 |
+
under version 3 of the GNU Affero General Public License into a single
|
1230 |
+
combined work, and to convey the resulting work. The terms of this
|
1231 |
+
License will continue to apply to the part which is the covered work,
|
1232 |
+
but the special requirements of the GNU Affero General Public License,
|
1233 |
+
section 13, concerning interaction through a network will apply to the
|
1234 |
+
combination as such.
|
1235 |
+
|
1236 |
+
14. Revised Versions of this License.
|
1237 |
+
|
1238 |
+
The Free Software Foundation may publish revised and/or new versions of
|
1239 |
+
the GNU General Public License from time to time. Such new versions will
|
1240 |
+
be similar in spirit to the present version, but may differ in detail to
|
1241 |
+
address new problems or concerns.
|
1242 |
+
|
1243 |
+
Each version is given a distinguishing version number. If the
|
1244 |
+
Program specifies that a certain numbered version of the GNU General
|
1245 |
+
Public License "or any later version" applies to it, you have the
|
1246 |
+
option of following the terms and conditions either of that numbered
|
1247 |
+
version or of any later version published by the Free Software
|
1248 |
+
Foundation. If the Program does not specify a version number of the
|
1249 |
+
GNU General Public License, you may choose any version ever published
|
1250 |
+
by the Free Software Foundation.
|
1251 |
+
|
1252 |
+
If the Program specifies that a proxy can decide which future
|
1253 |
+
versions of the GNU General Public License can be used, that proxy's
|
1254 |
+
public statement of acceptance of a version permanently authorizes you
|
1255 |
+
to choose that version for the Program.
|
1256 |
+
|
1257 |
+
Later license versions may give you additional or different
|
1258 |
+
permissions. However, no additional obligations are imposed on any
|
1259 |
+
author or copyright holder as a result of your choosing to follow a
|
1260 |
+
later version.
|
1261 |
+
|
1262 |
+
15. Disclaimer of Warranty.
|
1263 |
+
|
1264 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
1265 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
1266 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
1267 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
1268 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
1269 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
1270 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
1271 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
1272 |
+
|
1273 |
+
16. Limitation of Liability.
|
1274 |
+
|
1275 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
1276 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
1277 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
1278 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
1279 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
1280 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
1281 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
1282 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
1283 |
+
SUCH DAMAGES.
|
1284 |
+
|
1285 |
+
17. Interpretation of Sections 15 and 16.
|
1286 |
+
|
1287 |
+
If the disclaimer of warranty and limitation of liability provided
|
1288 |
+
above cannot be given local legal effect according to their terms,
|
1289 |
+
reviewing courts shall apply local law that most closely approximates
|
1290 |
+
an absolute waiver of all civil liability in connection with the
|
1291 |
+
Program, unless a warranty or assumption of liability accompanies a
|
1292 |
+
copy of the Program in return for a fee.
|
1293 |
+
|
1294 |
+
END OF TERMS AND CONDITIONS
|
1295 |
+
|
1296 |
+
How to Apply These Terms to Your New Programs
|
1297 |
+
|
1298 |
+
If you develop a new program, and you want it to be of the greatest
|
1299 |
+
possible use to the public, the best way to achieve this is to make it
|
1300 |
+
free software which everyone can redistribute and change under these terms.
|
1301 |
+
|
1302 |
+
To do so, attach the following notices to the program. It is safest
|
1303 |
+
to attach them to the start of each source file to most effectively
|
1304 |
+
state the exclusion of warranty; and each file should have at least
|
1305 |
+
the "copyright" line and a pointer to where the full notice is found.
|
1306 |
+
|
1307 |
+
<one line to give the program's name and a brief idea of what it does.>
|
1308 |
+
Copyright (C) <year> <name of author>
|
1309 |
+
|
1310 |
+
This program is free software: you can redistribute it and/or modify
|
1311 |
+
it under the terms of the GNU General Public License as published by
|
1312 |
+
the Free Software Foundation, either version 3 of the License, or
|
1313 |
+
(at your option) any later version.
|
1314 |
+
|
1315 |
+
This program is distributed in the hope that it will be useful,
|
1316 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
1317 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
1318 |
+
GNU General Public License for more details.
|
1319 |
+
|
1320 |
+
You should have received a copy of the GNU General Public License
|
1321 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
1322 |
+
|
1323 |
+
Also add information on how to contact you by electronic and paper mail.
|
1324 |
+
|
1325 |
+
If the program does terminal interaction, make it output a short
|
1326 |
+
notice like this when it starts in an interactive mode:
|
1327 |
+
|
1328 |
+
<program> Copyright (C) <year> <name of author>
|
1329 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
1330 |
+
This is free software, and you are welcome to redistribute it
|
1331 |
+
under certain conditions; type `show c' for details.
|
1332 |
+
|
1333 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
1334 |
+
parts of the General Public License. Of course, your program's commands
|
1335 |
+
might be different; for a GUI interface, you would use an "about box".
|
1336 |
+
|
1337 |
+
You should also get your employer (if you work as a programmer) or school,
|
1338 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
1339 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
1340 |
+
<https://www.gnu.org/licenses/>.
|
1341 |
+
|
1342 |
+
The GNU General Public License does not permit incorporating your program
|
1343 |
+
into proprietary programs. If your program is a subroutine library, you
|
1344 |
+
may consider it more useful to permit linking proprietary applications with
|
1345 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
1346 |
+
Public License instead of this License. But first, please read
|
1347 |
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
def greet(name):
|
4 |
-
return
|
5 |
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
+
import os
|
2 |
+
os.system("mim install 'mmengine>=0.7.0'")
|
3 |
+
os.system("mim install mmcv")
|
4 |
+
os.system("mim install 'mmdet>=3.0.0'")
|
5 |
+
os.system("pip install -e .")
|
6 |
+
|
7 |
+
|
8 |
+
from yolo_world import version
|
9 |
+
|
10 |
import gradio as gr
|
11 |
|
12 |
def greet(name):
|
13 |
+
return version
|
14 |
|
15 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
16 |
iface.launch()
|
assets/yolo_arch.png
ADDED
assets/yolo_logo.png
ADDED
configs/finetune_coco/yolo_world_l_dual_vlpan_2e-4_80e_8gpus_finetune_coco.py
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = (
|
2 |
+
'../../third_party/mmyolo/configs/yolov8/'
|
3 |
+
'yolov8_l_mask-refine_syncbn_fast_8xb16-500e_coco.py')
|
4 |
+
custom_imports = dict(
|
5 |
+
imports=['yolo_world'],
|
6 |
+
allow_failed_imports=False)
|
7 |
+
|
8 |
+
# hyper-parameters
|
9 |
+
num_classes = 80
|
10 |
+
num_training_classes = 80
|
11 |
+
max_epochs = 80 # Maximum training epochs
|
12 |
+
close_mosaic_epochs = 10
|
13 |
+
save_epoch_intervals = 5
|
14 |
+
text_channels = 512
|
15 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
16 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
17 |
+
base_lr = 2e-4
|
18 |
+
weight_decay = 0.05
|
19 |
+
train_batch_size_per_gpu = 16
|
20 |
+
load_from='pretrained_models/yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth'
|
21 |
+
persistent_workers = False
|
22 |
+
|
23 |
+
# model settings
|
24 |
+
model = dict(
|
25 |
+
type='YOLOWorldDetector',
|
26 |
+
mm_neck=True,
|
27 |
+
num_train_classes=num_training_classes,
|
28 |
+
num_test_classes=num_classes,
|
29 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
30 |
+
backbone=dict(
|
31 |
+
_delete_=True,
|
32 |
+
type='MultiModalYOLOBackbone',
|
33 |
+
image_model={{_base_.model.backbone}},
|
34 |
+
text_model=dict(
|
35 |
+
type='HuggingCLIPLanguageBackbone',
|
36 |
+
model_name='openai/clip-vit-base-patch32',
|
37 |
+
frozen_modules=['all'])),
|
38 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
39 |
+
guide_channels=text_channels,
|
40 |
+
embed_channels=neck_embed_channels,
|
41 |
+
num_heads=neck_num_heads,
|
42 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
43 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
44 |
+
embed_channels=256,
|
45 |
+
num_heads=8)),
|
46 |
+
bbox_head=dict(type='YOLOWorldHead',
|
47 |
+
head_module=dict(type='YOLOWorldHeadModule',
|
48 |
+
embed_dims=text_channels,
|
49 |
+
num_classes=num_training_classes)),
|
50 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)))
|
51 |
+
|
52 |
+
# dataset settings
|
53 |
+
text_transform = [
|
54 |
+
dict(type='RandomLoadText',
|
55 |
+
num_neg_samples=(num_classes, num_classes),
|
56 |
+
max_num_samples=num_training_classes,
|
57 |
+
padding_to_max=True,
|
58 |
+
padding_value=''),
|
59 |
+
dict(type='mmdet.PackDetInputs',
|
60 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
61 |
+
'flip_direction', 'texts'))
|
62 |
+
]
|
63 |
+
mosaic_affine_transform = [
|
64 |
+
dict(
|
65 |
+
type='MultiModalMosaic',
|
66 |
+
img_scale=_base_.img_scale,
|
67 |
+
pad_val=114.0,
|
68 |
+
pre_transform=_base_.pre_transform),
|
69 |
+
dict(type='YOLOv5CopyPaste', prob=_base_.copypaste_prob),
|
70 |
+
dict(
|
71 |
+
type='YOLOv5RandomAffine',
|
72 |
+
max_rotate_degree=0.0,
|
73 |
+
max_shear_degree=0.0,
|
74 |
+
max_aspect_ratio=100.,
|
75 |
+
scaling_ratio_range=(1 - _base_.affine_scale,
|
76 |
+
1 + _base_.affine_scale),
|
77 |
+
# img_scale is (width, height)
|
78 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
79 |
+
border_val=(114, 114, 114),
|
80 |
+
min_area_ratio=_base_.min_area_ratio,
|
81 |
+
use_mask_refine=_base_.use_mask2refine)
|
82 |
+
]
|
83 |
+
train_pipeline = [
|
84 |
+
*_base_.pre_transform,
|
85 |
+
*mosaic_affine_transform,
|
86 |
+
dict(
|
87 |
+
type='YOLOv5MultiModalMixUp',
|
88 |
+
prob=_base_.mixup_prob,
|
89 |
+
pre_transform=[*_base_.pre_transform,
|
90 |
+
*mosaic_affine_transform]),
|
91 |
+
*_base_.last_transform[:-1],
|
92 |
+
*text_transform
|
93 |
+
]
|
94 |
+
train_pipeline_stage2 = [
|
95 |
+
*_base_.train_pipeline_stage2[:-1],
|
96 |
+
*text_transform
|
97 |
+
]
|
98 |
+
coco_train_dataset = dict(
|
99 |
+
_delete_=True,
|
100 |
+
type='MultiModalDataset',
|
101 |
+
dataset=dict(
|
102 |
+
type='YOLOv5CocoDataset',
|
103 |
+
data_root='data/coco',
|
104 |
+
ann_file='annotations/instances_train2017.json',
|
105 |
+
data_prefix=dict(img='train2017/'),
|
106 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
107 |
+
class_text_path='data/texts/coco_class_texts.json',
|
108 |
+
pipeline=train_pipeline)
|
109 |
+
|
110 |
+
train_dataloader = dict(
|
111 |
+
persistent_workers=persistent_workers,
|
112 |
+
batch_size=train_batch_size_per_gpu,
|
113 |
+
collate_fn=dict(type='yolow_collate'),
|
114 |
+
dataset=coco_train_dataset)
|
115 |
+
test_pipeline = [
|
116 |
+
*_base_.test_pipeline[:-1],
|
117 |
+
dict(type='LoadText'),
|
118 |
+
dict(
|
119 |
+
type='mmdet.PackDetInputs',
|
120 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
121 |
+
'scale_factor', 'pad_param', 'texts'))
|
122 |
+
]
|
123 |
+
coco_val_dataset = dict(
|
124 |
+
_delete_=True,
|
125 |
+
type='MultiModalDataset',
|
126 |
+
dataset=dict(
|
127 |
+
type='YOLOv5CocoDataset',
|
128 |
+
data_root='data/coco',
|
129 |
+
ann_file='annotations/instances_val2017.json',
|
130 |
+
data_prefix=dict(img='val2017/'),
|
131 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
132 |
+
class_text_path='data/texts/coco_class_texts.json',
|
133 |
+
pipeline=test_pipeline)
|
134 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
135 |
+
test_dataloader = val_dataloader
|
136 |
+
# training settings
|
137 |
+
default_hooks = dict(
|
138 |
+
param_scheduler=dict(
|
139 |
+
scheduler_type='linear',
|
140 |
+
lr_factor=0.01,
|
141 |
+
max_epochs=max_epochs),
|
142 |
+
checkpoint=dict(
|
143 |
+
max_keep_ckpts=-1,
|
144 |
+
save_best=None,
|
145 |
+
interval=save_epoch_intervals))
|
146 |
+
custom_hooks = [
|
147 |
+
dict(
|
148 |
+
type='EMAHook',
|
149 |
+
ema_type='ExpMomentumEMA',
|
150 |
+
momentum=0.0001,
|
151 |
+
update_buffers=True,
|
152 |
+
strict_load=False,
|
153 |
+
priority=49),
|
154 |
+
dict(
|
155 |
+
type='mmdet.PipelineSwitchHook',
|
156 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
157 |
+
switch_pipeline=train_pipeline_stage2)
|
158 |
+
]
|
159 |
+
train_cfg = dict(
|
160 |
+
max_epochs=max_epochs,
|
161 |
+
val_interval=5,
|
162 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
163 |
+
_base_.val_interval_stage2)])
|
164 |
+
optim_wrapper = dict(
|
165 |
+
optimizer=dict(
|
166 |
+
_delete_=True,
|
167 |
+
type='AdamW',
|
168 |
+
lr=base_lr,
|
169 |
+
weight_decay=weight_decay,
|
170 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
171 |
+
paramwise_cfg=dict(
|
172 |
+
bias_decay_mult=0.0,
|
173 |
+
norm_decay_mult=0.0,
|
174 |
+
custom_keys={'backbone.text_model': dict(lr_mult=0.01),
|
175 |
+
'logit_scale': dict(weight_decay=0.0)}),
|
176 |
+
constructor='YOLOWv5OptimizerConstructor')
|
177 |
+
|
178 |
+
# evaluation settings
|
179 |
+
val_evaluator = dict(
|
180 |
+
_delete_=True,
|
181 |
+
type='mmdet.CocoMetric',
|
182 |
+
proposal_nums=(100, 1, 10),
|
183 |
+
ann_file='data/coco/annotations/instances_val2017.json',
|
184 |
+
metric='bbox')
|
configs/finetune_coco/yolo_world_l_efficient_neck_2e-4_80e_8gpus_finetune_coco.py
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ('../../third_party/mmyolo/configs/yolov8/'
|
2 |
+
'yolov8_l_mask-refine_syncbn_fast_8xb16-500e_coco.py')
|
3 |
+
custom_imports = dict(imports=['yolo_world'], allow_failed_imports=False)
|
4 |
+
|
5 |
+
# hyper-parameters
|
6 |
+
num_classes = 80
|
7 |
+
num_training_classes = 80
|
8 |
+
max_epochs = 80 # Maximum training epochs
|
9 |
+
close_mosaic_epochs = 10
|
10 |
+
save_epoch_intervals = 5
|
11 |
+
text_channels = 512
|
12 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
13 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
14 |
+
base_lr = 2e-4
|
15 |
+
weight_decay = 0.05
|
16 |
+
train_batch_size_per_gpu = 16
|
17 |
+
load_from = 'pretrained_models/yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth'
|
18 |
+
persistent_workers = False
|
19 |
+
|
20 |
+
# model settings
|
21 |
+
model = dict(
|
22 |
+
type='YOLOWorldDetector',
|
23 |
+
mm_neck=True,
|
24 |
+
num_train_classes=num_training_classes,
|
25 |
+
num_test_classes=num_classes,
|
26 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
27 |
+
backbone=dict(
|
28 |
+
_delete_=True,
|
29 |
+
type='MultiModalYOLOBackbone',
|
30 |
+
image_model={{_base_.model.backbone}},
|
31 |
+
text_model=dict(
|
32 |
+
type='HuggingCLIPLanguageBackbone',
|
33 |
+
model_name='openai/clip-vit-base-patch32',
|
34 |
+
frozen_modules=['all'])),
|
35 |
+
neck=dict(type='YOLOWorldPAFPN',
|
36 |
+
guide_channels=text_channels,
|
37 |
+
embed_channels=neck_embed_channels,
|
38 |
+
num_heads=neck_num_heads,
|
39 |
+
block_cfg=dict(type='EfficientCSPLayerWithTwoConv')),
|
40 |
+
bbox_head=dict(type='YOLOWorldHead',
|
41 |
+
head_module=dict(type='YOLOWorldHeadModule',
|
42 |
+
embed_dims=text_channels,
|
43 |
+
num_classes=num_training_classes)),
|
44 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)))
|
45 |
+
|
46 |
+
# dataset settings
|
47 |
+
text_transform = [
|
48 |
+
dict(type='RandomLoadText',
|
49 |
+
num_neg_samples=(num_classes, num_classes),
|
50 |
+
max_num_samples=num_training_classes,
|
51 |
+
padding_to_max=True,
|
52 |
+
padding_value=''),
|
53 |
+
dict(type='mmdet.PackDetInputs',
|
54 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
55 |
+
'flip_direction', 'texts'))
|
56 |
+
]
|
57 |
+
mosaic_affine_transform = [
|
58 |
+
dict(type='MultiModalMosaic',
|
59 |
+
img_scale=_base_.img_scale,
|
60 |
+
pad_val=114.0,
|
61 |
+
pre_transform=_base_.pre_transform),
|
62 |
+
dict(type='YOLOv5CopyPaste', prob=_base_.copypaste_prob),
|
63 |
+
dict(
|
64 |
+
type='YOLOv5RandomAffine',
|
65 |
+
max_rotate_degree=0.0,
|
66 |
+
max_shear_degree=0.0,
|
67 |
+
max_aspect_ratio=100.,
|
68 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
69 |
+
# img_scale is (width, height)
|
70 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
71 |
+
border_val=(114, 114, 114),
|
72 |
+
min_area_ratio=_base_.min_area_ratio,
|
73 |
+
use_mask_refine=_base_.use_mask2refine)
|
74 |
+
]
|
75 |
+
train_pipeline = [
|
76 |
+
*_base_.pre_transform, *mosaic_affine_transform,
|
77 |
+
dict(type='YOLOv5MultiModalMixUp',
|
78 |
+
prob=_base_.mixup_prob,
|
79 |
+
pre_transform=[*_base_.pre_transform, *mosaic_affine_transform]),
|
80 |
+
*_base_.last_transform[:-1], *text_transform
|
81 |
+
]
|
82 |
+
train_pipeline_stage2 = [*_base_.train_pipeline_stage2[:-1], *text_transform]
|
83 |
+
coco_train_dataset = dict(_delete_=True,
|
84 |
+
type='MultiModalDataset',
|
85 |
+
dataset=dict(
|
86 |
+
type='YOLOv5CocoDataset',
|
87 |
+
data_root='data/coco',
|
88 |
+
ann_file='annotations/instances_train2017.json',
|
89 |
+
data_prefix=dict(img='train2017/'),
|
90 |
+
filter_cfg=dict(filter_empty_gt=False,
|
91 |
+
min_size=32)),
|
92 |
+
class_text_path='data/texts/coco_class_texts.json',
|
93 |
+
pipeline=train_pipeline)
|
94 |
+
|
95 |
+
train_dataloader = dict(persistent_workers=persistent_workers,
|
96 |
+
batch_size=train_batch_size_per_gpu,
|
97 |
+
collate_fn=dict(type='yolow_collate'),
|
98 |
+
dataset=coco_train_dataset)
|
99 |
+
test_pipeline = [
|
100 |
+
*_base_.test_pipeline[:-1],
|
101 |
+
dict(type='LoadText'),
|
102 |
+
dict(type='mmdet.PackDetInputs',
|
103 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
104 |
+
'scale_factor', 'pad_param', 'texts'))
|
105 |
+
]
|
106 |
+
coco_val_dataset = dict(
|
107 |
+
_delete_=True,
|
108 |
+
type='MultiModalDataset',
|
109 |
+
dataset=dict(type='YOLOv5CocoDataset',
|
110 |
+
data_root='data/coco',
|
111 |
+
ann_file='annotations/instances_val2017.json',
|
112 |
+
data_prefix=dict(img='val2017/'),
|
113 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
114 |
+
class_text_path='data/texts/coco_class_texts.json',
|
115 |
+
pipeline=test_pipeline)
|
116 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
117 |
+
test_dataloader = val_dataloader
|
118 |
+
# training settings
|
119 |
+
default_hooks = dict(param_scheduler=dict(scheduler_type='linear',
|
120 |
+
lr_factor=0.01,
|
121 |
+
max_epochs=max_epochs),
|
122 |
+
checkpoint=dict(max_keep_ckpts=-1,
|
123 |
+
save_best=None,
|
124 |
+
interval=save_epoch_intervals))
|
125 |
+
custom_hooks = [
|
126 |
+
dict(type='EMAHook',
|
127 |
+
ema_type='ExpMomentumEMA',
|
128 |
+
momentum=0.0001,
|
129 |
+
update_buffers=True,
|
130 |
+
strict_load=False,
|
131 |
+
priority=49),
|
132 |
+
dict(type='mmdet.PipelineSwitchHook',
|
133 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
134 |
+
switch_pipeline=train_pipeline_stage2)
|
135 |
+
]
|
136 |
+
train_cfg = dict(max_epochs=max_epochs,
|
137 |
+
val_interval=5,
|
138 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
139 |
+
_base_.val_interval_stage2)])
|
140 |
+
optim_wrapper = dict(optimizer=dict(
|
141 |
+
_delete_=True,
|
142 |
+
type='AdamW',
|
143 |
+
lr=base_lr,
|
144 |
+
weight_decay=weight_decay,
|
145 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
146 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
147 |
+
norm_decay_mult=0.0,
|
148 |
+
custom_keys={
|
149 |
+
'backbone.text_model':
|
150 |
+
dict(lr_mult=0.01),
|
151 |
+
'logit_scale':
|
152 |
+
dict(weight_decay=0.0)
|
153 |
+
}),
|
154 |
+
constructor='YOLOWv5OptimizerConstructor')
|
155 |
+
|
156 |
+
# evaluation settings
|
157 |
+
val_evaluator = dict(_delete_=True,
|
158 |
+
type='mmdet.CocoMetric',
|
159 |
+
proposal_nums=(100, 1, 10),
|
160 |
+
ann_file='data/coco/annotations/instances_val2017.json',
|
161 |
+
metric='bbox')
|
configs/pretrain/yolo_world_l_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ('../../third_party/mmyolo/configs/yolov8/'
|
2 |
+
'yolov8_l_syncbn_fast_8xb16-500e_coco.py')
|
3 |
+
custom_imports = dict(imports=['yolo_world'],
|
4 |
+
allow_failed_imports=False)
|
5 |
+
|
6 |
+
# hyper-parameters
|
7 |
+
num_classes = 1203
|
8 |
+
num_training_classes = 80
|
9 |
+
max_epochs = 100 # Maximum training epochs
|
10 |
+
close_mosaic_epochs = 2
|
11 |
+
save_epoch_intervals = 2
|
12 |
+
text_channels = 512
|
13 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
14 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
15 |
+
base_lr = 2e-3
|
16 |
+
weight_decay = 0.05 / 2
|
17 |
+
train_batch_size_per_gpu = 16
|
18 |
+
|
19 |
+
# model settings
|
20 |
+
model = dict(
|
21 |
+
type='YOLOWorldDetector',
|
22 |
+
mm_neck=True,
|
23 |
+
num_train_classes=num_training_classes,
|
24 |
+
num_test_classes=num_classes,
|
25 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
26 |
+
backbone=dict(
|
27 |
+
_delete_=True,
|
28 |
+
type='MultiModalYOLOBackbone',
|
29 |
+
image_model={{_base_.model.backbone}},
|
30 |
+
text_model=dict(
|
31 |
+
type='HuggingCLIPLanguageBackbone',
|
32 |
+
model_name='openai/clip-vit-base-patch32',
|
33 |
+
frozen_modules=['all'])),
|
34 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
35 |
+
guide_channels=text_channels,
|
36 |
+
embed_channels=neck_embed_channels,
|
37 |
+
num_heads=neck_num_heads,
|
38 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
39 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
40 |
+
embed_channels=256,
|
41 |
+
num_heads=8)),
|
42 |
+
bbox_head=dict(type='YOLOWorldHead',
|
43 |
+
head_module=dict(type='YOLOWorldHeadModule',
|
44 |
+
embed_dims=text_channels,
|
45 |
+
num_classes=num_training_classes)),
|
46 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)))
|
47 |
+
|
48 |
+
# dataset settings
|
49 |
+
text_transform = [
|
50 |
+
dict(type='RandomLoadText',
|
51 |
+
num_neg_samples=(num_classes, num_classes),
|
52 |
+
max_num_samples=num_training_classes,
|
53 |
+
padding_to_max=True,
|
54 |
+
padding_value=''),
|
55 |
+
dict(type='mmdet.PackDetInputs',
|
56 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
57 |
+
'flip_direction', 'texts'))
|
58 |
+
]
|
59 |
+
train_pipeline = [
|
60 |
+
*_base_.pre_transform,
|
61 |
+
dict(type='MultiModalMosaic',
|
62 |
+
img_scale=_base_.img_scale,
|
63 |
+
pad_val=114.0,
|
64 |
+
pre_transform=_base_.pre_transform),
|
65 |
+
dict(
|
66 |
+
type='YOLOv5RandomAffine',
|
67 |
+
max_rotate_degree=0.0,
|
68 |
+
max_shear_degree=0.0,
|
69 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
70 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
71 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
72 |
+
border_val=(114, 114, 114)),
|
73 |
+
*_base_.last_transform[:-1],
|
74 |
+
*text_transform,
|
75 |
+
]
|
76 |
+
train_pipeline_stage2 = [*_base_.train_pipeline_stage2[:-1], *text_transform]
|
77 |
+
obj365v1_train_dataset = dict(
|
78 |
+
type='MultiModalDataset',
|
79 |
+
dataset=dict(
|
80 |
+
type='YOLOv5Objects365V1Dataset',
|
81 |
+
data_root='data/objects365v1/',
|
82 |
+
ann_file='annotations/objects365_train.json',
|
83 |
+
data_prefix=dict(img='train/'),
|
84 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
85 |
+
class_text_path='data/texts/obj365v1_class_texts.json',
|
86 |
+
pipeline=train_pipeline)
|
87 |
+
|
88 |
+
mg_train_dataset = dict(type='YOLOv5MixedGroundingDataset',
|
89 |
+
data_root='data/mixed_grounding/',
|
90 |
+
ann_file='annotations/final_mixed_train_no_coco.json',
|
91 |
+
data_prefix=dict(img='gqa/images/'),
|
92 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32),
|
93 |
+
pipeline=train_pipeline)
|
94 |
+
|
95 |
+
flickr_train_dataset = dict(
|
96 |
+
type='YOLOv5MixedGroundingDataset',
|
97 |
+
data_root='data/flickr/',
|
98 |
+
ann_file='annotations/final_flickr_separateGT_train.json',
|
99 |
+
data_prefix=dict(img='full_images/'),
|
100 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32),
|
101 |
+
pipeline=train_pipeline)
|
102 |
+
|
103 |
+
train_dataloader = dict(batch_size=train_batch_size_per_gpu,
|
104 |
+
collate_fn=dict(type='yolow_collate'),
|
105 |
+
dataset=dict(_delete_=True,
|
106 |
+
type='ConcatDataset',
|
107 |
+
datasets=[
|
108 |
+
obj365v1_train_dataset,
|
109 |
+
flickr_train_dataset, mg_train_dataset
|
110 |
+
],
|
111 |
+
ignore_keys=['classes', 'palette']))
|
112 |
+
|
113 |
+
test_pipeline = [
|
114 |
+
*_base_.test_pipeline[:-1],
|
115 |
+
dict(type='LoadText'),
|
116 |
+
dict(type='mmdet.PackDetInputs',
|
117 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
118 |
+
'scale_factor', 'pad_param', 'texts'))
|
119 |
+
]
|
120 |
+
coco_val_dataset = dict(
|
121 |
+
_delete_=True,
|
122 |
+
type='MultiModalDataset',
|
123 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
124 |
+
data_root='data/coco/',
|
125 |
+
test_mode=True,
|
126 |
+
ann_file='lvis/lvis_v1_minival_inserted_image_name.json',
|
127 |
+
data_prefix=dict(img=''),
|
128 |
+
batch_shapes_cfg=None),
|
129 |
+
class_text_path='data/texts/lvis_v1_class_texts.json',
|
130 |
+
pipeline=test_pipeline)
|
131 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
132 |
+
test_dataloader = val_dataloader
|
133 |
+
|
134 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
135 |
+
ann_file='data/coco/lvis/lvis_v1_minival_inserted_image_name.json',
|
136 |
+
metric='bbox')
|
137 |
+
test_evaluator = val_evaluator
|
138 |
+
|
139 |
+
# training settings
|
140 |
+
default_hooks = dict(param_scheduler=dict(max_epochs=max_epochs),
|
141 |
+
checkpoint=dict(interval=save_epoch_intervals,
|
142 |
+
rule='greater'))
|
143 |
+
custom_hooks = [
|
144 |
+
dict(type='EMAHook',
|
145 |
+
ema_type='ExpMomentumEMA',
|
146 |
+
momentum=0.0001,
|
147 |
+
update_buffers=True,
|
148 |
+
strict_load=False,
|
149 |
+
priority=49),
|
150 |
+
dict(type='mmdet.PipelineSwitchHook',
|
151 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
152 |
+
switch_pipeline=train_pipeline_stage2)
|
153 |
+
]
|
154 |
+
train_cfg = dict(max_epochs=max_epochs,
|
155 |
+
val_interval=10,
|
156 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
157 |
+
_base_.val_interval_stage2)])
|
158 |
+
optim_wrapper = dict(optimizer=dict(
|
159 |
+
_delete_=True,
|
160 |
+
type='AdamW',
|
161 |
+
lr=base_lr,
|
162 |
+
weight_decay=weight_decay,
|
163 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
164 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
165 |
+
norm_decay_mult=0.0,
|
166 |
+
custom_keys={
|
167 |
+
'backbone.text_model':
|
168 |
+
dict(lr_mult=0.01),
|
169 |
+
'logit_scale':
|
170 |
+
dict(weight_decay=0.0)
|
171 |
+
}),
|
172 |
+
constructor='YOLOWv5OptimizerConstructor')
|
configs/pretrain/yolo_world_l_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_val.py
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ('../../third_party/mmyolo/configs/yolov8/'
|
2 |
+
'yolov8_l_syncbn_fast_8xb16-500e_coco.py')
|
3 |
+
custom_imports = dict(imports=['yolo_world'],
|
4 |
+
allow_failed_imports=False)
|
5 |
+
|
6 |
+
# hyper-parameters
|
7 |
+
num_classes = 1203
|
8 |
+
num_training_classes = 80
|
9 |
+
max_epochs = 100 # Maximum training epochs
|
10 |
+
close_mosaic_epochs = 2
|
11 |
+
save_epoch_intervals = 2
|
12 |
+
text_channels = 512
|
13 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
14 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
15 |
+
base_lr = 2e-3
|
16 |
+
weight_decay = 0.05 / 2
|
17 |
+
train_batch_size_per_gpu = 16
|
18 |
+
|
19 |
+
# model settings
|
20 |
+
model = dict(
|
21 |
+
type='YOLOWorldDetector',
|
22 |
+
mm_neck=True,
|
23 |
+
num_train_classes=num_training_classes,
|
24 |
+
num_test_classes=num_classes,
|
25 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
26 |
+
backbone=dict(
|
27 |
+
_delete_=True,
|
28 |
+
type='MultiModalYOLOBackbone',
|
29 |
+
image_model={{_base_.model.backbone}},
|
30 |
+
text_model=dict(
|
31 |
+
type='HuggingCLIPLanguageBackbone',
|
32 |
+
model_name='openai/clip-vit-base-patch32',
|
33 |
+
frozen_modules=['all'])),
|
34 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
35 |
+
guide_channels=text_channels,
|
36 |
+
embed_channels=neck_embed_channels,
|
37 |
+
num_heads=neck_num_heads,
|
38 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
39 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
40 |
+
embed_channels=256,
|
41 |
+
num_heads=8)),
|
42 |
+
bbox_head=dict(type='YOLOWorldHead',
|
43 |
+
head_module=dict(type='YOLOWorldHeadModule',
|
44 |
+
embed_dims=text_channels,
|
45 |
+
num_classes=num_training_classes)),
|
46 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)))
|
47 |
+
|
48 |
+
# dataset settings
|
49 |
+
text_transform = [
|
50 |
+
dict(type='RandomLoadText',
|
51 |
+
num_neg_samples=(num_classes, num_classes),
|
52 |
+
max_num_samples=num_training_classes,
|
53 |
+
padding_to_max=True,
|
54 |
+
padding_value=''),
|
55 |
+
dict(type='mmdet.PackDetInputs',
|
56 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
57 |
+
'flip_direction', 'texts'))
|
58 |
+
]
|
59 |
+
train_pipeline = [
|
60 |
+
*_base_.pre_transform,
|
61 |
+
dict(type='MultiModalMosaic',
|
62 |
+
img_scale=_base_.img_scale,
|
63 |
+
pad_val=114.0,
|
64 |
+
pre_transform=_base_.pre_transform),
|
65 |
+
dict(
|
66 |
+
type='YOLOv5RandomAffine',
|
67 |
+
max_rotate_degree=0.0,
|
68 |
+
max_shear_degree=0.0,
|
69 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
70 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
71 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
72 |
+
border_val=(114, 114, 114)),
|
73 |
+
*_base_.last_transform[:-1],
|
74 |
+
*text_transform,
|
75 |
+
]
|
76 |
+
train_pipeline_stage2 = [*_base_.train_pipeline_stage2[:-1], *text_transform]
|
77 |
+
obj365v1_train_dataset = dict(
|
78 |
+
type='MultiModalDataset',
|
79 |
+
dataset=dict(
|
80 |
+
type='YOLOv5Objects365V1Dataset',
|
81 |
+
data_root='data/objects365v1/',
|
82 |
+
ann_file='annotations/objects365_train.json',
|
83 |
+
data_prefix=dict(img='train/'),
|
84 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
85 |
+
class_text_path='data/texts/obj365v1_class_texts.json',
|
86 |
+
pipeline=train_pipeline)
|
87 |
+
|
88 |
+
mg_train_dataset = dict(type='YOLOv5MixedGroundingDataset',
|
89 |
+
data_root='data/mixed_grounding/',
|
90 |
+
ann_file='annotations/final_mixed_train_no_coco.json',
|
91 |
+
data_prefix=dict(img='gqa/images/'),
|
92 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32),
|
93 |
+
pipeline=train_pipeline)
|
94 |
+
|
95 |
+
flickr_train_dataset = dict(
|
96 |
+
type='YOLOv5MixedGroundingDataset',
|
97 |
+
data_root='data/flickr/',
|
98 |
+
ann_file='annotations/final_flickr_separateGT_train.json',
|
99 |
+
data_prefix=dict(img='full_images/'),
|
100 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32),
|
101 |
+
pipeline=train_pipeline)
|
102 |
+
|
103 |
+
train_dataloader = dict(batch_size=train_batch_size_per_gpu,
|
104 |
+
collate_fn=dict(type='yolow_collate'),
|
105 |
+
dataset=dict(_delete_=True,
|
106 |
+
type='ConcatDataset',
|
107 |
+
datasets=[
|
108 |
+
obj365v1_train_dataset,
|
109 |
+
flickr_train_dataset, mg_train_dataset
|
110 |
+
],
|
111 |
+
ignore_keys=['classes', 'palette']))
|
112 |
+
|
113 |
+
test_pipeline = [
|
114 |
+
*_base_.test_pipeline[:-1],
|
115 |
+
dict(type='LoadText'),
|
116 |
+
dict(type='mmdet.PackDetInputs',
|
117 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
118 |
+
'scale_factor', 'pad_param', 'texts'))
|
119 |
+
]
|
120 |
+
coco_val_dataset = dict(
|
121 |
+
_delete_=True,
|
122 |
+
type='MultiModalDataset',
|
123 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
124 |
+
data_root='data/coco/',
|
125 |
+
test_mode=True,
|
126 |
+
ann_file='lvis/lvis_v1_val.json',
|
127 |
+
data_prefix=dict(img=''),
|
128 |
+
batch_shapes_cfg=None),
|
129 |
+
class_text_path='data/texts/lvis_v1_class_texts.json',
|
130 |
+
pipeline=test_pipeline)
|
131 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
132 |
+
test_dataloader = val_dataloader
|
133 |
+
|
134 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
135 |
+
ann_file='data/coco/lvis/lvis_v1_val.json',
|
136 |
+
metric='bbox')
|
137 |
+
test_evaluator = val_evaluator
|
138 |
+
|
139 |
+
# training settings
|
140 |
+
default_hooks = dict(param_scheduler=dict(max_epochs=max_epochs),
|
141 |
+
checkpoint=dict(interval=save_epoch_intervals,
|
142 |
+
rule='greater'))
|
143 |
+
custom_hooks = [
|
144 |
+
dict(type='EMAHook',
|
145 |
+
ema_type='ExpMomentumEMA',
|
146 |
+
momentum=0.0001,
|
147 |
+
update_buffers=True,
|
148 |
+
strict_load=False,
|
149 |
+
priority=49),
|
150 |
+
dict(type='mmdet.PipelineSwitchHook',
|
151 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
152 |
+
switch_pipeline=train_pipeline_stage2)
|
153 |
+
]
|
154 |
+
train_cfg = dict(max_epochs=max_epochs,
|
155 |
+
val_interval=10,
|
156 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
157 |
+
_base_.val_interval_stage2)])
|
158 |
+
optim_wrapper = dict(optimizer=dict(
|
159 |
+
_delete_=True,
|
160 |
+
type='AdamW',
|
161 |
+
lr=base_lr,
|
162 |
+
weight_decay=weight_decay,
|
163 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
164 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
165 |
+
norm_decay_mult=0.0,
|
166 |
+
custom_keys={
|
167 |
+
'backbone.text_model':
|
168 |
+
dict(lr_mult=0.01),
|
169 |
+
'logit_scale':
|
170 |
+
dict(weight_decay=0.0)
|
171 |
+
}),
|
172 |
+
constructor='YOLOWv5OptimizerConstructor')
|
configs/pretrain/yolo_world_m_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ('../../third_party/mmyolo/configs/yolov8/'
|
2 |
+
'yolov8_m_syncbn_fast_8xb16-500e_coco.py')
|
3 |
+
custom_imports = dict(imports=['yolo_world'],
|
4 |
+
allow_failed_imports=False)
|
5 |
+
|
6 |
+
# hyper-parameters
|
7 |
+
num_classes = 1203
|
8 |
+
num_training_classes = 80
|
9 |
+
max_epochs = 100 # Maximum training epochs
|
10 |
+
close_mosaic_epochs = 2
|
11 |
+
save_epoch_intervals = 2
|
12 |
+
text_channels = 512
|
13 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
14 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
15 |
+
base_lr = 2e-3
|
16 |
+
weight_decay = 0.05 / 2
|
17 |
+
train_batch_size_per_gpu = 16
|
18 |
+
|
19 |
+
# model settings
|
20 |
+
model = dict(
|
21 |
+
type='YOLOWorldDetector',
|
22 |
+
mm_neck=True,
|
23 |
+
num_train_classes=num_training_classes,
|
24 |
+
num_test_classes=num_classes,
|
25 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
26 |
+
backbone=dict(
|
27 |
+
_delete_=True,
|
28 |
+
type='MultiModalYOLOBackbone',
|
29 |
+
image_model={{_base_.model.backbone}},
|
30 |
+
text_model=dict(
|
31 |
+
type='HuggingCLIPLanguageBackbone',
|
32 |
+
model_name='openai/clip-vit-base-patch32',
|
33 |
+
frozen_modules=['all'])),
|
34 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
35 |
+
guide_channels=text_channels,
|
36 |
+
embed_channels=neck_embed_channels,
|
37 |
+
num_heads=neck_num_heads,
|
38 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
39 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
40 |
+
embed_channels=256,
|
41 |
+
num_heads=8)),
|
42 |
+
bbox_head=dict(type='YOLOWorldHead',
|
43 |
+
head_module=dict(type='YOLOWorldHeadModule',
|
44 |
+
embed_dims=text_channels,
|
45 |
+
num_classes=num_training_classes)),
|
46 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)))
|
47 |
+
|
48 |
+
# dataset settings
|
49 |
+
text_transform = [
|
50 |
+
dict(type='RandomLoadText',
|
51 |
+
num_neg_samples=(num_classes, num_classes),
|
52 |
+
max_num_samples=num_training_classes,
|
53 |
+
padding_to_max=True,
|
54 |
+
padding_value=''),
|
55 |
+
dict(type='mmdet.PackDetInputs',
|
56 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
57 |
+
'flip_direction', 'texts'))
|
58 |
+
]
|
59 |
+
train_pipeline = [
|
60 |
+
*_base_.pre_transform,
|
61 |
+
dict(type='MultiModalMosaic',
|
62 |
+
img_scale=_base_.img_scale,
|
63 |
+
pad_val=114.0,
|
64 |
+
pre_transform=_base_.pre_transform),
|
65 |
+
dict(
|
66 |
+
type='YOLOv5RandomAffine',
|
67 |
+
max_rotate_degree=0.0,
|
68 |
+
max_shear_degree=0.0,
|
69 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
70 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
71 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
72 |
+
border_val=(114, 114, 114)),
|
73 |
+
*_base_.last_transform[:-1],
|
74 |
+
*text_transform,
|
75 |
+
]
|
76 |
+
train_pipeline_stage2 = [*_base_.train_pipeline_stage2[:-1], *text_transform]
|
77 |
+
obj365v1_train_dataset = dict(
|
78 |
+
type='MultiModalDataset',
|
79 |
+
dataset=dict(
|
80 |
+
type='YOLOv5Objects365V1Dataset',
|
81 |
+
data_root='data/objects365v1/',
|
82 |
+
ann_file='annotations/objects365_train.json',
|
83 |
+
data_prefix=dict(img='train/'),
|
84 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
85 |
+
class_text_path='data/texts/obj365v1_class_texts.json',
|
86 |
+
pipeline=train_pipeline)
|
87 |
+
|
88 |
+
mg_train_dataset = dict(type='YOLOv5MixedGroundingDataset',
|
89 |
+
data_root='data/mixed_grounding/',
|
90 |
+
ann_file='annotations/final_mixed_train_no_coco.json',
|
91 |
+
data_prefix=dict(img='gqa/images/'),
|
92 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32),
|
93 |
+
pipeline=train_pipeline)
|
94 |
+
|
95 |
+
flickr_train_dataset = dict(
|
96 |
+
type='YOLOv5MixedGroundingDataset',
|
97 |
+
data_root='data/flickr/',
|
98 |
+
ann_file='annotations/final_flickr_separateGT_train.json',
|
99 |
+
data_prefix=dict(img='full_images/'),
|
100 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32),
|
101 |
+
pipeline=train_pipeline)
|
102 |
+
|
103 |
+
train_dataloader = dict(batch_size=train_batch_size_per_gpu,
|
104 |
+
collate_fn=dict(type='yolow_collate'),
|
105 |
+
dataset=dict(_delete_=True,
|
106 |
+
type='ConcatDataset',
|
107 |
+
datasets=[
|
108 |
+
obj365v1_train_dataset,
|
109 |
+
flickr_train_dataset, mg_train_dataset
|
110 |
+
],
|
111 |
+
ignore_keys=['classes', 'palette']))
|
112 |
+
|
113 |
+
test_pipeline = [
|
114 |
+
*_base_.test_pipeline[:-1],
|
115 |
+
dict(type='LoadText'),
|
116 |
+
dict(type='mmdet.PackDetInputs',
|
117 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
118 |
+
'scale_factor', 'pad_param', 'texts'))
|
119 |
+
]
|
120 |
+
coco_val_dataset = dict(
|
121 |
+
_delete_=True,
|
122 |
+
type='MultiModalDataset',
|
123 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
124 |
+
data_root='data/coco/',
|
125 |
+
test_mode=True,
|
126 |
+
ann_file='lvis/lvis_v1_minival_inserted_image_name.json',
|
127 |
+
data_prefix=dict(img=''),
|
128 |
+
batch_shapes_cfg=None),
|
129 |
+
class_text_path='data/texts/lvis_v1_class_texts.json',
|
130 |
+
pipeline=test_pipeline)
|
131 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
132 |
+
test_dataloader = val_dataloader
|
133 |
+
|
134 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
135 |
+
ann_file='data/coco/lvis/lvis_v1_minival_inserted_image_name.json',
|
136 |
+
metric='bbox')
|
137 |
+
test_evaluator = val_evaluator
|
138 |
+
|
139 |
+
# training settings
|
140 |
+
default_hooks = dict(param_scheduler=dict(max_epochs=max_epochs),
|
141 |
+
checkpoint=dict(interval=save_epoch_intervals,
|
142 |
+
rule='greater'))
|
143 |
+
custom_hooks = [
|
144 |
+
dict(type='EMAHook',
|
145 |
+
ema_type='ExpMomentumEMA',
|
146 |
+
momentum=0.0001,
|
147 |
+
update_buffers=True,
|
148 |
+
strict_load=False,
|
149 |
+
priority=49),
|
150 |
+
dict(type='mmdet.PipelineSwitchHook',
|
151 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
152 |
+
switch_pipeline=train_pipeline_stage2)
|
153 |
+
]
|
154 |
+
train_cfg = dict(max_epochs=max_epochs,
|
155 |
+
val_interval=10,
|
156 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
157 |
+
_base_.val_interval_stage2)])
|
158 |
+
optim_wrapper = dict(optimizer=dict(
|
159 |
+
_delete_=True,
|
160 |
+
type='AdamW',
|
161 |
+
lr=base_lr,
|
162 |
+
weight_decay=weight_decay,
|
163 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
164 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
165 |
+
norm_decay_mult=0.0,
|
166 |
+
custom_keys={
|
167 |
+
'backbone.text_model':
|
168 |
+
dict(lr_mult=0.01),
|
169 |
+
'logit_scale':
|
170 |
+
dict(weight_decay=0.0)
|
171 |
+
}),
|
172 |
+
constructor='YOLOWv5OptimizerConstructor')
|
configs/pretrain/yolo_world_s_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ('../../third_party/mmyolo/configs/yolov8/'
|
2 |
+
'yolov8_s_syncbn_fast_8xb16-500e_coco.py')
|
3 |
+
custom_imports = dict(imports=['yolo_world'],
|
4 |
+
allow_failed_imports=False)
|
5 |
+
|
6 |
+
# hyper-parameters
|
7 |
+
num_classes = 1203
|
8 |
+
num_training_classes = 80
|
9 |
+
max_epochs = 100 # Maximum training epochs
|
10 |
+
close_mosaic_epochs = 2
|
11 |
+
save_epoch_intervals = 2
|
12 |
+
text_channels = 512
|
13 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
14 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
15 |
+
base_lr = 2e-3
|
16 |
+
weight_decay = 0.05 / 2
|
17 |
+
train_batch_size_per_gpu = 16
|
18 |
+
|
19 |
+
# model settings
|
20 |
+
model = dict(
|
21 |
+
type='YOLOWorldDetector',
|
22 |
+
mm_neck=True,
|
23 |
+
num_train_classes=num_training_classes,
|
24 |
+
num_test_classes=num_classes,
|
25 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
26 |
+
backbone=dict(
|
27 |
+
_delete_=True,
|
28 |
+
type='MultiModalYOLOBackbone',
|
29 |
+
image_model={{_base_.model.backbone}},
|
30 |
+
text_model=dict(
|
31 |
+
type='HuggingCLIPLanguageBackbone',
|
32 |
+
model_name='openai/clip-vit-base-patch32',
|
33 |
+
frozen_modules=['all'])),
|
34 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
35 |
+
guide_channels=text_channels,
|
36 |
+
embed_channels=neck_embed_channels,
|
37 |
+
num_heads=neck_num_heads,
|
38 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
39 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
40 |
+
embed_channels=256,
|
41 |
+
num_heads=8)),
|
42 |
+
bbox_head=dict(type='YOLOWorldHead',
|
43 |
+
head_module=dict(type='YOLOWorldHeadModule',
|
44 |
+
embed_dims=text_channels,
|
45 |
+
num_classes=num_training_classes)),
|
46 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)))
|
47 |
+
|
48 |
+
# dataset settings
|
49 |
+
text_transform = [
|
50 |
+
dict(type='RandomLoadText',
|
51 |
+
num_neg_samples=(num_classes, num_classes),
|
52 |
+
max_num_samples=num_training_classes,
|
53 |
+
padding_to_max=True,
|
54 |
+
padding_value=''),
|
55 |
+
dict(type='mmdet.PackDetInputs',
|
56 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
57 |
+
'flip_direction', 'texts'))
|
58 |
+
]
|
59 |
+
train_pipeline = [
|
60 |
+
*_base_.pre_transform,
|
61 |
+
dict(type='MultiModalMosaic',
|
62 |
+
img_scale=_base_.img_scale,
|
63 |
+
pad_val=114.0,
|
64 |
+
pre_transform=_base_.pre_transform),
|
65 |
+
dict(
|
66 |
+
type='YOLOv5RandomAffine',
|
67 |
+
max_rotate_degree=0.0,
|
68 |
+
max_shear_degree=0.0,
|
69 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
70 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
71 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
72 |
+
border_val=(114, 114, 114)),
|
73 |
+
*_base_.last_transform[:-1],
|
74 |
+
*text_transform,
|
75 |
+
]
|
76 |
+
train_pipeline_stage2 = [*_base_.train_pipeline_stage2[:-1], *text_transform]
|
77 |
+
obj365v1_train_dataset = dict(
|
78 |
+
type='MultiModalDataset',
|
79 |
+
dataset=dict(
|
80 |
+
type='YOLOv5Objects365V1Dataset',
|
81 |
+
data_root='data/objects365v1/',
|
82 |
+
ann_file='annotations/objects365_train.json',
|
83 |
+
data_prefix=dict(img='train/'),
|
84 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
85 |
+
class_text_path='data/texts/obj365v1_class_texts.json',
|
86 |
+
pipeline=train_pipeline)
|
87 |
+
|
88 |
+
mg_train_dataset = dict(type='YOLOv5MixedGroundingDataset',
|
89 |
+
data_root='data/mixed_grounding/',
|
90 |
+
ann_file='annotations/final_mixed_train_no_coco.json',
|
91 |
+
data_prefix=dict(img='gqa/images/'),
|
92 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32),
|
93 |
+
pipeline=train_pipeline)
|
94 |
+
|
95 |
+
flickr_train_dataset = dict(
|
96 |
+
type='YOLOv5MixedGroundingDataset',
|
97 |
+
data_root='data/flickr/',
|
98 |
+
ann_file='annotations/final_flickr_separateGT_train.json',
|
99 |
+
data_prefix=dict(img='full_images/'),
|
100 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32),
|
101 |
+
pipeline=train_pipeline)
|
102 |
+
|
103 |
+
train_dataloader = dict(batch_size=train_batch_size_per_gpu,
|
104 |
+
collate_fn=dict(type='yolow_collate'),
|
105 |
+
dataset=dict(_delete_=True,
|
106 |
+
type='ConcatDataset',
|
107 |
+
datasets=[
|
108 |
+
obj365v1_train_dataset,
|
109 |
+
flickr_train_dataset, mg_train_dataset
|
110 |
+
],
|
111 |
+
ignore_keys=['classes', 'palette']))
|
112 |
+
|
113 |
+
test_pipeline = [
|
114 |
+
*_base_.test_pipeline[:-1],
|
115 |
+
dict(type='LoadText'),
|
116 |
+
dict(type='mmdet.PackDetInputs',
|
117 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
118 |
+
'scale_factor', 'pad_param', 'texts'))
|
119 |
+
]
|
120 |
+
coco_val_dataset = dict(
|
121 |
+
_delete_=True,
|
122 |
+
type='MultiModalDataset',
|
123 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
124 |
+
data_root='data/coco/',
|
125 |
+
test_mode=True,
|
126 |
+
ann_file='lvis/lvis_v1_minival_inserted_image_name.json',
|
127 |
+
data_prefix=dict(img=''),
|
128 |
+
batch_shapes_cfg=None),
|
129 |
+
class_text_path='data/texts/lvis_v1_class_texts.json',
|
130 |
+
pipeline=test_pipeline)
|
131 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
132 |
+
test_dataloader = val_dataloader
|
133 |
+
|
134 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
135 |
+
ann_file='data/coco/lvis/lvis_v1_minival_inserted_image_name.json',
|
136 |
+
metric='bbox')
|
137 |
+
test_evaluator = val_evaluator
|
138 |
+
|
139 |
+
# training settings
|
140 |
+
default_hooks = dict(param_scheduler=dict(max_epochs=max_epochs),
|
141 |
+
checkpoint=dict(interval=save_epoch_intervals,
|
142 |
+
rule='greater'))
|
143 |
+
custom_hooks = [
|
144 |
+
dict(type='EMAHook',
|
145 |
+
ema_type='ExpMomentumEMA',
|
146 |
+
momentum=0.0001,
|
147 |
+
update_buffers=True,
|
148 |
+
strict_load=False,
|
149 |
+
priority=49),
|
150 |
+
dict(type='mmdet.PipelineSwitchHook',
|
151 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
152 |
+
switch_pipeline=train_pipeline_stage2)
|
153 |
+
]
|
154 |
+
train_cfg = dict(max_epochs=max_epochs,
|
155 |
+
val_interval=10,
|
156 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
157 |
+
_base_.val_interval_stage2)])
|
158 |
+
optim_wrapper = dict(optimizer=dict(
|
159 |
+
_delete_=True,
|
160 |
+
type='AdamW',
|
161 |
+
lr=base_lr,
|
162 |
+
weight_decay=weight_decay,
|
163 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
164 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
165 |
+
norm_decay_mult=0.0,
|
166 |
+
custom_keys={
|
167 |
+
'backbone.text_model':
|
168 |
+
dict(lr_mult=0.01),
|
169 |
+
'logit_scale':
|
170 |
+
dict(weight_decay=0.0)
|
171 |
+
}),
|
172 |
+
constructor='YOLOWv5OptimizerConstructor')
|
configs/pretrain/yolo_world_x_dual_vlpan_l2norm_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ('../../third_party/mmyolo/configs/yolov8/'
|
2 |
+
'yolov8_x_syncbn_fast_8xb16-500e_coco.py')
|
3 |
+
custom_imports = dict(imports=['yolo_world'],
|
4 |
+
allow_failed_imports=False)
|
5 |
+
|
6 |
+
# hyper-parameters
|
7 |
+
num_classes = 1203
|
8 |
+
num_training_classes = 80
|
9 |
+
max_epochs = 100 # Maximum training epochs
|
10 |
+
close_mosaic_epochs = 2
|
11 |
+
save_epoch_intervals = 2
|
12 |
+
text_channels = 512
|
13 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
14 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
15 |
+
base_lr = 2e-3
|
16 |
+
weight_decay = 0.05 / 2
|
17 |
+
train_batch_size_per_gpu = 16
|
18 |
+
|
19 |
+
# model settings
|
20 |
+
model = dict(
|
21 |
+
type='YOLOWorldDetector',
|
22 |
+
mm_neck=True,
|
23 |
+
num_train_classes=num_training_classes,
|
24 |
+
num_test_classes=num_classes,
|
25 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
26 |
+
backbone=dict(
|
27 |
+
_delete_=True,
|
28 |
+
type='MultiModalYOLOBackbone',
|
29 |
+
image_model={{_base_.model.backbone}},
|
30 |
+
text_model=dict(
|
31 |
+
type='HuggingCLIPLanguageBackbone',
|
32 |
+
model_name='openai/clip-vit-base-patch32',
|
33 |
+
frozen_modules=['all'])),
|
34 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
35 |
+
guide_channels=text_channels,
|
36 |
+
embed_channels=neck_embed_channels,
|
37 |
+
num_heads=neck_num_heads,
|
38 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
39 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
40 |
+
embed_channels=256,
|
41 |
+
num_heads=8)),
|
42 |
+
bbox_head=dict(type='YOLOWorldHead',
|
43 |
+
head_module=dict(type='YOLOWorldHeadModule',
|
44 |
+
embed_dims=text_channels,
|
45 |
+
num_classes=num_training_classes)),
|
46 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)))
|
47 |
+
|
48 |
+
# dataset settings
|
49 |
+
text_transform = [
|
50 |
+
dict(type='RandomLoadText',
|
51 |
+
num_neg_samples=(num_classes, num_classes),
|
52 |
+
max_num_samples=num_training_classes,
|
53 |
+
padding_to_max=True,
|
54 |
+
padding_value=''),
|
55 |
+
dict(type='mmdet.PackDetInputs',
|
56 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
57 |
+
'flip_direction', 'texts'))
|
58 |
+
]
|
59 |
+
train_pipeline = [
|
60 |
+
*_base_.pre_transform,
|
61 |
+
dict(type='MultiModalMosaic',
|
62 |
+
img_scale=_base_.img_scale,
|
63 |
+
pad_val=114.0,
|
64 |
+
pre_transform=_base_.pre_transform),
|
65 |
+
dict(
|
66 |
+
type='YOLOv5RandomAffine',
|
67 |
+
max_rotate_degree=0.0,
|
68 |
+
max_shear_degree=0.0,
|
69 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
70 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
71 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
72 |
+
border_val=(114, 114, 114)),
|
73 |
+
*_base_.last_transform[:-1],
|
74 |
+
*text_transform,
|
75 |
+
]
|
76 |
+
train_pipeline_stage2 = [*_base_.train_pipeline_stage2[:-1], *text_transform]
|
77 |
+
obj365v1_train_dataset = dict(
|
78 |
+
type='MultiModalDataset',
|
79 |
+
dataset=dict(
|
80 |
+
type='YOLOv5Objects365V1Dataset',
|
81 |
+
data_root='data/objects365v1/',
|
82 |
+
ann_file='annotations/objects365_train.json',
|
83 |
+
data_prefix=dict(img='train/'),
|
84 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32)),
|
85 |
+
class_text_path='data/texts/obj365v1_class_texts.json',
|
86 |
+
pipeline=train_pipeline)
|
87 |
+
|
88 |
+
mg_train_dataset = dict(type='YOLOv5MixedGroundingDataset',
|
89 |
+
data_root='data/mixed_grounding/',
|
90 |
+
ann_file='annotations/final_mixed_train_no_coco.json',
|
91 |
+
data_prefix=dict(img='gqa/images/'),
|
92 |
+
filter_cfg=dict(filter_empty_gt=False, min_size=32),
|
93 |
+
pipeline=train_pipeline)
|
94 |
+
|
95 |
+
flickr_train_dataset = dict(
|
96 |
+
type='YOLOv5MixedGroundingDataset',
|
97 |
+
data_root='data/flickr/',
|
98 |
+
ann_file='annotations/final_flickr_separateGT_train.json',
|
99 |
+
data_prefix=dict(img='full_images/'),
|
100 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32),
|
101 |
+
pipeline=train_pipeline)
|
102 |
+
|
103 |
+
train_dataloader = dict(batch_size=train_batch_size_per_gpu,
|
104 |
+
collate_fn=dict(type='yolow_collate'),
|
105 |
+
dataset=dict(_delete_=True,
|
106 |
+
type='ConcatDataset',
|
107 |
+
datasets=[
|
108 |
+
obj365v1_train_dataset,
|
109 |
+
flickr_train_dataset, mg_train_dataset
|
110 |
+
],
|
111 |
+
ignore_keys=['classes', 'palette']))
|
112 |
+
|
113 |
+
test_pipeline = [
|
114 |
+
*_base_.test_pipeline[:-1],
|
115 |
+
dict(type='LoadText'),
|
116 |
+
dict(type='mmdet.PackDetInputs',
|
117 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
118 |
+
'scale_factor', 'pad_param', 'texts'))
|
119 |
+
]
|
120 |
+
coco_val_dataset = dict(
|
121 |
+
_delete_=True,
|
122 |
+
type='MultiModalDataset',
|
123 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
124 |
+
data_root='data/coco/',
|
125 |
+
test_mode=True,
|
126 |
+
ann_file='lvis/lvis_v1_minival_inserted_image_name.json',
|
127 |
+
data_prefix=dict(img=''),
|
128 |
+
batch_shapes_cfg=None),
|
129 |
+
class_text_path='data/texts/lvis_v1_class_texts.json',
|
130 |
+
pipeline=test_pipeline)
|
131 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
132 |
+
test_dataloader = val_dataloader
|
133 |
+
|
134 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
135 |
+
ann_file='data/coco/lvis/lvis_v1_minival_inserted_image_name.json',
|
136 |
+
metric='bbox')
|
137 |
+
test_evaluator = val_evaluator
|
138 |
+
|
139 |
+
# training settings
|
140 |
+
default_hooks = dict(param_scheduler=dict(max_epochs=max_epochs),
|
141 |
+
checkpoint=dict(interval=save_epoch_intervals,
|
142 |
+
rule='greater'))
|
143 |
+
custom_hooks = [
|
144 |
+
dict(type='EMAHook',
|
145 |
+
ema_type='ExpMomentumEMA',
|
146 |
+
momentum=0.0001,
|
147 |
+
update_buffers=True,
|
148 |
+
strict_load=False,
|
149 |
+
priority=49),
|
150 |
+
dict(type='mmdet.PipelineSwitchHook',
|
151 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
152 |
+
switch_pipeline=train_pipeline_stage2)
|
153 |
+
]
|
154 |
+
train_cfg = dict(max_epochs=max_epochs,
|
155 |
+
val_interval=10,
|
156 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
157 |
+
_base_.val_interval_stage2)])
|
158 |
+
optim_wrapper = dict(optimizer=dict(
|
159 |
+
_delete_=True,
|
160 |
+
type='AdamW',
|
161 |
+
lr=base_lr,
|
162 |
+
weight_decay=weight_decay,
|
163 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
164 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
165 |
+
norm_decay_mult=0.0,
|
166 |
+
custom_keys={
|
167 |
+
'backbone.text_model':
|
168 |
+
dict(lr_mult=0.01),
|
169 |
+
'logit_scale':
|
170 |
+
dict(weight_decay=0.0)
|
171 |
+
}),
|
172 |
+
constructor='YOLOWv5OptimizerConstructor')
|
configs/segmentation/yolo_world_seg_l_dual_vlpan_2e-4_80e_8gpus_allmodules_finetune_lvis.py
ADDED
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = (
|
2 |
+
'../../third_party/mmyolo/configs/yolov8/yolov8_l_mask-refine_syncbn_fast_8xb16-500e_coco.py'
|
3 |
+
)
|
4 |
+
custom_imports = dict(imports=['yolo_world'], allow_failed_imports=False)
|
5 |
+
# hyper-parameters
|
6 |
+
num_classes = 1203
|
7 |
+
num_training_classes = 80
|
8 |
+
max_epochs = 80 # Maximum training epochs
|
9 |
+
close_mosaic_epochs = 10
|
10 |
+
save_epoch_intervals = 5
|
11 |
+
text_channels = 512
|
12 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
13 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
14 |
+
base_lr = 2e-4
|
15 |
+
|
16 |
+
weight_decay = 0.05
|
17 |
+
train_batch_size_per_gpu = 8
|
18 |
+
load_from = 'pretrained_models/yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth'
|
19 |
+
persistent_workers = False
|
20 |
+
|
21 |
+
# Polygon2Mask
|
22 |
+
downsample_ratio = 4
|
23 |
+
mask_overlap = False
|
24 |
+
use_mask2refine = True
|
25 |
+
max_aspect_ratio = 100
|
26 |
+
min_area_ratio = 0.01
|
27 |
+
|
28 |
+
# model settings
|
29 |
+
model = dict(
|
30 |
+
type='YOLOWorldDetector',
|
31 |
+
mm_neck=True,
|
32 |
+
num_train_classes=num_training_classes,
|
33 |
+
num_test_classes=num_classes,
|
34 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
35 |
+
backbone=dict(
|
36 |
+
_delete_=True,
|
37 |
+
type='MultiModalYOLOBackbone',
|
38 |
+
image_model={{_base_.model.backbone}},
|
39 |
+
text_model=dict(
|
40 |
+
type='HuggingCLIPLanguageBackbone',
|
41 |
+
model_name='openai/clip-vit-base-patch32',
|
42 |
+
frozen_modules=[])),
|
43 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
44 |
+
guide_channels=text_channels,
|
45 |
+
embed_channels=neck_embed_channels,
|
46 |
+
num_heads=neck_num_heads,
|
47 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
48 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
49 |
+
embed_channels=256,
|
50 |
+
num_heads=8)),
|
51 |
+
bbox_head=dict(type='YOLOWorldSegHead',
|
52 |
+
head_module=dict(type='YOLOWorldSegHeadModule',
|
53 |
+
embed_dims=text_channels,
|
54 |
+
num_classes=num_training_classes,
|
55 |
+
mask_channels=32,
|
56 |
+
proto_channels=256),
|
57 |
+
mask_overlap=mask_overlap,
|
58 |
+
loss_mask=dict(type='mmdet.CrossEntropyLoss',
|
59 |
+
use_sigmoid=True,
|
60 |
+
reduction='none'),
|
61 |
+
loss_mask_weight=1.0),
|
62 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)),
|
63 |
+
test_cfg=dict(mask_thr_binary=0.5, fast_test=True))
|
64 |
+
|
65 |
+
pre_transform = [
|
66 |
+
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
|
67 |
+
dict(type='LoadAnnotations',
|
68 |
+
with_bbox=True,
|
69 |
+
with_mask=True,
|
70 |
+
mask2bbox=True)
|
71 |
+
]
|
72 |
+
|
73 |
+
last_transform = [
|
74 |
+
dict(type='mmdet.Albu',
|
75 |
+
transforms=_base_.albu_train_transforms,
|
76 |
+
bbox_params=dict(type='BboxParams',
|
77 |
+
format='pascal_voc',
|
78 |
+
label_fields=['gt_bboxes_labels',
|
79 |
+
'gt_ignore_flags']),
|
80 |
+
keymap={
|
81 |
+
'img': 'image',
|
82 |
+
'gt_bboxes': 'bboxes'
|
83 |
+
}),
|
84 |
+
dict(type='YOLOv5HSVRandomAug'),
|
85 |
+
dict(type='mmdet.RandomFlip', prob=0.5),
|
86 |
+
dict(type='Polygon2Mask',
|
87 |
+
downsample_ratio=downsample_ratio,
|
88 |
+
mask_overlap=mask_overlap),
|
89 |
+
]
|
90 |
+
|
91 |
+
# dataset settings
|
92 |
+
text_transform = [
|
93 |
+
dict(type='RandomLoadText',
|
94 |
+
num_neg_samples=(num_classes, num_classes),
|
95 |
+
max_num_samples=num_training_classes,
|
96 |
+
padding_to_max=True,
|
97 |
+
padding_value=''),
|
98 |
+
dict(type='PackDetInputs',
|
99 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
100 |
+
'flip_direction', 'texts'))
|
101 |
+
]
|
102 |
+
mosaic_affine_transform = [
|
103 |
+
dict(type='MultiModalMosaic',
|
104 |
+
img_scale=_base_.img_scale,
|
105 |
+
pad_val=114.0,
|
106 |
+
pre_transform=pre_transform),
|
107 |
+
dict(type='YOLOv5CopyPaste', prob=_base_.copypaste_prob),
|
108 |
+
dict(
|
109 |
+
type='YOLOv5RandomAffine',
|
110 |
+
max_rotate_degree=0.0,
|
111 |
+
max_shear_degree=0.0,
|
112 |
+
max_aspect_ratio=100.,
|
113 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
114 |
+
# img_scale is (width, height)
|
115 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
116 |
+
border_val=(114, 114, 114),
|
117 |
+
min_area_ratio=_base_.min_area_ratio,
|
118 |
+
use_mask_refine=True)
|
119 |
+
]
|
120 |
+
train_pipeline = [
|
121 |
+
*pre_transform, *mosaic_affine_transform,
|
122 |
+
dict(type='YOLOv5MultiModalMixUp',
|
123 |
+
prob=_base_.mixup_prob,
|
124 |
+
pre_transform=[*pre_transform, *mosaic_affine_transform]),
|
125 |
+
*last_transform, *text_transform
|
126 |
+
]
|
127 |
+
|
128 |
+
_train_pipeline_stage2 = [
|
129 |
+
*pre_transform,
|
130 |
+
dict(type='YOLOv5KeepRatioResize', scale=_base_.img_scale),
|
131 |
+
dict(type='LetterResize',
|
132 |
+
scale=_base_.img_scale,
|
133 |
+
allow_scale_up=True,
|
134 |
+
pad_val=dict(img=114.0)),
|
135 |
+
dict(type='YOLOv5RandomAffine',
|
136 |
+
max_rotate_degree=0.0,
|
137 |
+
max_shear_degree=0.0,
|
138 |
+
scaling_ratio_range=(1 - _base_.affine_scale,
|
139 |
+
1 + _base_.affine_scale),
|
140 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
141 |
+
border_val=(114, 114, 114),
|
142 |
+
min_area_ratio=min_area_ratio,
|
143 |
+
use_mask_refine=use_mask2refine), *last_transform
|
144 |
+
]
|
145 |
+
train_pipeline_stage2 = [*_train_pipeline_stage2, *text_transform]
|
146 |
+
coco_train_dataset = dict(
|
147 |
+
_delete_=True,
|
148 |
+
type='MultiModalDataset',
|
149 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
150 |
+
data_root='data/coco',
|
151 |
+
ann_file='lvis/lvis_v1_train_base.json',
|
152 |
+
data_prefix=dict(img=''),
|
153 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32)),
|
154 |
+
class_text_path='data/captions/lvis_v1_base_class_captions.json',
|
155 |
+
pipeline=train_pipeline)
|
156 |
+
train_dataloader = dict(persistent_workers=persistent_workers,
|
157 |
+
batch_size=train_batch_size_per_gpu,
|
158 |
+
collate_fn=dict(type='yolow_collate'),
|
159 |
+
dataset=coco_train_dataset)
|
160 |
+
|
161 |
+
test_pipeline = [
|
162 |
+
*_base_.test_pipeline[:-1],
|
163 |
+
dict(type='LoadText'),
|
164 |
+
dict(type='mmdet.PackDetInputs',
|
165 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
166 |
+
'scale_factor', 'pad_param', 'texts'))
|
167 |
+
]
|
168 |
+
|
169 |
+
# training settings
|
170 |
+
default_hooks = dict(param_scheduler=dict(scheduler_type='linear',
|
171 |
+
lr_factor=0.01,
|
172 |
+
max_epochs=max_epochs),
|
173 |
+
checkpoint=dict(max_keep_ckpts=-1,
|
174 |
+
save_best=None,
|
175 |
+
interval=save_epoch_intervals))
|
176 |
+
custom_hooks = [
|
177 |
+
dict(type='EMAHook',
|
178 |
+
ema_type='ExpMomentumEMA',
|
179 |
+
momentum=0.0001,
|
180 |
+
update_buffers=True,
|
181 |
+
strict_load=False,
|
182 |
+
priority=49),
|
183 |
+
dict(type='mmdet.PipelineSwitchHook',
|
184 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
185 |
+
switch_pipeline=train_pipeline_stage2)
|
186 |
+
]
|
187 |
+
train_cfg = dict(max_epochs=max_epochs,
|
188 |
+
val_interval=5,
|
189 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
190 |
+
_base_.val_interval_stage2)])
|
191 |
+
optim_wrapper = dict(optimizer=dict(
|
192 |
+
_delete_=True,
|
193 |
+
type='AdamW',
|
194 |
+
lr=base_lr,
|
195 |
+
weight_decay=weight_decay,
|
196 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
197 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
198 |
+
norm_decay_mult=0.0,
|
199 |
+
custom_keys={
|
200 |
+
'backbone.text_model':
|
201 |
+
dict(lr_mult=0.01),
|
202 |
+
'logit_scale':
|
203 |
+
dict(weight_decay=0.0),
|
204 |
+
}),
|
205 |
+
constructor='YOLOWv5OptimizerConstructor')
|
206 |
+
|
207 |
+
# evaluation settings
|
208 |
+
coco_val_dataset = dict(
|
209 |
+
_delete_=True,
|
210 |
+
type='MultiModalDataset',
|
211 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
212 |
+
data_root='data/coco/',
|
213 |
+
test_mode=True,
|
214 |
+
ann_file='lvis/lvis_v1_val.json',
|
215 |
+
data_prefix=dict(img=''),
|
216 |
+
batch_shapes_cfg=None),
|
217 |
+
class_text_path='data/captions/lvis_v1_class_captions.json',
|
218 |
+
pipeline=test_pipeline)
|
219 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
220 |
+
test_dataloader = val_dataloader
|
221 |
+
|
222 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
223 |
+
ann_file='data/coco/lvis/lvis_v1_val.json',
|
224 |
+
metric=['bbox', 'segm'])
|
225 |
+
test_evaluator = val_evaluator
|
226 |
+
find_unused_parameters = True
|
configs/segmentation/yolo_world_seg_l_dual_vlpan_2e-4_80e_8gpus_seghead_finetune_lvis.py
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = (
|
2 |
+
'../../third_party/mmyolo/configs/yolov8/yolov8_l_mask-refine_syncbn_fast_8xb16-500e_coco.py'
|
3 |
+
)
|
4 |
+
custom_imports = dict(imports=['yolo_world'], allow_failed_imports=False)
|
5 |
+
# hyper-parameters
|
6 |
+
num_classes = 1203
|
7 |
+
num_training_classes = 80
|
8 |
+
max_epochs = 80 # Maximum training epochs
|
9 |
+
close_mosaic_epochs = 10
|
10 |
+
save_epoch_intervals = 5
|
11 |
+
text_channels = 512
|
12 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
13 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
14 |
+
base_lr = 2e-4
|
15 |
+
|
16 |
+
weight_decay = 0.05
|
17 |
+
train_batch_size_per_gpu = 8
|
18 |
+
load_from = 'pretrained_models/yolo_world_l_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-0e566235.pth'
|
19 |
+
persistent_workers = False
|
20 |
+
|
21 |
+
# Polygon2Mask
|
22 |
+
downsample_ratio = 4
|
23 |
+
mask_overlap = False
|
24 |
+
use_mask2refine = True
|
25 |
+
max_aspect_ratio = 100
|
26 |
+
min_area_ratio = 0.01
|
27 |
+
|
28 |
+
# model settings
|
29 |
+
model = dict(
|
30 |
+
type='YOLOWorldDetector',
|
31 |
+
mm_neck=True,
|
32 |
+
num_train_classes=num_training_classes,
|
33 |
+
num_test_classes=num_classes,
|
34 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
35 |
+
backbone=dict(
|
36 |
+
_delete_=True,
|
37 |
+
type='MultiModalYOLOBackbone',
|
38 |
+
image_model={{_base_.model.backbone}},
|
39 |
+
frozen_stages=4, # frozen the image backbone
|
40 |
+
text_model=dict(
|
41 |
+
type='HuggingCLIPLanguageBackbone',
|
42 |
+
model_name='openai/clip-vit-base-patch32',
|
43 |
+
frozen_modules=['all'])),
|
44 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
45 |
+
freeze_all=True,
|
46 |
+
guide_channels=text_channels,
|
47 |
+
embed_channels=neck_embed_channels,
|
48 |
+
num_heads=neck_num_heads,
|
49 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
50 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
51 |
+
embed_channels=256,
|
52 |
+
num_heads=8)),
|
53 |
+
bbox_head=dict(type='YOLOWorldSegHead',
|
54 |
+
head_module=dict(type='YOLOWorldSegHeadModule',
|
55 |
+
embed_dims=text_channels,
|
56 |
+
num_classes=num_training_classes,
|
57 |
+
mask_channels=32,
|
58 |
+
proto_channels=256,
|
59 |
+
freeze_bbox=True),
|
60 |
+
mask_overlap=mask_overlap,
|
61 |
+
loss_mask=dict(type='mmdet.CrossEntropyLoss',
|
62 |
+
use_sigmoid=True,
|
63 |
+
reduction='none'),
|
64 |
+
loss_mask_weight=1.0),
|
65 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)),
|
66 |
+
test_cfg=dict(mask_thr_binary=0.5, fast_test=True))
|
67 |
+
|
68 |
+
pre_transform = [
|
69 |
+
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
|
70 |
+
dict(type='LoadAnnotations',
|
71 |
+
with_bbox=True,
|
72 |
+
with_mask=True,
|
73 |
+
mask2bbox=True)
|
74 |
+
]
|
75 |
+
|
76 |
+
last_transform = [
|
77 |
+
dict(type='mmdet.Albu',
|
78 |
+
transforms=_base_.albu_train_transforms,
|
79 |
+
bbox_params=dict(type='BboxParams',
|
80 |
+
format='pascal_voc',
|
81 |
+
label_fields=['gt_bboxes_labels',
|
82 |
+
'gt_ignore_flags']),
|
83 |
+
keymap={
|
84 |
+
'img': 'image',
|
85 |
+
'gt_bboxes': 'bboxes'
|
86 |
+
}),
|
87 |
+
dict(type='YOLOv5HSVRandomAug'),
|
88 |
+
dict(type='mmdet.RandomFlip', prob=0.5),
|
89 |
+
dict(type='Polygon2Mask',
|
90 |
+
downsample_ratio=downsample_ratio,
|
91 |
+
mask_overlap=mask_overlap),
|
92 |
+
]
|
93 |
+
|
94 |
+
# dataset settings
|
95 |
+
text_transform = [
|
96 |
+
dict(type='RandomLoadText',
|
97 |
+
num_neg_samples=(num_classes, num_classes),
|
98 |
+
max_num_samples=num_training_classes,
|
99 |
+
padding_to_max=True,
|
100 |
+
padding_value=''),
|
101 |
+
dict(type='PackDetInputs',
|
102 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
103 |
+
'flip_direction', 'texts'))
|
104 |
+
]
|
105 |
+
mosaic_affine_transform = [
|
106 |
+
dict(type='MultiModalMosaic',
|
107 |
+
img_scale=_base_.img_scale,
|
108 |
+
pad_val=114.0,
|
109 |
+
pre_transform=pre_transform),
|
110 |
+
dict(type='YOLOv5CopyPaste', prob=_base_.copypaste_prob),
|
111 |
+
dict(
|
112 |
+
type='YOLOv5RandomAffine',
|
113 |
+
max_rotate_degree=0.0,
|
114 |
+
max_shear_degree=0.0,
|
115 |
+
max_aspect_ratio=100.,
|
116 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
117 |
+
# img_scale is (width, height)
|
118 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
119 |
+
border_val=(114, 114, 114),
|
120 |
+
min_area_ratio=_base_.min_area_ratio,
|
121 |
+
use_mask_refine=True)
|
122 |
+
]
|
123 |
+
train_pipeline = [
|
124 |
+
*pre_transform, *mosaic_affine_transform,
|
125 |
+
dict(type='YOLOv5MultiModalMixUp',
|
126 |
+
prob=_base_.mixup_prob,
|
127 |
+
pre_transform=[*pre_transform, *mosaic_affine_transform]),
|
128 |
+
*last_transform, *text_transform
|
129 |
+
]
|
130 |
+
|
131 |
+
_train_pipeline_stage2 = [
|
132 |
+
*pre_transform,
|
133 |
+
dict(type='YOLOv5KeepRatioResize', scale=_base_.img_scale),
|
134 |
+
dict(type='LetterResize',
|
135 |
+
scale=_base_.img_scale,
|
136 |
+
allow_scale_up=True,
|
137 |
+
pad_val=dict(img=114.0)),
|
138 |
+
dict(type='YOLOv5RandomAffine',
|
139 |
+
max_rotate_degree=0.0,
|
140 |
+
max_shear_degree=0.0,
|
141 |
+
scaling_ratio_range=(1 - _base_.affine_scale,
|
142 |
+
1 + _base_.affine_scale),
|
143 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
144 |
+
border_val=(114, 114, 114),
|
145 |
+
min_area_ratio=min_area_ratio,
|
146 |
+
use_mask_refine=use_mask2refine), *last_transform
|
147 |
+
]
|
148 |
+
train_pipeline_stage2 = [*_train_pipeline_stage2, *text_transform]
|
149 |
+
coco_train_dataset = dict(
|
150 |
+
_delete_=True,
|
151 |
+
type='MultiModalDataset',
|
152 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
153 |
+
data_root='data/coco',
|
154 |
+
ann_file='lvis/lvis_v1_train_base.json',
|
155 |
+
data_prefix=dict(img=''),
|
156 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32)),
|
157 |
+
class_text_path='data/captions/lvis_v1_base_class_captions.json',
|
158 |
+
pipeline=train_pipeline)
|
159 |
+
train_dataloader = dict(persistent_workers=persistent_workers,
|
160 |
+
batch_size=train_batch_size_per_gpu,
|
161 |
+
collate_fn=dict(type='yolow_collate'),
|
162 |
+
dataset=coco_train_dataset)
|
163 |
+
|
164 |
+
test_pipeline = [
|
165 |
+
*_base_.test_pipeline[:-1],
|
166 |
+
dict(type='LoadText'),
|
167 |
+
dict(type='mmdet.PackDetInputs',
|
168 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
169 |
+
'scale_factor', 'pad_param', 'texts'))
|
170 |
+
]
|
171 |
+
|
172 |
+
# training settings
|
173 |
+
default_hooks = dict(param_scheduler=dict(scheduler_type='linear',
|
174 |
+
lr_factor=0.01,
|
175 |
+
max_epochs=max_epochs),
|
176 |
+
checkpoint=dict(max_keep_ckpts=-1,
|
177 |
+
save_best=None,
|
178 |
+
interval=save_epoch_intervals))
|
179 |
+
custom_hooks = [
|
180 |
+
dict(type='EMAHook',
|
181 |
+
ema_type='ExpMomentumEMA',
|
182 |
+
momentum=0.0001,
|
183 |
+
update_buffers=True,
|
184 |
+
strict_load=False,
|
185 |
+
priority=49),
|
186 |
+
dict(type='mmdet.PipelineSwitchHook',
|
187 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
188 |
+
switch_pipeline=train_pipeline_stage2)
|
189 |
+
]
|
190 |
+
train_cfg = dict(max_epochs=max_epochs,
|
191 |
+
val_interval=5,
|
192 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
193 |
+
_base_.val_interval_stage2)])
|
194 |
+
optim_wrapper = dict(optimizer=dict(
|
195 |
+
_delete_=True,
|
196 |
+
type='AdamW',
|
197 |
+
lr=base_lr,
|
198 |
+
weight_decay=weight_decay,
|
199 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
200 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
201 |
+
norm_decay_mult=0.0,
|
202 |
+
custom_keys={
|
203 |
+
'backbone.text_model':
|
204 |
+
dict(lr_mult=0.01),
|
205 |
+
'logit_scale':
|
206 |
+
dict(weight_decay=0.0),
|
207 |
+
'neck':
|
208 |
+
dict(lr_mult=0.0),
|
209 |
+
'head.head_module.reg_preds':
|
210 |
+
dict(lr_mult=0.0),
|
211 |
+
'head.head_module.cls_preds':
|
212 |
+
dict(lr_mult=0.0),
|
213 |
+
'head.head_module.cls_contrasts':
|
214 |
+
dict(lr_mult=0.0)
|
215 |
+
}),
|
216 |
+
constructor='YOLOWv5OptimizerConstructor')
|
217 |
+
|
218 |
+
# evaluation settings
|
219 |
+
coco_val_dataset = dict(
|
220 |
+
_delete_=True,
|
221 |
+
type='MultiModalDataset',
|
222 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
223 |
+
data_root='data/coco/',
|
224 |
+
test_mode=True,
|
225 |
+
ann_file='lvis/lvis_v1_val.json',
|
226 |
+
data_prefix=dict(img=''),
|
227 |
+
batch_shapes_cfg=None),
|
228 |
+
class_text_path='data/captions/lvis_v1_class_captions.json',
|
229 |
+
pipeline=test_pipeline)
|
230 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
231 |
+
test_dataloader = val_dataloader
|
232 |
+
|
233 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
234 |
+
ann_file='data/coco/lvis/lvis_v1_val.json',
|
235 |
+
metric=['bbox', 'segm'])
|
236 |
+
test_evaluator = val_evaluator
|
237 |
+
find_unused_parameters = True
|
configs/segmentation/yolo_world_seg_m_dual_vlpan_2e-4_80e_8gpus_allmodules_finetune_lvis.py
ADDED
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = (
|
2 |
+
'../../third_party/mmyolo/configs/yolov8/yolov8_m_mask-refine_syncbn_fast_8xb16-500e_coco.py'
|
3 |
+
)
|
4 |
+
custom_imports = dict(imports=['yolo_world'], allow_failed_imports=False)
|
5 |
+
# hyper-parameters
|
6 |
+
num_classes = 1203
|
7 |
+
num_training_classes = 80
|
8 |
+
max_epochs = 80 # Maximum training epochs
|
9 |
+
close_mosaic_epochs = 10
|
10 |
+
save_epoch_intervals = 5
|
11 |
+
text_channels = 512
|
12 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
13 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
14 |
+
base_lr = 2e-4
|
15 |
+
|
16 |
+
weight_decay = 0.05
|
17 |
+
train_batch_size_per_gpu = 8
|
18 |
+
load_from = 'pretrained_models/yolo_world_m_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-2b7bd1be.pth'
|
19 |
+
persistent_workers = False
|
20 |
+
|
21 |
+
# Polygon2Mask
|
22 |
+
downsample_ratio = 4
|
23 |
+
mask_overlap = False
|
24 |
+
use_mask2refine = True
|
25 |
+
max_aspect_ratio = 100
|
26 |
+
min_area_ratio = 0.01
|
27 |
+
|
28 |
+
# model settings
|
29 |
+
model = dict(
|
30 |
+
type='YOLOWorldDetector',
|
31 |
+
mm_neck=True,
|
32 |
+
num_train_classes=num_training_classes,
|
33 |
+
num_test_classes=num_classes,
|
34 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
35 |
+
backbone=dict(
|
36 |
+
_delete_=True,
|
37 |
+
type='MultiModalYOLOBackbone',
|
38 |
+
image_model={{_base_.model.backbone}},
|
39 |
+
text_model=dict(
|
40 |
+
type='HuggingCLIPLanguageBackbone',
|
41 |
+
model_name='openai/clip-vit-base-patch32',
|
42 |
+
frozen_modules=[])),
|
43 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
44 |
+
guide_channels=text_channels,
|
45 |
+
embed_channels=neck_embed_channels,
|
46 |
+
num_heads=neck_num_heads,
|
47 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
48 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
49 |
+
embed_channels=256,
|
50 |
+
num_heads=8)),
|
51 |
+
bbox_head=dict(type='YOLOWorldSegHead',
|
52 |
+
head_module=dict(type='YOLOWorldSegHeadModule',
|
53 |
+
embed_dims=text_channels,
|
54 |
+
num_classes=num_training_classes,
|
55 |
+
mask_channels=32,
|
56 |
+
proto_channels=256),
|
57 |
+
mask_overlap=mask_overlap,
|
58 |
+
loss_mask=dict(type='mmdet.CrossEntropyLoss',
|
59 |
+
use_sigmoid=True,
|
60 |
+
reduction='none'),
|
61 |
+
loss_mask_weight=1.0),
|
62 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)),
|
63 |
+
test_cfg=dict(mask_thr_binary=0.5, fast_test=True))
|
64 |
+
|
65 |
+
pre_transform = [
|
66 |
+
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
|
67 |
+
dict(type='LoadAnnotations',
|
68 |
+
with_bbox=True,
|
69 |
+
with_mask=True,
|
70 |
+
mask2bbox=True)
|
71 |
+
]
|
72 |
+
|
73 |
+
last_transform = [
|
74 |
+
dict(type='mmdet.Albu',
|
75 |
+
transforms=_base_.albu_train_transforms,
|
76 |
+
bbox_params=dict(type='BboxParams',
|
77 |
+
format='pascal_voc',
|
78 |
+
label_fields=['gt_bboxes_labels',
|
79 |
+
'gt_ignore_flags']),
|
80 |
+
keymap={
|
81 |
+
'img': 'image',
|
82 |
+
'gt_bboxes': 'bboxes'
|
83 |
+
}),
|
84 |
+
dict(type='YOLOv5HSVRandomAug'),
|
85 |
+
dict(type='mmdet.RandomFlip', prob=0.5),
|
86 |
+
dict(type='Polygon2Mask',
|
87 |
+
downsample_ratio=downsample_ratio,
|
88 |
+
mask_overlap=mask_overlap),
|
89 |
+
]
|
90 |
+
|
91 |
+
# dataset settings
|
92 |
+
text_transform = [
|
93 |
+
dict(type='RandomLoadText',
|
94 |
+
num_neg_samples=(num_classes, num_classes),
|
95 |
+
max_num_samples=num_training_classes,
|
96 |
+
padding_to_max=True,
|
97 |
+
padding_value=''),
|
98 |
+
dict(type='PackDetInputs',
|
99 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
100 |
+
'flip_direction', 'texts'))
|
101 |
+
]
|
102 |
+
mosaic_affine_transform = [
|
103 |
+
dict(type='MultiModalMosaic',
|
104 |
+
img_scale=_base_.img_scale,
|
105 |
+
pad_val=114.0,
|
106 |
+
pre_transform=pre_transform),
|
107 |
+
dict(type='YOLOv5CopyPaste', prob=_base_.copypaste_prob),
|
108 |
+
dict(
|
109 |
+
type='YOLOv5RandomAffine',
|
110 |
+
max_rotate_degree=0.0,
|
111 |
+
max_shear_degree=0.0,
|
112 |
+
max_aspect_ratio=100.,
|
113 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
114 |
+
# img_scale is (width, height)
|
115 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
116 |
+
border_val=(114, 114, 114),
|
117 |
+
min_area_ratio=_base_.min_area_ratio,
|
118 |
+
use_mask_refine=True)
|
119 |
+
]
|
120 |
+
train_pipeline = [
|
121 |
+
*pre_transform, *mosaic_affine_transform,
|
122 |
+
dict(type='YOLOv5MultiModalMixUp',
|
123 |
+
prob=_base_.mixup_prob,
|
124 |
+
pre_transform=[*pre_transform, *mosaic_affine_transform]),
|
125 |
+
*last_transform, *text_transform
|
126 |
+
]
|
127 |
+
|
128 |
+
_train_pipeline_stage2 = [
|
129 |
+
*pre_transform,
|
130 |
+
dict(type='YOLOv5KeepRatioResize', scale=_base_.img_scale),
|
131 |
+
dict(type='LetterResize',
|
132 |
+
scale=_base_.img_scale,
|
133 |
+
allow_scale_up=True,
|
134 |
+
pad_val=dict(img=114.0)),
|
135 |
+
dict(type='YOLOv5RandomAffine',
|
136 |
+
max_rotate_degree=0.0,
|
137 |
+
max_shear_degree=0.0,
|
138 |
+
scaling_ratio_range=(1 - _base_.affine_scale,
|
139 |
+
1 + _base_.affine_scale),
|
140 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
141 |
+
border_val=(114, 114, 114),
|
142 |
+
min_area_ratio=min_area_ratio,
|
143 |
+
use_mask_refine=use_mask2refine), *last_transform
|
144 |
+
]
|
145 |
+
train_pipeline_stage2 = [*_train_pipeline_stage2, *text_transform]
|
146 |
+
coco_train_dataset = dict(
|
147 |
+
_delete_=True,
|
148 |
+
type='MultiModalDataset',
|
149 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
150 |
+
data_root='data/coco',
|
151 |
+
ann_file='lvis/lvis_v1_train_base.json',
|
152 |
+
data_prefix=dict(img=''),
|
153 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32)),
|
154 |
+
class_text_path='data/captions/lvis_v1_base_class_captions.json',
|
155 |
+
pipeline=train_pipeline)
|
156 |
+
train_dataloader = dict(persistent_workers=persistent_workers,
|
157 |
+
batch_size=train_batch_size_per_gpu,
|
158 |
+
collate_fn=dict(type='yolow_collate'),
|
159 |
+
dataset=coco_train_dataset)
|
160 |
+
|
161 |
+
test_pipeline = [
|
162 |
+
*_base_.test_pipeline[:-1],
|
163 |
+
dict(type='LoadText'),
|
164 |
+
dict(type='mmdet.PackDetInputs',
|
165 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
166 |
+
'scale_factor', 'pad_param', 'texts'))
|
167 |
+
]
|
168 |
+
|
169 |
+
# training settings
|
170 |
+
default_hooks = dict(param_scheduler=dict(scheduler_type='linear',
|
171 |
+
lr_factor=0.01,
|
172 |
+
max_epochs=max_epochs),
|
173 |
+
checkpoint=dict(max_keep_ckpts=-1,
|
174 |
+
save_best=None,
|
175 |
+
interval=save_epoch_intervals))
|
176 |
+
custom_hooks = [
|
177 |
+
dict(type='EMAHook',
|
178 |
+
ema_type='ExpMomentumEMA',
|
179 |
+
momentum=0.0001,
|
180 |
+
update_buffers=True,
|
181 |
+
strict_load=False,
|
182 |
+
priority=49),
|
183 |
+
dict(type='mmdet.PipelineSwitchHook',
|
184 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
185 |
+
switch_pipeline=train_pipeline_stage2)
|
186 |
+
]
|
187 |
+
train_cfg = dict(max_epochs=max_epochs,
|
188 |
+
val_interval=5,
|
189 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
190 |
+
_base_.val_interval_stage2)])
|
191 |
+
optim_wrapper = dict(optimizer=dict(
|
192 |
+
_delete_=True,
|
193 |
+
type='AdamW',
|
194 |
+
lr=base_lr,
|
195 |
+
weight_decay=weight_decay,
|
196 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
197 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
198 |
+
norm_decay_mult=0.0,
|
199 |
+
custom_keys={
|
200 |
+
'backbone.text_model':
|
201 |
+
dict(lr_mult=0.01),
|
202 |
+
'logit_scale':
|
203 |
+
dict(weight_decay=0.0)
|
204 |
+
}),
|
205 |
+
constructor='YOLOWv5OptimizerConstructor')
|
206 |
+
|
207 |
+
# evaluation settings
|
208 |
+
coco_val_dataset = dict(
|
209 |
+
_delete_=True,
|
210 |
+
type='MultiModalDataset',
|
211 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
212 |
+
data_root='data/coco/',
|
213 |
+
test_mode=True,
|
214 |
+
ann_file='lvis/lvis_v1_val.json',
|
215 |
+
data_prefix=dict(img=''),
|
216 |
+
batch_shapes_cfg=None),
|
217 |
+
class_text_path='data/captions/lvis_v1_class_captions.json',
|
218 |
+
pipeline=test_pipeline)
|
219 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
220 |
+
test_dataloader = val_dataloader
|
221 |
+
|
222 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
223 |
+
ann_file='data/coco/lvis/lvis_v1_val.json',
|
224 |
+
metric=['bbox', 'segm'])
|
225 |
+
test_evaluator = val_evaluator
|
226 |
+
find_unused_parameters = True
|
configs/segmentation/yolo_world_seg_m_dual_vlpan_2e-4_80e_8gpus_seghead_finetune_lvis.py
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = (
|
2 |
+
'../../third_party/mmyolo/configs/yolov8/yolov8_m_mask-refine_syncbn_fast_8xb16-500e_coco.py'
|
3 |
+
)
|
4 |
+
custom_imports = dict(imports=['yolo_world'], allow_failed_imports=False)
|
5 |
+
# hyper-parameters
|
6 |
+
num_classes = 1203
|
7 |
+
num_training_classes = 80
|
8 |
+
max_epochs = 80 # Maximum training epochs
|
9 |
+
close_mosaic_epochs = 10
|
10 |
+
save_epoch_intervals = 5
|
11 |
+
text_channels = 512
|
12 |
+
neck_embed_channels = [128, 256, _base_.last_stage_out_channels // 2]
|
13 |
+
neck_num_heads = [4, 8, _base_.last_stage_out_channels // 2 // 32]
|
14 |
+
base_lr = 2e-4
|
15 |
+
|
16 |
+
weight_decay = 0.05
|
17 |
+
train_batch_size_per_gpu = 8
|
18 |
+
load_from = 'pretrained_models/yolo_world_m_clip_base_dual_vlpan_2e-3adamw_32xb16_100e_o365_goldg_train_pretrained-2b7bd1be.pth'
|
19 |
+
persistent_workers = False
|
20 |
+
|
21 |
+
# Polygon2Mask
|
22 |
+
downsample_ratio = 4
|
23 |
+
mask_overlap = False
|
24 |
+
use_mask2refine = True
|
25 |
+
max_aspect_ratio = 100
|
26 |
+
min_area_ratio = 0.01
|
27 |
+
|
28 |
+
# model settings
|
29 |
+
model = dict(
|
30 |
+
type='YOLOWorldDetector',
|
31 |
+
mm_neck=True,
|
32 |
+
num_train_classes=num_training_classes,
|
33 |
+
num_test_classes=num_classes,
|
34 |
+
data_preprocessor=dict(type='YOLOWDetDataPreprocessor'),
|
35 |
+
backbone=dict(
|
36 |
+
_delete_=True,
|
37 |
+
type='MultiModalYOLOBackbone',
|
38 |
+
image_model={{_base_.model.backbone}},
|
39 |
+
frozen_stages=4, # frozen the image backbone
|
40 |
+
text_model=dict(
|
41 |
+
type='HuggingCLIPLanguageBackbone',
|
42 |
+
model_name='openai/clip-vit-base-patch32',
|
43 |
+
frozen_modules=['all'])),
|
44 |
+
neck=dict(type='YOLOWolrdDualPAFPN',
|
45 |
+
freeze_all=True,
|
46 |
+
guide_channels=text_channels,
|
47 |
+
embed_channels=neck_embed_channels,
|
48 |
+
num_heads=neck_num_heads,
|
49 |
+
block_cfg=dict(type='MaxSigmoidCSPLayerWithTwoConv'),
|
50 |
+
text_enhancder=dict(type='ImagePoolingAttentionModule',
|
51 |
+
embed_channels=256,
|
52 |
+
num_heads=8)),
|
53 |
+
bbox_head=dict(type='YOLOWorldSegHead',
|
54 |
+
head_module=dict(type='YOLOWorldSegHeadModule',
|
55 |
+
embed_dims=text_channels,
|
56 |
+
num_classes=num_training_classes,
|
57 |
+
mask_channels=32,
|
58 |
+
proto_channels=256,
|
59 |
+
freeze_bbox=True),
|
60 |
+
mask_overlap=mask_overlap,
|
61 |
+
loss_mask=dict(type='mmdet.CrossEntropyLoss',
|
62 |
+
use_sigmoid=True,
|
63 |
+
reduction='none'),
|
64 |
+
loss_mask_weight=1.0),
|
65 |
+
train_cfg=dict(assigner=dict(num_classes=num_training_classes)),
|
66 |
+
test_cfg=dict(mask_thr_binary=0.5, fast_test=True))
|
67 |
+
|
68 |
+
pre_transform = [
|
69 |
+
dict(type='LoadImageFromFile', backend_args=_base_.backend_args),
|
70 |
+
dict(type='LoadAnnotations',
|
71 |
+
with_bbox=True,
|
72 |
+
with_mask=True,
|
73 |
+
mask2bbox=True)
|
74 |
+
]
|
75 |
+
|
76 |
+
last_transform = [
|
77 |
+
dict(type='mmdet.Albu',
|
78 |
+
transforms=_base_.albu_train_transforms,
|
79 |
+
bbox_params=dict(type='BboxParams',
|
80 |
+
format='pascal_voc',
|
81 |
+
label_fields=['gt_bboxes_labels',
|
82 |
+
'gt_ignore_flags']),
|
83 |
+
keymap={
|
84 |
+
'img': 'image',
|
85 |
+
'gt_bboxes': 'bboxes'
|
86 |
+
}),
|
87 |
+
dict(type='YOLOv5HSVRandomAug'),
|
88 |
+
dict(type='mmdet.RandomFlip', prob=0.5),
|
89 |
+
dict(type='Polygon2Mask',
|
90 |
+
downsample_ratio=downsample_ratio,
|
91 |
+
mask_overlap=mask_overlap),
|
92 |
+
]
|
93 |
+
|
94 |
+
# dataset settings
|
95 |
+
text_transform = [
|
96 |
+
dict(type='RandomLoadText',
|
97 |
+
num_neg_samples=(num_classes, num_classes),
|
98 |
+
max_num_samples=num_training_classes,
|
99 |
+
padding_to_max=True,
|
100 |
+
padding_value=''),
|
101 |
+
dict(type='PackDetInputs',
|
102 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip',
|
103 |
+
'flip_direction', 'texts'))
|
104 |
+
]
|
105 |
+
mosaic_affine_transform = [
|
106 |
+
dict(type='MultiModalMosaic',
|
107 |
+
img_scale=_base_.img_scale,
|
108 |
+
pad_val=114.0,
|
109 |
+
pre_transform=pre_transform),
|
110 |
+
dict(type='YOLOv5CopyPaste', prob=_base_.copypaste_prob),
|
111 |
+
dict(
|
112 |
+
type='YOLOv5RandomAffine',
|
113 |
+
max_rotate_degree=0.0,
|
114 |
+
max_shear_degree=0.0,
|
115 |
+
max_aspect_ratio=100.,
|
116 |
+
scaling_ratio_range=(1 - _base_.affine_scale, 1 + _base_.affine_scale),
|
117 |
+
# img_scale is (width, height)
|
118 |
+
border=(-_base_.img_scale[0] // 2, -_base_.img_scale[1] // 2),
|
119 |
+
border_val=(114, 114, 114),
|
120 |
+
min_area_ratio=_base_.min_area_ratio,
|
121 |
+
use_mask_refine=True)
|
122 |
+
]
|
123 |
+
train_pipeline = [
|
124 |
+
*pre_transform, *mosaic_affine_transform,
|
125 |
+
dict(type='YOLOv5MultiModalMixUp',
|
126 |
+
prob=_base_.mixup_prob,
|
127 |
+
pre_transform=[*pre_transform, *mosaic_affine_transform]),
|
128 |
+
*last_transform, *text_transform
|
129 |
+
]
|
130 |
+
|
131 |
+
_train_pipeline_stage2 = [
|
132 |
+
*pre_transform,
|
133 |
+
dict(type='YOLOv5KeepRatioResize', scale=_base_.img_scale),
|
134 |
+
dict(type='LetterResize',
|
135 |
+
scale=_base_.img_scale,
|
136 |
+
allow_scale_up=True,
|
137 |
+
pad_val=dict(img=114.0)),
|
138 |
+
dict(type='YOLOv5RandomAffine',
|
139 |
+
max_rotate_degree=0.0,
|
140 |
+
max_shear_degree=0.0,
|
141 |
+
scaling_ratio_range=(1 - _base_.affine_scale,
|
142 |
+
1 + _base_.affine_scale),
|
143 |
+
max_aspect_ratio=_base_.max_aspect_ratio,
|
144 |
+
border_val=(114, 114, 114),
|
145 |
+
min_area_ratio=min_area_ratio,
|
146 |
+
use_mask_refine=use_mask2refine), *last_transform
|
147 |
+
]
|
148 |
+
train_pipeline_stage2 = [*_train_pipeline_stage2, *text_transform]
|
149 |
+
coco_train_dataset = dict(
|
150 |
+
_delete_=True,
|
151 |
+
type='MultiModalDataset',
|
152 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
153 |
+
data_root='data/coco',
|
154 |
+
ann_file='lvis/lvis_v1_train_base.json',
|
155 |
+
data_prefix=dict(img=''),
|
156 |
+
filter_cfg=dict(filter_empty_gt=True, min_size=32)),
|
157 |
+
class_text_path='data/captions/lvis_v1_base_class_captions.json',
|
158 |
+
pipeline=train_pipeline)
|
159 |
+
train_dataloader = dict(persistent_workers=persistent_workers,
|
160 |
+
batch_size=train_batch_size_per_gpu,
|
161 |
+
collate_fn=dict(type='yolow_collate'),
|
162 |
+
dataset=coco_train_dataset)
|
163 |
+
|
164 |
+
test_pipeline = [
|
165 |
+
*_base_.test_pipeline[:-1],
|
166 |
+
dict(type='LoadText'),
|
167 |
+
dict(type='mmdet.PackDetInputs',
|
168 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
169 |
+
'scale_factor', 'pad_param', 'texts'))
|
170 |
+
]
|
171 |
+
|
172 |
+
# training settings
|
173 |
+
default_hooks = dict(param_scheduler=dict(scheduler_type='linear',
|
174 |
+
lr_factor=0.01,
|
175 |
+
max_epochs=max_epochs),
|
176 |
+
checkpoint=dict(max_keep_ckpts=-1,
|
177 |
+
save_best=None,
|
178 |
+
interval=save_epoch_intervals))
|
179 |
+
custom_hooks = [
|
180 |
+
dict(type='EMAHook',
|
181 |
+
ema_type='ExpMomentumEMA',
|
182 |
+
momentum=0.0001,
|
183 |
+
update_buffers=True,
|
184 |
+
strict_load=False,
|
185 |
+
priority=49),
|
186 |
+
dict(type='mmdet.PipelineSwitchHook',
|
187 |
+
switch_epoch=max_epochs - close_mosaic_epochs,
|
188 |
+
switch_pipeline=train_pipeline_stage2)
|
189 |
+
]
|
190 |
+
train_cfg = dict(max_epochs=max_epochs,
|
191 |
+
val_interval=5,
|
192 |
+
dynamic_intervals=[((max_epochs - close_mosaic_epochs),
|
193 |
+
_base_.val_interval_stage2)])
|
194 |
+
optim_wrapper = dict(optimizer=dict(
|
195 |
+
_delete_=True,
|
196 |
+
type='AdamW',
|
197 |
+
lr=base_lr,
|
198 |
+
weight_decay=weight_decay,
|
199 |
+
batch_size_per_gpu=train_batch_size_per_gpu),
|
200 |
+
paramwise_cfg=dict(bias_decay_mult=0.0,
|
201 |
+
norm_decay_mult=0.0,
|
202 |
+
custom_keys={
|
203 |
+
'backbone.text_model':
|
204 |
+
dict(lr_mult=0.01),
|
205 |
+
'logit_scale':
|
206 |
+
dict(weight_decay=0.0),
|
207 |
+
'neck':
|
208 |
+
dict(lr_mult=0.0),
|
209 |
+
'head.head_module.reg_preds':
|
210 |
+
dict(lr_mult=0.0),
|
211 |
+
'head.head_module.cls_preds':
|
212 |
+
dict(lr_mult=0.0),
|
213 |
+
'head.head_module.cls_contrasts':
|
214 |
+
dict(lr_mult=0.0)
|
215 |
+
}),
|
216 |
+
constructor='YOLOWv5OptimizerConstructor')
|
217 |
+
|
218 |
+
# evaluation settings
|
219 |
+
coco_val_dataset = dict(
|
220 |
+
_delete_=True,
|
221 |
+
type='MultiModalDataset',
|
222 |
+
dataset=dict(type='YOLOv5LVISV1Dataset',
|
223 |
+
data_root='data/coco/',
|
224 |
+
test_mode=True,
|
225 |
+
ann_file='lvis/lvis_v1_val.json',
|
226 |
+
data_prefix=dict(img=''),
|
227 |
+
batch_shapes_cfg=None),
|
228 |
+
class_text_path='data/captions/lvis_v1_class_captions.json',
|
229 |
+
pipeline=test_pipeline)
|
230 |
+
val_dataloader = dict(dataset=coco_val_dataset)
|
231 |
+
test_dataloader = val_dataloader
|
232 |
+
|
233 |
+
val_evaluator = dict(type='mmdet.LVISMetric',
|
234 |
+
ann_file='data/coco/lvis/lvis_v1_val.json',
|
235 |
+
metric=['bbox', 'segm'])
|
236 |
+
test_evaluator = val_evaluator
|
237 |
+
find_unused_parameters = True
|
data/texts/coco_class_texts.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[["person"], ["bicycle"], ["car"], ["motorcycle"], ["airplane"], ["bus"], ["train"], ["truck"], ["boat"], ["traffic light"], ["fire hydrant"], ["stop sign"], ["parking meter"], ["bench"], ["bird"], ["cat"], ["dog"], ["horse"], ["sheep"], ["cow"], ["elephant"], ["bear"], ["zebra"], ["giraffe"], ["backpack"], ["umbrella"], ["handbag"], ["tie"], ["suitcase"], ["frisbee"], ["skis"], ["snowboard"], ["sports ball"], ["kite"], ["baseball bat"], ["baseball glove"], ["skateboard"], ["surfboard"], ["tennis racket"], ["bottle"], ["wine glass"], ["cup"], ["fork"], ["knife"], ["spoon"], ["bowl"], ["banana"], ["apple"], ["sandwich"], ["orange"], ["broccoli"], ["carrot"], ["hot dog"], ["pizza"], ["donut"], ["cake"], ["chair"], ["couch"], ["potted plant"], ["bed"], ["dining table"], ["toilet"], ["tv"], ["laptop"], ["mouse"], ["remote"], ["keyboard"], ["cell phone"], ["microwave"], ["oven"], ["toaster"], ["sink"], ["refrigerator"], ["book"], ["clock"], ["vase"], ["scissors"], ["teddy bear"], ["hair drier"], ["toothbrush"]]
|
data/texts/lvis_v1_class_texts.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[["aerosol can", "spray can"], ["air conditioner"], ["airplane", "aeroplane"], ["alarm clock"], ["alcohol", "alcoholic beverage"], ["alligator", "gator"], ["almond"], ["ambulance"], ["amplifier"], ["anklet", "ankle bracelet"], ["antenna", "aerial", "transmitting aerial"], ["apple"], ["applesauce"], ["apricot"], ["apron"], ["aquarium", "fish tank"], ["arctic", "arctic type of shoe", "galosh", "golosh", "rubber", "rubber type of shoe", "gumshoe"], ["armband"], ["armchair"], ["armoire"], ["armor", "armour"], ["artichoke"], ["trash can", "garbage can", "wastebin", "dustbin", "trash barrel", "trash bin"], ["ashtray"], ["asparagus"], ["atomizer", "atomiser", "spray", "sprayer", "nebulizer", "nebuliser"], ["avocado"], ["award", "accolade"], ["awning"], ["ax", "axe"], ["baboon"], ["baby buggy", "baby carriage", "perambulator", "pram", "stroller"], ["basketball backboard"], ["backpack", "knapsack", "packsack", "rucksack", "haversack"], ["handbag", "purse", "pocketbook"], ["suitcase", "baggage", "luggage"], ["bagel", "beigel"], ["bagpipe"], ["baguet", "baguette"], ["bait", "lure"], ["ball"], ["ballet skirt", "tutu"], ["balloon"], ["bamboo"], ["banana"], ["Band Aid"], ["bandage"], ["bandanna", "bandana"], ["banjo"], ["banner", "streamer"], ["barbell"], ["barge"], ["barrel", "cask"], ["barrette"], ["barrow", "garden cart", "lawn cart", "wheelbarrow"], ["baseball base"], ["baseball"], ["baseball bat"], ["baseball cap", "jockey cap", "golf cap"], ["baseball glove", "baseball mitt"], ["basket", "handbasket"], ["basketball"], ["bass horn", "sousaphone", "tuba"], ["bat", "bat animal"], ["bath mat"], ["bath towel"], ["bathrobe"], ["bathtub", "bathing tub"], ["batter", "batter food"], ["battery"], ["beachball"], ["bead"], ["bean curd", "tofu"], ["beanbag"], ["beanie", "beany"], ["bear"], ["bed"], ["bedpan"], ["bedspread", "bedcover", "bed covering", "counterpane", "spread"], ["cow"], ["beef", "beef food", "boeuf", "boeuf food"], ["beeper", "pager"], ["beer bottle"], ["beer can"], ["beetle"], ["bell"], ["bell pepper", "capsicum"], ["belt"], ["belt buckle"], ["bench"], ["beret"], ["bib"], ["Bible"], ["bicycle", "bike", "bike bicycle"], ["visor", "vizor"], ["billboard"], ["binder", "ring-binder"], ["binoculars", "field glasses", "opera glasses"], ["bird"], ["birdfeeder"], ["birdbath"], ["birdcage"], ["birdhouse"], ["birthday cake"], ["birthday card"], ["pirate flag"], ["black sheep"], ["blackberry"], ["blackboard", "chalkboard"], ["blanket"], ["blazer", "sport jacket", "sport coat", "sports jacket", "sports coat"], ["blender", "liquidizer", "liquidiser"], ["blimp"], ["blinker", "flasher"], ["blouse"], ["blueberry"], ["gameboard"], ["boat", "ship", "ship boat"], ["bob", "bobber", "bobfloat"], ["bobbin", "spool", "reel"], ["bobby pin", "hairgrip"], ["boiled egg", "coddled egg"], ["bolo tie", "bolo", "bola tie", "bola"], ["deadbolt"], ["bolt"], ["bonnet"], ["book"], ["bookcase"], ["booklet", "brochure", "leaflet", "pamphlet"], ["bookmark", "bookmarker"], ["boom microphone", "microphone boom"], ["boot"], ["bottle"], ["bottle opener"], ["bouquet"], ["bow", "bow weapon"], ["bow", "bow decorative ribbons"], ["bow-tie", "bowtie"], ["bowl"], ["pipe bowl"], ["bowler hat", "bowler", "derby hat", "derby", "plug hat"], ["bowling ball"], ["box"], ["boxing glove"], ["suspenders"], ["bracelet", "bangle"], ["brass plaque"], ["brassiere", "bra", "bandeau"], ["bread-bin", "breadbox"], ["bread"], ["breechcloth", "breechclout", "loincloth"], ["bridal gown", "wedding gown", "wedding dress"], ["briefcase"], ["broccoli"], ["broach"], ["broom"], ["brownie"], ["brussels sprouts"], ["bubble gum"], ["bucket", "pail"], ["horse buggy"], ["horned cow"], ["bulldog"], ["bulldozer", "dozer"], ["bullet train"], ["bulletin board", "notice board"], ["bulletproof vest"], ["bullhorn", "megaphone"], ["bun", "roll"], ["bunk bed"], ["buoy"], ["burrito"], ["bus", "bus vehicle", "autobus", "charabanc", "double-decker", "motorbus", "motorcoach"], ["business card"], ["butter"], ["butterfly"], ["button"], ["cab", "cab taxi", "taxi", "taxicab"], ["cabana"], ["cabin car", "caboose"], ["cabinet"], ["locker", "storage locker"], ["cake"], ["calculator"], ["calendar"], ["calf"], ["camcorder"], ["camel"], ["camera"], ["camera lens"], ["camper", "camper vehicle", "camping bus", "motor home"], ["can", "tin can"], ["can opener", "tin opener"], ["candle", "candlestick"], ["candle holder"], ["candy bar"], ["candy cane"], ["walking cane"], ["canister", "cannister"], ["canoe"], ["cantaloup", "cantaloupe"], ["canteen"], ["cap", "cap headwear"], ["bottle cap", "cap", "cap container lid"], ["cape"], ["cappuccino", "coffee cappuccino"], ["car", "car automobile", "auto", "auto automobile", "automobile"], ["railcar", "railcar part of a train", "railway car", "railway car part of a train", "railroad car", "railroad car part of a train"], ["elevator car"], ["car battery", "automobile battery"], ["identity card"], ["card"], ["cardigan"], ["cargo ship", "cargo vessel"], ["carnation"], ["horse carriage"], ["carrot"], ["tote bag"], ["cart"], ["carton"], ["cash register", "register", "register for cash transactions"], ["casserole"], ["cassette"], ["cast", "plaster cast", "plaster bandage"], ["cat"], ["cauliflower"], ["cayenne", "cayenne spice", "cayenne pepper", "cayenne pepper spice", "red pepper", "red pepper spice"], ["CD player"], ["celery"], ["cellular telephone", "cellular phone", "cellphone", "mobile phone", "smart phone"], ["chain mail", "ring mail", "chain armor", "chain armour", "ring armor", "ring armour"], ["chair"], ["chaise longue", "chaise", "daybed"], ["chalice"], ["chandelier"], ["chap"], ["checkbook", "chequebook"], ["checkerboard"], ["cherry"], ["chessboard"], ["chicken", "chicken animal"], ["chickpea", "garbanzo"], ["chili", "chili vegetable", "chili pepper", "chili pepper vegetable", "chilli", "chilli vegetable", "chilly", "chilly vegetable", "chile", "chile vegetable"], ["chime", "gong"], ["chinaware"], ["crisp", "crisp potato chip", "potato chip"], ["poker chip"], ["chocolate bar"], ["chocolate cake"], ["chocolate milk"], ["chocolate mousse"], ["choker", "collar", "neckband"], ["chopping board", "cutting board", "chopping block"], ["chopstick"], ["Christmas tree"], ["slide"], ["cider", "cyder"], ["cigar box"], ["cigarette"], ["cigarette case", "cigarette pack"], ["cistern", "water tank"], ["clarinet"], ["clasp"], ["cleansing agent", "cleanser", "cleaner"], ["cleat", "cleat for securing rope"], ["clementine"], ["clip"], ["clipboard"], ["clippers", "clippers for plants"], ["cloak"], ["clock", "timepiece", "timekeeper"], ["clock tower"], ["clothes hamper", "laundry basket", "clothes basket"], ["clothespin", "clothes peg"], ["clutch bag"], ["coaster"], ["coat"], ["coat hanger", "clothes hanger", "dress hanger"], ["coatrack", "hatrack"], ["cock", "rooster"], ["cockroach"], ["cocoa", "cocoa beverage", "hot chocolate", "hot chocolate beverage", "drinking chocolate"], ["coconut", "cocoanut"], ["coffee maker", "coffee machine"], ["coffee table", "cocktail table"], ["coffeepot"], ["coil"], ["coin"], ["colander", "cullender"], ["coleslaw", "slaw"], ["coloring material", "colouring material"], ["combination lock"], ["pacifier", "teething ring"], ["comic book"], ["compass"], ["computer keyboard", "keyboard", "keyboard computer"], ["condiment"], ["cone", "traffic cone"], ["control", "controller"], ["convertible", "convertible automobile"], ["sofa bed"], ["cooker"], ["cookie", "cooky", "biscuit", "biscuit cookie"], ["cooking utensil"], ["cooler", "cooler for food", "ice chest"], ["cork", "cork bottle plug", "bottle cork"], ["corkboard"], ["corkscrew", "bottle screw"], ["edible corn", "corn", "maize"], ["cornbread"], ["cornet", "horn", "trumpet"], ["cornice", "valance", "valance board", "pelmet"], ["cornmeal"], ["corset", "girdle"], ["costume"], ["cougar", "puma", "catamount", "mountain lion", "panther"], ["coverall"], ["cowbell"], ["cowboy hat", "ten-gallon hat"], ["crab", "crab animal"], ["crabmeat"], ["cracker"], ["crape", "crepe", "French pancake"], ["crate"], ["crayon", "wax crayon"], ["cream pitcher"], ["crescent roll", "croissant"], ["crib", "cot"], ["crock pot", "earthenware jar"], ["crossbar"], ["crouton"], ["crow"], ["crowbar", "wrecking bar", "pry bar"], ["crown"], ["crucifix"], ["cruise ship", "cruise liner"], ["police cruiser", "patrol car", "police car", "squad car"], ["crumb"], ["crutch"], ["cub", "cub animal"], ["cube", "square block"], ["cucumber", "cuke"], ["cufflink"], ["cup"], ["trophy cup"], ["cupboard", "closet"], ["cupcake"], ["hair curler", "hair roller", "hair crimper"], ["curling iron"], ["curtain", "drapery"], ["cushion"], ["cylinder"], ["cymbal"], ["dagger"], ["dalmatian"], ["dartboard"], ["date", "date fruit"], ["deck chair", "beach chair"], ["deer", "cervid"], ["dental floss", "floss"], ["desk"], ["detergent"], ["diaper"], ["diary", "journal"], ["die", "dice"], ["dinghy", "dory", "rowboat"], ["dining table"], ["tux", "tuxedo"], ["dish"], ["dish antenna"], ["dishrag", "dishcloth"], ["dishtowel", "tea towel"], ["dishwasher", "dishwashing machine"], ["dishwasher detergent", "dishwashing detergent", "dishwashing liquid", "dishsoap"], ["dispenser"], ["diving board"], ["Dixie cup", "paper cup"], ["dog"], ["dog collar"], ["doll"], ["dollar", "dollar bill", "one dollar bill"], ["dollhouse", "doll's house"], ["dolphin"], ["domestic ass", "donkey"], ["doorknob", "doorhandle"], ["doormat", "welcome mat"], ["doughnut", "donut"], ["dove"], ["dragonfly"], ["drawer"], ["underdrawers", "boxers", "boxershorts"], ["dress", "frock"], ["dress hat", "high hat", "opera hat", "silk hat", "top hat"], ["dress suit"], ["dresser"], ["drill"], ["drone"], ["dropper", "eye dropper"], ["drum", "drum musical instrument"], ["drumstick"], ["duck"], ["duckling"], ["duct tape"], ["duffel bag", "duffle bag", "duffel", "duffle"], ["dumbbell"], ["dumpster"], ["dustpan"], ["eagle"], ["earphone", "earpiece", "headphone"], ["earplug"], ["earring"], ["easel"], ["eclair"], ["eel"], ["egg", "eggs"], ["egg roll", "spring roll"], ["egg yolk", "yolk", "yolk egg"], ["eggbeater", "eggwhisk"], ["eggplant", "aubergine"], ["electric chair"], ["refrigerator"], ["elephant"], ["elk", "moose"], ["envelope"], ["eraser"], ["escargot"], ["eyepatch"], ["falcon"], ["fan"], ["faucet", "spigot", "tap"], ["fedora"], ["ferret"], ["Ferris wheel"], ["ferry", "ferryboat"], ["fig", "fig fruit"], ["fighter jet", "fighter aircraft", "attack aircraft"], ["figurine"], ["file cabinet", "filing cabinet"], ["file", "file tool"], ["fire alarm", "smoke alarm"], ["fire engine", "fire truck"], ["fire extinguisher", "extinguisher"], ["fire hose"], ["fireplace"], ["fireplug", "fire hydrant", "hydrant"], ["first-aid kit"], ["fish"], ["fish", "fish food"], ["fishbowl", "goldfish bowl"], ["fishing rod", "fishing pole"], ["flag"], ["flagpole", "flagstaff"], ["flamingo"], ["flannel"], ["flap"], ["flash", "flashbulb"], ["flashlight", "torch"], ["fleece"], ["flip-flop", "flip-flop sandal"], ["flipper", "flipper footwear", "fin", "fin footwear"], ["flower arrangement", "floral arrangement"], ["flute glass", "champagne flute"], ["foal"], ["folding chair"], ["food processor"], ["football", "football American"], ["football helmet"], ["footstool", "footrest"], ["fork"], ["forklift"], ["freight car"], ["French toast"], ["freshener", "air freshener"], ["frisbee"], ["frog", "toad", "toad frog"], ["fruit juice"], ["frying pan", "frypan", "skillet"], ["fudge"], ["funnel"], ["futon"], ["gag", "muzzle"], ["garbage"], ["garbage truck"], ["garden hose"], ["gargle", "mouthwash"], ["gargoyle"], ["garlic", "ail"], ["gasmask", "respirator", "gas helmet"], ["gazelle"], ["gelatin", "jelly"], ["gemstone"], ["generator"], ["giant panda", "panda", "panda bear"], ["gift wrap"], ["ginger", "gingerroot"], ["giraffe"], ["cincture", "sash", "waistband", "waistcloth"], ["glass", "glass drink container", "drinking glass"], ["globe"], ["glove"], ["goat"], ["goggles"], ["goldfish"], ["golf club", "golf-club"], ["golfcart"], ["gondola", "gondola boat"], ["goose"], ["gorilla"], ["gourd"], ["grape"], ["grater"], ["gravestone", "headstone", "tombstone"], ["gravy boat", "gravy holder"], ["green bean"], ["green onion", "spring onion", "scallion"], ["griddle"], ["grill", "grille", "grillwork", "radiator grille"], ["grits", "hominy grits"], ["grizzly", "grizzly bear"], ["grocery bag"], ["guitar"], ["gull", "seagull"], ["gun"], ["hairbrush"], ["hairnet"], ["hairpin"], ["halter top"], ["ham", "jambon", "gammon"], ["hamburger", "beefburger", "burger"], ["hammer"], ["hammock"], ["hamper"], ["hamster"], ["hair dryer"], ["hand glass", "hand mirror"], ["hand towel", "face towel"], ["handcart", "pushcart", "hand truck"], ["handcuff"], ["handkerchief"], ["handle", "grip", "handgrip"], ["handsaw", "carpenter's saw"], ["hardback book", "hardcover book"], ["harmonium", "organ", "organ musical instrument", "reed organ", "reed organ musical instrument"], ["hat"], ["hatbox"], ["veil"], ["headband"], ["headboard"], ["headlight", "headlamp"], ["headscarf"], ["headset"], ["headstall", "headstall for horses", "headpiece", "headpiece for horses"], ["heart"], ["heater", "warmer"], ["helicopter"], ["helmet"], ["heron"], ["highchair", "feeding chair"], ["hinge"], ["hippopotamus"], ["hockey stick"], ["hog", "pig"], ["home plate", "home plate baseball", "home base", "home base baseball"], ["honey"], ["fume hood", "exhaust hood"], ["hook"], ["hookah", "narghile", "nargileh", "sheesha", "shisha", "water pipe"], ["hornet"], ["horse"], ["hose", "hosepipe"], ["hot-air balloon"], ["hotplate"], ["hot sauce"], ["hourglass"], ["houseboat"], ["hummingbird"], ["hummus", "humus", "hommos", "hoummos", "humous"], ["polar bear"], ["icecream"], ["popsicle"], ["ice maker"], ["ice pack", "ice bag"], ["ice skate"], ["igniter", "ignitor", "lighter"], ["inhaler", "inhalator"], ["iPod"], ["iron", "iron for clothing", "smoothing iron", "smoothing iron for clothing"], ["ironing board"], ["jacket"], ["jam"], ["jar"], ["jean", "blue jean", "denim"], ["jeep", "landrover"], ["jelly bean", "jelly egg"], ["jersey", "T-shirt", "tee shirt"], ["jet plane", "jet-propelled plane"], ["jewel", "gem", "precious stone"], ["jewelry", "jewellery"], ["joystick"], ["jumpsuit"], ["kayak"], ["keg"], ["kennel", "doghouse"], ["kettle", "boiler"], ["key"], ["keycard"], ["kilt"], ["kimono"], ["kitchen sink"], ["kitchen table"], ["kite"], ["kitten", "kitty"], ["kiwi fruit"], ["knee pad"], ["knife"], ["knitting needle"], ["knob"], ["knocker", "knocker on a door", "doorknocker"], ["koala", "koala bear"], ["lab coat", "laboratory coat"], ["ladder"], ["ladle"], ["ladybug", "ladybeetle", "ladybird beetle"], ["lamb", "lamb animal"], ["lamb-chop", "lambchop"], ["lamp"], ["lamppost"], ["lampshade"], ["lantern"], ["lanyard", "laniard"], ["laptop computer", "notebook computer"], ["lasagna", "lasagne"], ["latch"], ["lawn mower"], ["leather"], ["legging", "legging clothing", "leging", "leging clothing", "leg covering"], ["Lego", "Lego set"], ["legume"], ["lemon"], ["lemonade"], ["lettuce"], ["license plate", "numberplate"], ["life buoy", "lifesaver", "life belt", "life ring"], ["life jacket", "life vest"], ["lightbulb"], ["lightning rod", "lightning conductor"], ["lime"], ["limousine"], ["lion"], ["lip balm"], ["liquor", "spirits", "hard liquor", "liqueur", "cordial"], ["lizard"], ["log"], ["lollipop"], ["speaker", "speaker stereo equipment"], ["loveseat"], ["machine gun"], ["magazine"], ["magnet"], ["mail slot"], ["mailbox", "mailbox at home", "letter box", "letter box at home"], ["mallard"], ["mallet"], ["mammoth"], ["manatee"], ["mandarin orange"], ["manger", "trough"], ["manhole"], ["map"], ["marker"], ["martini"], ["mascot"], ["mashed potato"], ["masher"], ["mask", "facemask"], ["mast"], ["mat", "mat gym equipment", "gym mat"], ["matchbox"], ["mattress"], ["measuring cup"], ["measuring stick", "ruler", "ruler measuring stick", "measuring rod"], ["meatball"], ["medicine"], ["melon"], ["microphone"], ["microscope"], ["microwave oven"], ["milestone", "milepost"], ["milk"], ["milk can"], ["milkshake"], ["minivan"], ["mint candy"], ["mirror"], ["mitten"], ["mixer", "mixer kitchen tool", "stand mixer"], ["money"], ["monitor", "monitor computer equipment"], ["monkey"], ["motor"], ["motor scooter", "scooter"], ["motor vehicle", "automotive vehicle"], ["motorcycle"], ["mound", "mound baseball", "pitcher's mound"], ["mouse", "mouse computer equipment", "computer mouse"], ["mousepad"], ["muffin"], ["mug"], ["mushroom"], ["music stool", "piano stool"], ["musical instrument", "instrument", "instrument musical"], ["nailfile"], ["napkin", "table napkin", "serviette"], ["neckerchief"], ["necklace"], ["necktie", "tie", "tie necktie"], ["needle"], ["nest"], ["newspaper", "paper", "paper newspaper"], ["newsstand"], ["nightshirt", "nightwear", "sleepwear", "nightclothes"], ["nosebag", "nosebag for animals", "feedbag"], ["noseband", "noseband for animals", "nosepiece", "nosepiece for animals"], ["notebook"], ["notepad"], ["nut"], ["nutcracker"], ["oar"], ["octopus", "octopus food"], ["octopus", "octopus animal"], ["oil lamp", "kerosene lamp", "kerosine lamp"], ["olive oil"], ["omelet", "omelette"], ["onion"], ["orange", "orange fruit"], ["orange juice"], ["ostrich"], ["ottoman", "pouf", "pouffe", "hassock"], ["oven"], ["overalls", "overalls clothing"], ["owl"], ["packet"], ["inkpad", "inking pad", "stamp pad"], ["pad"], ["paddle", "boat paddle"], ["padlock"], ["paintbrush"], ["painting"], ["pajamas", "pyjamas"], ["palette", "pallet"], ["pan", "pan for cooking", "cooking pan"], ["pan", "pan metal container"], ["pancake"], ["pantyhose"], ["papaya"], ["paper plate"], ["paper towel"], ["paperback book", "paper-back book", "softback book", "soft-cover book"], ["paperweight"], ["parachute"], ["parakeet", "parrakeet", "parroket", "paraquet", "paroquet", "parroquet"], ["parasail", "parasail sports"], ["parasol", "sunshade"], ["parchment"], ["parka", "anorak"], ["parking meter"], ["parrot"], ["passenger car", "passenger car part of a train", "coach", "coach part of a train"], ["passenger ship"], ["passport"], ["pastry"], ["patty", "patty food"], ["pea", "pea food"], ["peach"], ["peanut butter"], ["pear"], ["peeler", "peeler tool for fruit and vegetables"], ["wooden leg", "pegleg"], ["pegboard"], ["pelican"], ["pen"], ["pencil"], ["pencil box", "pencil case"], ["pencil sharpener"], ["pendulum"], ["penguin"], ["pennant"], ["penny", "penny coin"], ["pepper", "peppercorn"], ["pepper mill", "pepper grinder"], ["perfume"], ["persimmon"], ["person", "baby", "child", "boy", "girl", "man", "woman", "human"], ["pet"], ["pew", "pew church bench", "church bench"], ["phonebook", "telephone book", "telephone directory"], ["phonograph record", "phonograph recording", "record", "record phonograph recording"], ["piano"], ["pickle"], ["pickup truck"], ["pie"], ["pigeon"], ["piggy bank", "penny bank"], ["pillow"], ["pin", "pin non jewelry"], ["pineapple"], ["pinecone"], ["ping-pong ball"], ["pinwheel"], ["tobacco pipe"], ["pipe", "piping"], ["pistol", "handgun"], ["pita", "pita bread", "pocket bread"], ["pitcher", "pitcher vessel for liquid", "ewer"], ["pitchfork"], ["pizza"], ["place mat"], ["plate"], ["platter"], ["playpen"], ["pliers", "plyers"], ["plow", "plow farm equipment", "plough", "plough farm equipment"], ["plume"], ["pocket watch"], ["pocketknife"], ["poker", "poker fire stirring tool", "stove poker", "fire hook"], ["pole", "post"], ["polo shirt", "sport shirt"], ["poncho"], ["pony"], ["pool table", "billiard table", "snooker table"], ["pop", "pop soda", "soda", "soda pop", "tonic", "soft drink"], ["postbox", "postbox public", "mailbox", "mailbox public"], ["postcard", "postal card", "mailing-card"], ["poster", "placard"], ["pot"], ["flowerpot"], ["potato"], ["potholder"], ["pottery", "clayware"], ["pouch"], ["power shovel", "excavator", "digger"], ["prawn", "shrimp"], ["pretzel"], ["printer", "printing machine"], ["projectile", "projectile weapon", "missile"], ["projector"], ["propeller", "propellor"], ["prune"], ["pudding"], ["puffer", "puffer fish", "pufferfish", "blowfish", "globefish"], ["puffin"], ["pug-dog"], ["pumpkin"], ["puncher"], ["puppet", "marionette"], ["puppy"], ["quesadilla"], ["quiche"], ["quilt", "comforter"], ["rabbit"], ["race car", "racing car"], ["racket", "racquet"], ["radar"], ["radiator"], ["radio receiver", "radio set", "radio", "tuner", "tuner radio"], ["radish", "daikon"], ["raft"], ["rag doll"], ["raincoat", "waterproof jacket"], ["ram", "ram animal"], ["raspberry"], ["rat"], ["razorblade"], ["reamer", "reamer juicer", "juicer", "juice reamer"], ["rearview mirror"], ["receipt"], ["recliner", "reclining chair", "lounger", "lounger chair"], ["record player", "phonograph", "phonograph record player", "turntable"], ["reflector"], ["remote control"], ["rhinoceros"], ["rib", "rib food"], ["rifle"], ["ring"], ["river boat"], ["road map"], ["robe"], ["rocking chair"], ["rodent"], ["roller skate"], ["Rollerblade"], ["rolling pin"], ["root beer"], ["router", "router computer equipment"], ["rubber band", "elastic band"], ["runner", "runner carpet"], ["plastic bag", "paper bag"], ["saddle", "saddle on an animal"], ["saddle blanket", "saddlecloth", "horse blanket"], ["saddlebag"], ["safety pin"], ["sail"], ["salad"], ["salad plate", "salad bowl"], ["salami"], ["salmon", "salmon fish"], ["salmon", "salmon food"], ["salsa"], ["saltshaker"], ["sandal", "sandal type of shoe"], ["sandwich"], ["satchel"], ["saucepan"], ["saucer"], ["sausage"], ["sawhorse", "sawbuck"], ["saxophone"], ["scale", "scale measuring instrument"], ["scarecrow", "strawman"], ["scarf"], ["school bus"], ["scissors"], ["scoreboard"], ["scraper"], ["screwdriver"], ["scrubbing brush"], ["sculpture"], ["seabird", "seafowl"], ["seahorse"], ["seaplane", "hydroplane"], ["seashell"], ["sewing machine"], ["shaker"], ["shampoo"], ["shark"], ["sharpener"], ["Sharpie"], ["shaver", "shaver electric", "electric shaver", "electric razor"], ["shaving cream", "shaving soap"], ["shawl"], ["shears"], ["sheep"], ["shepherd dog", "sheepdog"], ["sherbert", "sherbet"], ["shield"], ["shirt"], ["shoe", "sneaker", "sneaker type of shoe", "tennis shoe"], ["shopping bag"], ["shopping cart"], ["short pants", "shorts", "shorts clothing", "trunks", "trunks clothing"], ["shot glass"], ["shoulder bag"], ["shovel"], ["shower head"], ["shower cap"], ["shower curtain"], ["shredder", "shredder for paper"], ["signboard"], ["silo"], ["sink"], ["skateboard"], ["skewer"], ["ski"], ["ski boot"], ["ski parka", "ski jacket"], ["ski pole"], ["skirt"], ["skullcap"], ["sled", "sledge", "sleigh"], ["sleeping bag"], ["sling", "sling bandage", "triangular bandage"], ["slipper", "slipper footwear", "carpet slipper", "carpet slipper footwear"], ["smoothie"], ["snake", "serpent"], ["snowboard"], ["snowman"], ["snowmobile"], ["soap"], ["soccer ball"], ["sock"], ["sofa", "couch", "lounge"], ["softball"], ["solar array", "solar battery", "solar panel"], ["sombrero"], ["soup"], ["soup bowl"], ["soupspoon"], ["sour cream", "soured cream"], ["soya milk", "soybean milk", "soymilk"], ["space shuttle"], ["sparkler", "sparkler fireworks"], ["spatula"], ["spear", "lance"], ["spectacles", "specs", "eyeglasses", "glasses"], ["spice rack"], ["spider"], ["crawfish", "crayfish"], ["sponge"], ["spoon"], ["sportswear", "athletic wear", "activewear"], ["spotlight"], ["squid", "squid food", "calamari", "calamary"], ["squirrel"], ["stagecoach"], ["stapler", "stapler stapling machine"], ["starfish", "sea star"], ["statue", "statue sculpture"], ["steak", "steak food"], ["steak knife"], ["steering wheel"], ["stepladder"], ["step stool"], ["stereo", "stereo sound system"], ["stew"], ["stirrer"], ["stirrup"], ["stool"], ["stop sign"], ["brake light"], ["stove", "kitchen stove", "range", "range kitchen appliance", "kitchen range", "cooking stove"], ["strainer"], ["strap"], ["straw", "straw for drinking", "drinking straw"], ["strawberry"], ["street sign"], ["streetlight", "street lamp"], ["string cheese"], ["stylus"], ["subwoofer"], ["sugar bowl"], ["sugarcane", "sugarcane plant"], ["suit", "suit clothing"], ["sunflower"], ["sunglasses"], ["sunhat"], ["surfboard"], ["sushi"], ["mop"], ["sweat pants"], ["sweatband"], ["sweater"], ["sweatshirt"], ["sweet potato"], ["swimsuit", "swimwear", "bathing suit", "swimming costume", "bathing costume", "swimming trunks", "bathing trunks"], ["sword"], ["syringe"], ["Tabasco sauce"], ["table-tennis table", "ping-pong table"], ["table"], ["table lamp"], ["tablecloth"], ["tachometer"], ["taco"], ["tag"], ["taillight", "rear light"], ["tambourine"], ["army tank", "armored combat vehicle", "armoured combat vehicle"], ["tank", "tank storage vessel", "storage tank"], ["tank top", "tank top clothing"], ["tape", "tape sticky cloth or paper"], ["tape measure", "measuring tape"], ["tapestry"], ["tarp"], ["tartan", "plaid"], ["tassel"], ["tea bag"], ["teacup"], ["teakettle"], ["teapot"], ["teddy bear"], ["telephone", "phone", "telephone set"], ["telephone booth", "phone booth", "call box", "telephone box", "telephone kiosk"], ["telephone pole", "telegraph pole", "telegraph post"], ["telephoto lens", "zoom lens"], ["television camera", "tv camera"], ["television set", "tv", "tv set"], ["tennis ball"], ["tennis racket"], ["tequila"], ["thermometer"], ["thermos bottle"], ["thermostat"], ["thimble"], ["thread", "yarn"], ["thumbtack", "drawing pin", "pushpin"], ["tiara"], ["tiger"], ["tights", "tights clothing", "leotards"], ["timer", "stopwatch"], ["tinfoil"], ["tinsel"], ["tissue paper"], ["toast", "toast food"], ["toaster"], ["toaster oven"], ["toilet"], ["toilet tissue", "toilet paper", "bathroom tissue"], ["tomato"], ["tongs"], ["toolbox"], ["toothbrush"], ["toothpaste"], ["toothpick"], ["cover"], ["tortilla"], ["tow truck"], ["towel"], ["towel rack", "towel rail", "towel bar"], ["toy"], ["tractor", "tractor farm equipment"], ["traffic light"], ["dirt bike"], ["trailer truck", "tractor trailer", "trucking rig", "articulated lorry", "semi truck"], ["train", "train railroad vehicle", "railroad train"], ["trampoline"], ["tray"], ["trench coat"], ["triangle", "triangle musical instrument"], ["tricycle"], ["tripod"], ["trousers", "pants", "pants clothing"], ["truck"], ["truffle", "truffle chocolate", "chocolate truffle"], ["trunk"], ["vat"], ["turban"], ["turkey", "turkey food"], ["turnip"], ["turtle"], ["turtleneck", "turtleneck clothing", "polo-neck"], ["typewriter"], ["umbrella"], ["underwear", "underclothes", "underclothing", "underpants"], ["unicycle"], ["urinal"], ["urn"], ["vacuum cleaner"], ["vase"], ["vending machine"], ["vent", "blowhole", "air vent"], ["vest", "waistcoat"], ["videotape"], ["vinegar"], ["violin", "fiddle"], ["vodka"], ["volleyball"], ["vulture"], ["waffle"], ["waffle iron"], ["wagon"], ["wagon wheel"], ["walking stick"], ["wall clock"], ["wall socket", "wall plug", "electric outlet", "electrical outlet", "outlet", "electric receptacle"], ["wallet", "billfold"], ["walrus"], ["wardrobe"], ["washbasin", "basin", "basin for washing", "washbowl", "washstand", "handbasin"], ["automatic washer", "washing machine"], ["watch", "wristwatch"], ["water bottle"], ["water cooler"], ["water faucet", "water tap", "tap", "tap water faucet"], ["water heater", "hot-water heater"], ["water jug"], ["water gun", "squirt gun"], ["water scooter", "sea scooter", "jet ski"], ["water ski"], ["water tower"], ["watering can"], ["watermelon"], ["weathervane", "vane", "vane weathervane", "wind vane"], ["webcam"], ["wedding cake", "bridecake"], ["wedding ring", "wedding band"], ["wet suit"], ["wheel"], ["wheelchair"], ["whipped cream"], ["whistle"], ["wig"], ["wind chime"], ["windmill"], ["window box", "window box for plants"], ["windshield wiper", "windscreen wiper", "wiper", "wiper for windshield or screen"], ["windsock", "air sock", "air-sleeve", "wind sleeve", "wind cone"], ["wine bottle"], ["wine bucket", "wine cooler"], ["wineglass"], ["blinder", "blinder for horses"], ["wok"], ["wolf"], ["wooden spoon"], ["wreath"], ["wrench", "spanner"], ["wristband"], ["wristlet", "wrist band"], ["yacht"], ["yogurt", "yoghurt", "yoghourt"], ["yoke", "yoke animal equipment"], ["zebra"], ["zucchini", "courgette"]]
|
data/texts/obj365v1_class_texts.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[["person"], ["sneakers"], ["chair"], ["hat"], ["lamp"], ["bottle"], ["cabinet", "shelf"], ["cup"], ["car"], ["glasses"], ["picture", "frame"], ["desk"], ["handbag"], ["street lights"], ["book"], ["plate"], ["helmet"], ["leather shoes"], ["pillow"], ["glove"], ["potted plant"], ["bracelet"], ["flower"], ["tv"], ["storage box"], ["vase"], ["bench"], ["wine glass"], ["boots"], ["bowl"], ["dining table"], ["umbrella"], ["boat"], ["flag"], ["speaker"], ["trash bin", "can"], ["stool"], ["backpack"], ["couch"], ["belt"], ["carpet"], ["basket"], ["towel", "napkin"], ["slippers"], ["barrel", "bucket"], ["coffee table"], ["suv"], ["toy"], ["tie"], ["bed"], ["traffic light"], ["pen", "pencil"], ["microphone"], ["sandals"], ["canned"], ["necklace"], ["mirror"], ["faucet"], ["bicycle"], ["bread"], ["high heels"], ["ring"], ["van"], ["watch"], ["sink"], ["horse"], ["fish"], ["apple"], ["camera"], ["candle"], ["teddy bear"], ["cake"], ["motorcycle"], ["wild bird"], ["laptop"], ["knife"], ["traffic sign"], ["cell phone"], ["paddle"], ["truck"], ["cow"], ["power outlet"], ["clock"], ["drum"], ["fork"], ["bus"], ["hanger"], ["nightstand"], ["pot", "pan"], ["sheep"], ["guitar"], ["traffic cone"], ["tea pot"], ["keyboard"], ["tripod"], ["hockey"], ["fan"], ["dog"], ["spoon"], ["blackboard", "whiteboard"], ["balloon"], ["air conditioner"], ["cymbal"], ["mouse"], ["telephone"], ["pickup truck"], ["orange"], ["banana"], ["airplane"], ["luggage"], ["skis"], ["soccer"], ["trolley"], ["oven"], ["remote"], ["baseball glove"], ["paper towel"], ["refrigerator"], ["train"], ["tomato"], ["machinery vehicle"], ["tent"], ["shampoo", "shower gel"], ["head phone"], ["lantern"], ["donut"], ["cleaning products"], ["sailboat"], ["tangerine"], ["pizza"], ["kite"], ["computer box"], ["elephant"], ["toiletries"], ["gas stove"], ["broccoli"], ["toilet"], ["stroller"], ["shovel"], ["baseball bat"], ["microwave"], ["skateboard"], ["surfboard"], ["surveillance camera"], ["gun"], ["life saver"], ["cat"], ["lemon"], ["liquid soap"], ["zebra"], ["duck"], ["sports car"], ["giraffe"], ["pumpkin"], ["piano"], ["stop sign"], ["radiator"], ["converter"], ["tissue"], ["carrot"], ["washing machine"], ["vent"], ["cookies"], ["cutting", "chopping board"], ["tennis racket"], ["candy"], ["skating and skiing shoes"], ["scissors"], ["folder"], ["baseball"], ["strawberry"], ["bow tie"], ["pigeon"], ["pepper"], ["coffee machine"], ["bathtub"], ["snowboard"], ["suitcase"], ["grapes"], ["ladder"], ["pear"], ["american football"], ["basketball"], ["potato"], ["paint brush"], ["printer"], ["billiards"], ["fire hydrant"], ["goose"], ["projector"], ["sausage"], ["fire extinguisher"], ["extension cord"], ["facial mask"], ["tennis ball"], ["chopsticks"], ["electronic stove and gas stove"], ["pie"], ["frisbee"], ["kettle"], ["hamburger"], ["golf club"], ["cucumber"], ["clutch"], ["blender"], ["tong"], ["slide"], ["hot dog"], ["toothbrush"], ["facial cleanser"], ["mango"], ["deer"], ["egg"], ["violin"], ["marker"], ["ship"], ["chicken"], ["onion"], ["ice cream"], ["tape"], ["wheelchair"], ["plum"], ["bar soap"], ["scale"], ["watermelon"], ["cabbage"], ["router", "modem"], ["golf ball"], ["pine apple"], ["crane"], ["fire truck"], ["peach"], ["cello"], ["notepaper"], ["tricycle"], ["toaster"], ["helicopter"], ["green beans"], ["brush"], ["carriage"], ["cigar"], ["earphone"], ["penguin"], ["hurdle"], ["swing"], ["radio"], ["cd"], ["parking meter"], ["swan"], ["garlic"], ["french fries"], ["horn"], ["avocado"], ["saxophone"], ["trumpet"], ["sandwich"], ["cue"], ["kiwi fruit"], ["bear"], ["fishing rod"], ["cherry"], ["tablet"], ["green vegetables"], ["nuts"], ["corn"], ["key"], ["screwdriver"], ["globe"], ["broom"], ["pliers"], ["volleyball"], ["hammer"], ["eggplant"], ["trophy"], ["dates"], ["board eraser"], ["rice"], ["tape measure", "ruler"], ["dumbbell"], ["hamimelon"], ["stapler"], ["camel"], ["lettuce"], ["goldfish"], ["meat balls"], ["medal"], ["toothpaste"], ["antelope"], ["shrimp"], ["rickshaw"], ["trombone"], ["pomegranate"], ["coconut"], ["jellyfish"], ["mushroom"], ["calculator"], ["treadmill"], ["butterfly"], ["egg tart"], ["cheese"], ["pig"], ["pomelo"], ["race car"], ["rice cooker"], ["tuba"], ["crosswalk sign"], ["papaya"], ["hair drier"], ["green onion"], ["chips"], ["dolphin"], ["sushi"], ["urinal"], ["donkey"], ["electric drill"], ["spring rolls"], ["tortoise", "turtle"], ["parrot"], ["flute"], ["measuring cup"], ["shark"], ["steak"], ["poker card"], ["binoculars"], ["llama"], ["radish"], ["noodles"], ["yak"], ["mop"], ["crab"], ["microscope"], ["barbell"], ["bread", "bun"], ["baozi"], ["lion"], ["red cabbage"], ["polar bear"], ["lighter"], ["seal"], ["mangosteen"], ["comb"], ["eraser"], ["pitaya"], ["scallop"], ["pencil case"], ["saw"], ["table tennis paddle"], ["okra"], ["starfish"], ["eagle"], ["monkey"], ["durian"], ["game board"], ["rabbit"], ["french horn"], ["ambulance"], ["asparagus"], ["hoverboard"], ["pasta"], ["target"], ["hotair balloon"], ["chainsaw"], ["lobster"], ["iron"], ["flashlight"]]
|
pyproject.toml
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[build-system]
|
2 |
+
requires = ["setuptools","wheel","torch"]
|
3 |
+
build-backend = "setuptools.build_meta"
|
4 |
+
|
5 |
+
[project]
|
6 |
+
name = "yolo_world"
|
7 |
+
version = "0.1.0" # Replace with your actual version
|
8 |
+
description = "YOLO-World: Real-time Open Vocabulary Object Detection"
|
9 |
+
readme = "README.md"
|
10 |
+
keywords = ["object detection"]
|
11 |
+
authors = [
|
12 |
+
{ name = "Tencent AILab", email = "ronnysong@tencent.com" },
|
13 |
+
]
|
14 |
+
license = {text = "Apache License 2.0"}
|
15 |
+
|
16 |
+
classifiers = [
|
17 |
+
"Development Status :: 4 - Beta",
|
18 |
+
"License :: OSI Approved :: Apache Software License",
|
19 |
+
"Operating System :: OS Independent",
|
20 |
+
"Programming Language :: Python :: 3",
|
21 |
+
"Programming Language :: Python :: 3.7",
|
22 |
+
"Programming Language :: Python :: 3.8",
|
23 |
+
"Programming Language :: Python :: 3.9",
|
24 |
+
"Programming Language :: Python :: 3.10",
|
25 |
+
"Programming Language :: Python :: 3.11",
|
26 |
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
27 |
+
]
|
28 |
+
requires-python = ">= 3.7"
|
29 |
+
|
30 |
+
dependencies = [
|
31 |
+
"wheel",
|
32 |
+
"torch",
|
33 |
+
"torchvision",
|
34 |
+
"transformers",
|
35 |
+
"tokenizers",
|
36 |
+
"numpy",
|
37 |
+
"opencv-python",
|
38 |
+
"supervision==0.18.0",
|
39 |
+
"openmim",
|
40 |
+
"mmcv-lite>=2.0.0rc4,<2.1.0",
|
41 |
+
"mmdet>=3.0.0",
|
42 |
+
"mmengine>=0.7.1",
|
43 |
+
"mmcv",
|
44 |
+
'mmyolo @ git+https://github.com/onuralpszr/mmyolo.git',
|
45 |
+
|
46 |
+
]
|
47 |
+
|
48 |
+
[tool.setuptools]
|
49 |
+
package-dir = {"yolo_world" = "yolo_world"}
|
50 |
+
include-package-data = false
|
51 |
+
license-files = ["LICENSE"]
|
52 |
+
zip-safe = true
|
53 |
+
|
54 |
+
[tool.setuptools.packages.find]
|
55 |
+
include = ["yolo_world*"]
|
56 |
+
exclude = ["docs*", "tests*","third_party*","assets*"]
|
requirements.txt
CHANGED
@@ -1,20 +1,14 @@
|
|
1 |
openmim
|
2 |
-
mmcv-lite
|
3 |
-
mmdet>=3.0.0
|
4 |
-
mmengine>=0.7.1
|
5 |
gradio
|
6 |
transformers
|
7 |
numpy
|
8 |
opencv-python
|
9 |
supervision
|
10 |
-
|
11 |
-
regex
|
12 |
-
pot
|
13 |
-
sentencepiece
|
14 |
-
tokenizers
|
15 |
|
16 |
--extra-index-url https://download.pytorch.org/whl/cu121
|
17 |
-
torch
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
1 |
openmim
|
|
|
|
|
|
|
2 |
gradio
|
3 |
transformers
|
4 |
numpy
|
5 |
opencv-python
|
6 |
supervision
|
7 |
+
wheel
|
|
|
|
|
|
|
|
|
8 |
|
9 |
--extra-index-url https://download.pytorch.org/whl/cu121
|
10 |
+
torch==2.1.0+cu121
|
11 |
+
torchdata==0.7.0
|
12 |
+
torchsummary==1.5.1
|
13 |
+
torchtext==0.16.0
|
14 |
+
torchvision==0.16.0+cu121
|
third_party/mmyolo/.circleci/config.yml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: 2.1
|
2 |
+
|
3 |
+
# this allows you to use CircleCI's dynamic configuration feature
|
4 |
+
setup: true
|
5 |
+
|
6 |
+
# the path-filtering orb is required to continue a pipeline based on
|
7 |
+
# the path of an updated fileset
|
8 |
+
orbs:
|
9 |
+
path-filtering: circleci/path-filtering@0.1.2
|
10 |
+
|
11 |
+
workflows:
|
12 |
+
# the always-run workflow is always triggered, regardless of the pipeline parameters.
|
13 |
+
always-run:
|
14 |
+
jobs:
|
15 |
+
# the path-filtering/filter job determines which pipeline
|
16 |
+
# parameters to update.
|
17 |
+
- path-filtering/filter:
|
18 |
+
name: check-updated-files
|
19 |
+
# 3-column, whitespace-delimited mapping. One mapping per
|
20 |
+
# line:
|
21 |
+
# <regex path-to-test> <parameter-to-set> <value-of-pipeline-parameter>
|
22 |
+
mapping: |
|
23 |
+
mmyolo/.* lint_only false
|
24 |
+
requirements/.* lint_only false
|
25 |
+
tests/.* lint_only false
|
26 |
+
tools/.* lint_only false
|
27 |
+
configs/.* lint_only false
|
28 |
+
.circleci/.* lint_only false
|
29 |
+
base-revision: main
|
30 |
+
# this is the path of the configuration we should trigger once
|
31 |
+
# path filtering and pipeline parameter value updates are
|
32 |
+
# complete. In this case, we are using the parent dynamic
|
33 |
+
# configuration itself.
|
34 |
+
config-path: .circleci/test.yml
|
third_party/mmyolo/.circleci/docker/Dockerfile
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ARG PYTORCH="1.8.1"
|
2 |
+
ARG CUDA="10.2"
|
3 |
+
ARG CUDNN="7"
|
4 |
+
|
5 |
+
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
|
6 |
+
|
7 |
+
# To fix GPG key error when running apt-get update
|
8 |
+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
|
9 |
+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
|
10 |
+
|
11 |
+
RUN apt-get update && apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx
|
third_party/mmyolo/.circleci/test.yml
ADDED
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: 2.1
|
2 |
+
|
3 |
+
# the default pipeline parameters, which will be updated according to
|
4 |
+
# the results of the path-filtering orb
|
5 |
+
parameters:
|
6 |
+
lint_only:
|
7 |
+
type: boolean
|
8 |
+
default: true
|
9 |
+
|
10 |
+
jobs:
|
11 |
+
lint:
|
12 |
+
docker:
|
13 |
+
- image: cimg/python:3.7.4
|
14 |
+
steps:
|
15 |
+
- checkout
|
16 |
+
- run:
|
17 |
+
name: Install pre-commit hook
|
18 |
+
command: |
|
19 |
+
pip install pre-commit
|
20 |
+
pre-commit install
|
21 |
+
- run:
|
22 |
+
name: Linting
|
23 |
+
command: pre-commit run --all-files
|
24 |
+
- run:
|
25 |
+
name: Check docstring coverage
|
26 |
+
command: |
|
27 |
+
pip install interrogate
|
28 |
+
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-magic --ignore-regex "__repr__" --fail-under 90 mmyolo
|
29 |
+
build_cpu:
|
30 |
+
parameters:
|
31 |
+
# The python version must match available image tags in
|
32 |
+
# https://circleci.com/developer/images/image/cimg/python
|
33 |
+
python:
|
34 |
+
type: string
|
35 |
+
torch:
|
36 |
+
type: string
|
37 |
+
torchvision:
|
38 |
+
type: string
|
39 |
+
docker:
|
40 |
+
- image: cimg/python:<< parameters.python >>
|
41 |
+
resource_class: large
|
42 |
+
steps:
|
43 |
+
- checkout
|
44 |
+
- run:
|
45 |
+
name: Install Libraries
|
46 |
+
command: |
|
47 |
+
sudo apt-get update
|
48 |
+
sudo apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx libjpeg-dev zlib1g-dev libtinfo-dev libncurses5
|
49 |
+
- run:
|
50 |
+
name: Configure Python & pip
|
51 |
+
command: |
|
52 |
+
pip install --upgrade pip
|
53 |
+
pip install wheel
|
54 |
+
- run:
|
55 |
+
name: Install PyTorch
|
56 |
+
command: |
|
57 |
+
python -V
|
58 |
+
pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
59 |
+
- run:
|
60 |
+
name: Install ONNXRuntime
|
61 |
+
command: |
|
62 |
+
pip install onnxruntime==1.8.1
|
63 |
+
wget https://github.com/microsoft/onnxruntime/releases/download/v1.8.1/onnxruntime-linux-x64-1.8.1.tgz
|
64 |
+
tar xvf onnxruntime-linux-x64-1.8.1.tgz
|
65 |
+
- run:
|
66 |
+
name: Install mmyolo dependencies
|
67 |
+
command: |
|
68 |
+
pip install -U openmim
|
69 |
+
mim install git+https://github.com/open-mmlab/mmengine.git@main
|
70 |
+
mim install 'mmcv >= 2.0.0'
|
71 |
+
mim install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
|
72 |
+
pip install -r requirements/albu.txt
|
73 |
+
pip install -r requirements/tests.txt
|
74 |
+
- run:
|
75 |
+
name: Install mmdeploy
|
76 |
+
command: |
|
77 |
+
pip install setuptools
|
78 |
+
git clone -b dev-1.x --depth 1 https://github.com/open-mmlab/mmdeploy.git mmdeploy --recurse-submodules
|
79 |
+
wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-x86_64.tar.gz
|
80 |
+
tar -xzvf cmake-3.20.0-linux-x86_64.tar.gz
|
81 |
+
sudo ln -sf $(pwd)/cmake-3.20.0-linux-x86_64/bin/* /usr/bin/
|
82 |
+
cd mmdeploy && mkdir build && cd build && cmake .. -DMMDEPLOY_TARGET_BACKENDS=ort -DONNXRUNTIME_DIR=/home/circleci/project/onnxruntime-linux-x64-1.8.1 && make -j8 && make install
|
83 |
+
export LD_LIBRARY_PATH=/home/circleci/project/onnxruntime-linux-x64-1.8.1/lib:${LD_LIBRARY_PATH}
|
84 |
+
cd /home/circleci/project/mmdeploy && python -m pip install -v -e .
|
85 |
+
- run:
|
86 |
+
name: Build and install
|
87 |
+
command: |
|
88 |
+
pip install -e .
|
89 |
+
- run:
|
90 |
+
name: Run unittests
|
91 |
+
command: |
|
92 |
+
export LD_LIBRARY_PATH=/home/circleci/project/onnxruntime-linux-x64-1.8.1/lib:${LD_LIBRARY_PATH}
|
93 |
+
pytest tests/
|
94 |
+
# coverage run --branch --source mmyolo -m pytest tests/
|
95 |
+
# coverage xml
|
96 |
+
# coverage report -m
|
97 |
+
build_cuda:
|
98 |
+
parameters:
|
99 |
+
torch:
|
100 |
+
type: string
|
101 |
+
cuda:
|
102 |
+
type: enum
|
103 |
+
enum: ["10.1", "10.2", "11.0", "11.7"]
|
104 |
+
cudnn:
|
105 |
+
type: integer
|
106 |
+
default: 7
|
107 |
+
machine:
|
108 |
+
image: ubuntu-2004-cuda-11.4:202110-01
|
109 |
+
# docker_layer_caching: true
|
110 |
+
resource_class: gpu.nvidia.small
|
111 |
+
steps:
|
112 |
+
- checkout
|
113 |
+
- run:
|
114 |
+
# Cloning repos in VM since Docker doesn't have access to the private key
|
115 |
+
name: Clone Repos
|
116 |
+
command: |
|
117 |
+
git clone -b main --depth 1 https://github.com/open-mmlab/mmengine.git /home/circleci/mmengine
|
118 |
+
git clone -b dev-3.x --depth 1 https://github.com/open-mmlab/mmdetection.git /home/circleci/mmdetection
|
119 |
+
- run:
|
120 |
+
name: Build Docker image
|
121 |
+
command: |
|
122 |
+
docker build .circleci/docker -t mmyolo:gpu --build-arg PYTORCH=<< parameters.torch >> --build-arg CUDA=<< parameters.cuda >> --build-arg CUDNN=<< parameters.cudnn >>
|
123 |
+
docker run --gpus all -t -d -v /home/circleci/project:/mmyolo -v /home/circleci/mmengine:/mmengine -v /home/circleci/mmdetection:/mmdetection -w /mmyolo --name mmyolo mmyolo:gpu
|
124 |
+
- run:
|
125 |
+
name: Install mmyolo dependencies
|
126 |
+
command: |
|
127 |
+
docker exec mmyolo pip install -U openmim
|
128 |
+
docker exec mmyolo mim install -e /mmengine
|
129 |
+
docker exec mmyolo mim install 'mmcv >= 2.0.0'
|
130 |
+
docker exec mmyolo pip install -e /mmdetection
|
131 |
+
docker exec mmyolo pip install -r requirements/albu.txt
|
132 |
+
docker exec mmyolo pip install -r requirements/tests.txt
|
133 |
+
- run:
|
134 |
+
name: Build and install
|
135 |
+
command: |
|
136 |
+
docker exec mmyolo pip install -e .
|
137 |
+
- run:
|
138 |
+
name: Run unittests
|
139 |
+
command: |
|
140 |
+
docker exec mmyolo pytest tests/
|
141 |
+
|
142 |
+
workflows:
|
143 |
+
pr_stage_lint:
|
144 |
+
when: << pipeline.parameters.lint_only >>
|
145 |
+
jobs:
|
146 |
+
- lint:
|
147 |
+
name: lint
|
148 |
+
filters:
|
149 |
+
branches:
|
150 |
+
ignore:
|
151 |
+
- main
|
152 |
+
|
153 |
+
pr_stage_test:
|
154 |
+
when:
|
155 |
+
not: << pipeline.parameters.lint_only >>
|
156 |
+
jobs:
|
157 |
+
- lint:
|
158 |
+
name: lint
|
159 |
+
filters:
|
160 |
+
branches:
|
161 |
+
ignore:
|
162 |
+
- main
|
163 |
+
- build_cpu:
|
164 |
+
name: minimum_version_cpu
|
165 |
+
torch: 1.8.0
|
166 |
+
torchvision: 0.9.0
|
167 |
+
python: 3.8.0 # The lowest python 3.7.x version available on CircleCI images
|
168 |
+
requires:
|
169 |
+
- lint
|
170 |
+
- build_cpu:
|
171 |
+
name: maximum_version_cpu
|
172 |
+
# mmdeploy not supported
|
173 |
+
# torch: 2.0.0
|
174 |
+
# torchvision: 0.15.1
|
175 |
+
torch: 1.12.1
|
176 |
+
torchvision: 0.13.1
|
177 |
+
python: 3.9.0
|
178 |
+
requires:
|
179 |
+
- minimum_version_cpu
|
180 |
+
- hold:
|
181 |
+
type: approval
|
182 |
+
requires:
|
183 |
+
- maximum_version_cpu
|
184 |
+
- build_cuda:
|
185 |
+
name: mainstream_version_gpu
|
186 |
+
torch: 1.8.1
|
187 |
+
# Use double quotation mark to explicitly specify its type
|
188 |
+
# as string instead of number
|
189 |
+
cuda: "10.2"
|
190 |
+
requires:
|
191 |
+
- hold
|
192 |
+
- build_cuda:
|
193 |
+
name: maximum_version_gpu
|
194 |
+
torch: 2.0.0
|
195 |
+
cuda: "11.7"
|
196 |
+
cudnn: 8
|
197 |
+
requires:
|
198 |
+
- hold
|
199 |
+
merge_stage_test:
|
200 |
+
when:
|
201 |
+
not: << pipeline.parameters.lint_only >>
|
202 |
+
jobs:
|
203 |
+
- build_cuda:
|
204 |
+
name: minimum_version_gpu
|
205 |
+
torch: 1.7.0
|
206 |
+
# Use double quotation mark to explicitly specify its type
|
207 |
+
# as string instead of number
|
208 |
+
cuda: "11.0"
|
209 |
+
cudnn: 8
|
210 |
+
filters:
|
211 |
+
branches:
|
212 |
+
only:
|
213 |
+
- main
|
third_party/mmyolo/.dev_scripts/gather_models.py
ADDED
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (c) OpenMMLab. All rights reserved.
|
2 |
+
import argparse
|
3 |
+
import glob
|
4 |
+
import os
|
5 |
+
import os.path as osp
|
6 |
+
import shutil
|
7 |
+
import subprocess
|
8 |
+
import time
|
9 |
+
from collections import OrderedDict
|
10 |
+
|
11 |
+
import torch
|
12 |
+
import yaml
|
13 |
+
from mmengine.config import Config
|
14 |
+
from mmengine.fileio import dump
|
15 |
+
from mmengine.utils import mkdir_or_exist, scandir
|
16 |
+
|
17 |
+
|
18 |
+
def ordered_yaml_dump(data, stream=None, Dumper=yaml.SafeDumper, **kwds):
|
19 |
+
|
20 |
+
class OrderedDumper(Dumper):
|
21 |
+
pass
|
22 |
+
|
23 |
+
def _dict_representer(dumper, data):
|
24 |
+
return dumper.represent_mapping(
|
25 |
+
yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, data.items())
|
26 |
+
|
27 |
+
OrderedDumper.add_representer(OrderedDict, _dict_representer)
|
28 |
+
return yaml.dump(data, stream, OrderedDumper, **kwds)
|
29 |
+
|
30 |
+
|
31 |
+
def process_checkpoint(in_file, out_file):
|
32 |
+
checkpoint = torch.load(in_file, map_location='cpu')
|
33 |
+
# remove optimizer for smaller file size
|
34 |
+
if 'optimizer' in checkpoint:
|
35 |
+
del checkpoint['optimizer']
|
36 |
+
if 'message_hub' in checkpoint:
|
37 |
+
del checkpoint['message_hub']
|
38 |
+
if 'ema_state_dict' in checkpoint:
|
39 |
+
del checkpoint['ema_state_dict']
|
40 |
+
|
41 |
+
for key in list(checkpoint['state_dict']):
|
42 |
+
if key.startswith('data_preprocessor'):
|
43 |
+
checkpoint['state_dict'].pop(key)
|
44 |
+
elif 'priors_base_sizes' in key:
|
45 |
+
checkpoint['state_dict'].pop(key)
|
46 |
+
elif 'grid_offset' in key:
|
47 |
+
checkpoint['state_dict'].pop(key)
|
48 |
+
elif 'prior_inds' in key:
|
49 |
+
checkpoint['state_dict'].pop(key)
|
50 |
+
|
51 |
+
# if it is necessary to remove some sensitive data in checkpoint['meta'],
|
52 |
+
# add the code here.
|
53 |
+
if torch.__version__ >= '1.6':
|
54 |
+
torch.save(checkpoint, out_file, _use_new_zipfile_serialization=False)
|
55 |
+
else:
|
56 |
+
torch.save(checkpoint, out_file)
|
57 |
+
sha = subprocess.check_output(['sha256sum', out_file]).decode()
|
58 |
+
final_file = out_file.rstrip('.pth') + f'-{sha[:8]}.pth'
|
59 |
+
subprocess.Popen(['mv', out_file, final_file])
|
60 |
+
return final_file
|
61 |
+
|
62 |
+
|
63 |
+
def is_by_epoch(config):
|
64 |
+
cfg = Config.fromfile('./configs/' + config)
|
65 |
+
return cfg.train_cfg.type == 'EpochBasedTrainLoop'
|
66 |
+
|
67 |
+
|
68 |
+
def get_final_epoch_or_iter(config):
|
69 |
+
cfg = Config.fromfile('./configs/' + config)
|
70 |
+
if cfg.train_cfg.type == 'EpochBasedTrainLoop':
|
71 |
+
return cfg.train_cfg.max_epochs
|
72 |
+
else:
|
73 |
+
return cfg.train_cfg.max_iters
|
74 |
+
|
75 |
+
|
76 |
+
def get_best_epoch_or_iter(exp_dir):
|
77 |
+
best_epoch_iter_full_path = list(
|
78 |
+
sorted(glob.glob(osp.join(exp_dir, 'best_*.pth'))))[-1]
|
79 |
+
best_epoch_or_iter_model_path = best_epoch_iter_full_path.split('/')[-1]
|
80 |
+
best_epoch_or_iter = best_epoch_or_iter_model_path. \
|
81 |
+
split('_')[-1].split('.')[0]
|
82 |
+
return best_epoch_or_iter_model_path, int(best_epoch_or_iter)
|
83 |
+
|
84 |
+
|
85 |
+
def get_real_epoch_or_iter(config):
|
86 |
+
cfg = Config.fromfile('./configs/' + config)
|
87 |
+
if cfg.train_cfg.type == 'EpochBasedTrainLoop':
|
88 |
+
epoch = cfg.train_cfg.max_epochs
|
89 |
+
return epoch
|
90 |
+
else:
|
91 |
+
return cfg.runner.max_iters
|
92 |
+
|
93 |
+
|
94 |
+
def get_final_results(log_json_path,
|
95 |
+
epoch_or_iter,
|
96 |
+
results_lut='coco/bbox_mAP',
|
97 |
+
by_epoch=True):
|
98 |
+
result_dict = dict()
|
99 |
+
with open(log_json_path) as f:
|
100 |
+
r = f.readlines()[-1]
|
101 |
+
last_metric = r.split(',')[0].split(': ')[-1].strip()
|
102 |
+
result_dict[results_lut] = last_metric
|
103 |
+
return result_dict
|
104 |
+
|
105 |
+
|
106 |
+
def get_dataset_name(config):
|
107 |
+
# If there are more dataset, add here.
|
108 |
+
name_map = dict(
|
109 |
+
CityscapesDataset='Cityscapes',
|
110 |
+
CocoDataset='COCO',
|
111 |
+
PoseCocoDataset='COCO Person',
|
112 |
+
YOLOv5CocoDataset='COCO',
|
113 |
+
CocoPanopticDataset='COCO',
|
114 |
+
YOLOv5DOTADataset='DOTA 1.0',
|
115 |
+
DeepFashionDataset='Deep Fashion',
|
116 |
+
LVISV05Dataset='LVIS v0.5',
|
117 |
+
LVISV1Dataset='LVIS v1',
|
118 |
+
VOCDataset='Pascal VOC',
|
119 |
+
YOLOv5VOCDataset='Pascal VOC',
|
120 |
+
WIDERFaceDataset='WIDER Face',
|
121 |
+
OpenImagesDataset='OpenImagesDataset',
|
122 |
+
OpenImagesChallengeDataset='OpenImagesChallengeDataset')
|
123 |
+
cfg = Config.fromfile('./configs/' + config)
|
124 |
+
return name_map[cfg.dataset_type]
|
125 |
+
|
126 |
+
|
127 |
+
def find_last_dir(model_dir):
|
128 |
+
dst_times = []
|
129 |
+
for time_stamp in os.scandir(model_dir):
|
130 |
+
if osp.isdir(time_stamp):
|
131 |
+
dst_time = time.mktime(
|
132 |
+
time.strptime(time_stamp.name, '%Y%m%d_%H%M%S'))
|
133 |
+
dst_times.append([dst_time, time_stamp.name])
|
134 |
+
return max(dst_times, key=lambda x: x[0])[1]
|
135 |
+
|
136 |
+
|
137 |
+
def convert_model_info_to_pwc(model_infos):
|
138 |
+
pwc_files = {}
|
139 |
+
for model in model_infos:
|
140 |
+
cfg_folder_name = osp.split(model['config'])[-2]
|
141 |
+
pwc_model_info = OrderedDict()
|
142 |
+
pwc_model_info['Name'] = osp.split(model['config'])[-1].split('.')[0]
|
143 |
+
pwc_model_info['In Collection'] = 'Please fill in Collection name'
|
144 |
+
pwc_model_info['Config'] = osp.join('configs', model['config'])
|
145 |
+
|
146 |
+
# get metadata
|
147 |
+
meta_data = OrderedDict()
|
148 |
+
if 'epochs' in model:
|
149 |
+
meta_data['Epochs'] = get_real_epoch_or_iter(model['config'])
|
150 |
+
else:
|
151 |
+
meta_data['Iterations'] = get_real_epoch_or_iter(model['config'])
|
152 |
+
pwc_model_info['Metadata'] = meta_data
|
153 |
+
|
154 |
+
# get dataset name
|
155 |
+
dataset_name = get_dataset_name(model['config'])
|
156 |
+
|
157 |
+
# get results
|
158 |
+
results = []
|
159 |
+
# if there are more metrics, add here.
|
160 |
+
if 'bbox_mAP' in model['results']:
|
161 |
+
metric = round(model['results']['bbox_mAP'] * 100, 1)
|
162 |
+
results.append(
|
163 |
+
OrderedDict(
|
164 |
+
Task='Object Detection',
|
165 |
+
Dataset=dataset_name,
|
166 |
+
Metrics={'box AP': metric}))
|
167 |
+
if 'segm_mAP' in model['results']:
|
168 |
+
metric = round(model['results']['segm_mAP'] * 100, 1)
|
169 |
+
results.append(
|
170 |
+
OrderedDict(
|
171 |
+
Task='Instance Segmentation',
|
172 |
+
Dataset=dataset_name,
|
173 |
+
Metrics={'mask AP': metric}))
|
174 |
+
if 'PQ' in model['results']:
|
175 |
+
metric = round(model['results']['PQ'], 1)
|
176 |
+
results.append(
|
177 |
+
OrderedDict(
|
178 |
+
Task='Panoptic Segmentation',
|
179 |
+
Dataset=dataset_name,
|
180 |
+
Metrics={'PQ': metric}))
|
181 |
+
pwc_model_info['Results'] = results
|
182 |
+
|
183 |
+
link_string = 'https://download.openmmlab.com/mmyolo/v0/'
|
184 |
+
link_string += '{}/{}'.format(model['config'].rstrip('.py'),
|
185 |
+
osp.split(model['model_path'])[-1])
|
186 |
+
pwc_model_info['Weights'] = link_string
|
187 |
+
if cfg_folder_name in pwc_files:
|
188 |
+
pwc_files[cfg_folder_name].append(pwc_model_info)
|
189 |
+
else:
|
190 |
+
pwc_files[cfg_folder_name] = [pwc_model_info]
|
191 |
+
return pwc_files
|
192 |
+
|
193 |
+
|
194 |
+
def parse_args():
|
195 |
+
parser = argparse.ArgumentParser(description='Gather benchmarked models')
|
196 |
+
parser.add_argument(
|
197 |
+
'root',
|
198 |
+
type=str,
|
199 |
+
help='root path of benchmarked models to be gathered')
|
200 |
+
parser.add_argument(
|
201 |
+
'out', type=str, help='output path of gathered models to be stored')
|
202 |
+
parser.add_argument(
|
203 |
+
'--best',
|
204 |
+
action='store_true',
|
205 |
+
help='whether to gather the best model.')
|
206 |
+
|
207 |
+
args = parser.parse_args()
|
208 |
+
return args
|
209 |
+
|
210 |
+
|
211 |
+
# TODO: Refine
|
212 |
+
def main():
|
213 |
+
args = parse_args()
|
214 |
+
models_root = args.root
|
215 |
+
models_out = args.out
|
216 |
+
mkdir_or_exist(models_out)
|
217 |
+
|
218 |
+
# find all models in the root directory to be gathered
|
219 |
+
raw_configs = list(scandir('./configs', '.py', recursive=True))
|
220 |
+
|
221 |
+
# filter configs that is not trained in the experiments dir
|
222 |
+
used_configs = []
|
223 |
+
for raw_config in raw_configs:
|
224 |
+
if osp.exists(osp.join(models_root, raw_config)):
|
225 |
+
used_configs.append(raw_config)
|
226 |
+
print(f'Find {len(used_configs)} models to be gathered')
|
227 |
+
|
228 |
+
# find final_ckpt and log file for trained each config
|
229 |
+
# and parse the best performance
|
230 |
+
model_infos = []
|
231 |
+
for used_config in used_configs:
|
232 |
+
exp_dir = osp.join(models_root, used_config)
|
233 |
+
by_epoch = is_by_epoch(used_config)
|
234 |
+
# check whether the exps is finished
|
235 |
+
if args.best is True:
|
236 |
+
final_model, final_epoch_or_iter = get_best_epoch_or_iter(exp_dir)
|
237 |
+
else:
|
238 |
+
final_epoch_or_iter = get_final_epoch_or_iter(used_config)
|
239 |
+
final_model = '{}_{}.pth'.format('epoch' if by_epoch else 'iter',
|
240 |
+
final_epoch_or_iter)
|
241 |
+
|
242 |
+
model_path = osp.join(exp_dir, final_model)
|
243 |
+
# skip if the model is still training
|
244 |
+
if not osp.exists(model_path):
|
245 |
+
continue
|
246 |
+
|
247 |
+
# get the latest logs
|
248 |
+
latest_exp_name = find_last_dir(exp_dir)
|
249 |
+
latest_exp_json = osp.join(exp_dir, latest_exp_name, 'vis_data',
|
250 |
+
latest_exp_name + '.json')
|
251 |
+
|
252 |
+
model_performance = get_final_results(
|
253 |
+
latest_exp_json, final_epoch_or_iter, by_epoch=by_epoch)
|
254 |
+
|
255 |
+
if model_performance is None:
|
256 |
+
continue
|
257 |
+
|
258 |
+
model_info = dict(
|
259 |
+
config=used_config,
|
260 |
+
results=model_performance,
|
261 |
+
final_model=final_model,
|
262 |
+
latest_exp_json=latest_exp_json,
|
263 |
+
latest_exp_name=latest_exp_name)
|
264 |
+
model_info['epochs' if by_epoch else 'iterations'] = \
|
265 |
+
final_epoch_or_iter
|
266 |
+
model_infos.append(model_info)
|
267 |
+
|
268 |
+
# publish model for each checkpoint
|
269 |
+
publish_model_infos = []
|
270 |
+
for model in model_infos:
|
271 |
+
model_publish_dir = osp.join(models_out, model['config'].rstrip('.py'))
|
272 |
+
mkdir_or_exist(model_publish_dir)
|
273 |
+
|
274 |
+
model_name = osp.split(model['config'])[-1].split('.')[0]
|
275 |
+
|
276 |
+
model_name += '_' + model['latest_exp_name']
|
277 |
+
publish_model_path = osp.join(model_publish_dir, model_name)
|
278 |
+
trained_model_path = osp.join(models_root, model['config'],
|
279 |
+
model['final_model'])
|
280 |
+
|
281 |
+
# convert model
|
282 |
+
final_model_path = process_checkpoint(trained_model_path,
|
283 |
+
publish_model_path)
|
284 |
+
|
285 |
+
# copy log
|
286 |
+
shutil.copy(model['latest_exp_json'],
|
287 |
+
osp.join(model_publish_dir, f'{model_name}.log.json'))
|
288 |
+
|
289 |
+
# copy config to guarantee reproducibility
|
290 |
+
config_path = model['config']
|
291 |
+
config_path = osp.join(
|
292 |
+
'configs',
|
293 |
+
config_path) if 'configs' not in config_path else config_path
|
294 |
+
target_config_path = osp.split(config_path)[-1]
|
295 |
+
shutil.copy(config_path, osp.join(model_publish_dir,
|
296 |
+
target_config_path))
|
297 |
+
|
298 |
+
model['model_path'] = final_model_path
|
299 |
+
publish_model_infos.append(model)
|
300 |
+
|
301 |
+
models = dict(models=publish_model_infos)
|
302 |
+
print(f'Totally gathered {len(publish_model_infos)} models')
|
303 |
+
dump(models, osp.join(models_out, 'model_info.json'))
|
304 |
+
|
305 |
+
pwc_files = convert_model_info_to_pwc(publish_model_infos)
|
306 |
+
for name in pwc_files:
|
307 |
+
with open(osp.join(models_out, name + '_metafile.yml'), 'w') as f:
|
308 |
+
ordered_yaml_dump(pwc_files[name], f, encoding='utf-8')
|
309 |
+
|
310 |
+
|
311 |
+
if __name__ == '__main__':
|
312 |
+
main()
|
third_party/mmyolo/.dev_scripts/print_registers.py
ADDED
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (c) OpenMMLab. All rights reserved.
|
2 |
+
import argparse
|
3 |
+
import importlib
|
4 |
+
import os
|
5 |
+
import os.path as osp
|
6 |
+
import pkgutil
|
7 |
+
import sys
|
8 |
+
import tempfile
|
9 |
+
from multiprocessing import Pool
|
10 |
+
from pathlib import Path
|
11 |
+
|
12 |
+
import numpy as np
|
13 |
+
import pandas as pd
|
14 |
+
|
15 |
+
# host_addr = 'https://gitee.com/open-mmlab'
|
16 |
+
host_addr = 'https://github.com/open-mmlab'
|
17 |
+
tools_list = ['tools', '.dev_scripts']
|
18 |
+
proxy_names = {
|
19 |
+
'mmdet': 'mmdetection',
|
20 |
+
'mmseg': 'mmsegmentation',
|
21 |
+
'mmcls': 'mmclassification'
|
22 |
+
}
|
23 |
+
merge_module_keys = {'mmcv': ['mmengine']}
|
24 |
+
# exclude_prefix = {'mmcv': ['<class \'mmengine.model.']}
|
25 |
+
exclude_prefix = {}
|
26 |
+
markdown_title = '# MM 系列开源库注册表\n'
|
27 |
+
markdown_title += '(注意:本文档是通过 .dev_scripts/print_registers.py 脚本自动生成)'
|
28 |
+
|
29 |
+
|
30 |
+
def capitalize(repo_name):
|
31 |
+
lower = repo_name.lower()
|
32 |
+
if lower == 'mmcv':
|
33 |
+
return repo_name.upper()
|
34 |
+
elif lower.startswith('mm'):
|
35 |
+
return 'MM' + repo_name[2:]
|
36 |
+
return repo_name.capitalize()
|
37 |
+
|
38 |
+
|
39 |
+
def mkdir_or_exist(dir_name, mode=0o777):
|
40 |
+
if dir_name == '':
|
41 |
+
return
|
42 |
+
dir_name = osp.expanduser(dir_name)
|
43 |
+
os.makedirs(dir_name, mode=mode, exist_ok=True)
|
44 |
+
|
45 |
+
|
46 |
+
def parse_repo_name(repo_name):
|
47 |
+
proxy_names_rev = dict(zip(proxy_names.values(), proxy_names.keys()))
|
48 |
+
repo_name = proxy_names.get(repo_name, repo_name)
|
49 |
+
module_name = proxy_names_rev.get(repo_name, repo_name)
|
50 |
+
return repo_name, module_name
|
51 |
+
|
52 |
+
|
53 |
+
def git_pull_branch(repo_name, branch_name='', pulldir='.'):
|
54 |
+
mkdir_or_exist(pulldir)
|
55 |
+
exec_str = f'cd {pulldir};git init;git pull '
|
56 |
+
exec_str += f'{host_addr}/{repo_name}.git'
|
57 |
+
if branch_name:
|
58 |
+
exec_str += f' {branch_name}'
|
59 |
+
returncode = os.system(exec_str)
|
60 |
+
if returncode:
|
61 |
+
raise RuntimeError(
|
62 |
+
f'failed to get the remote repo, code: {returncode}')
|
63 |
+
|
64 |
+
|
65 |
+
def load_modules_from_dir(module_name, module_root, throw_error=False):
|
66 |
+
print(f'loading the {module_name} modules...')
|
67 |
+
# # install the dependencies
|
68 |
+
# if osp.exists(osp.join(pkg_dir, 'requirements.txt')):
|
69 |
+
# os.system('pip install -r requirements.txt')
|
70 |
+
# get all module list
|
71 |
+
module_list = []
|
72 |
+
error_dict = {}
|
73 |
+
module_root = osp.join(module_root, module_name)
|
74 |
+
assert osp.exists(module_root), \
|
75 |
+
f'cannot find the module root: {module_root}'
|
76 |
+
for _root, _dirs, _files in os.walk(module_root):
|
77 |
+
if (('__init__.py' not in _files)
|
78 |
+
and (osp.split(_root)[1] != '__pycache__')):
|
79 |
+
# add __init__.py file to the package
|
80 |
+
with open(osp.join(_root, '__init__.py'), 'w') as _:
|
81 |
+
pass
|
82 |
+
|
83 |
+
def _onerror(*args, **kwargs):
|
84 |
+
pass
|
85 |
+
|
86 |
+
for _finder, _name, _ispkg in pkgutil.walk_packages([module_root],
|
87 |
+
prefix=module_name +
|
88 |
+
'.',
|
89 |
+
onerror=_onerror):
|
90 |
+
try:
|
91 |
+
module = importlib.import_module(_name)
|
92 |
+
module_list.append(module)
|
93 |
+
except Exception as e:
|
94 |
+
if throw_error:
|
95 |
+
raise e
|
96 |
+
_error_msg = f'{type(e)}: {e}.'
|
97 |
+
print(f'cannot import the module: {_name} ({_error_msg})')
|
98 |
+
assert (_name not in error_dict), \
|
99 |
+
f'duplicate error name was found: {_name}'
|
100 |
+
error_dict[_name] = _error_msg
|
101 |
+
for module in module_list:
|
102 |
+
assert module.__file__.startswith(module_root), \
|
103 |
+
f'the importing path of package was wrong: {module.__file__}'
|
104 |
+
print('modules were loaded...')
|
105 |
+
return module_list, error_dict
|
106 |
+
|
107 |
+
|
108 |
+
def get_registries_from_modules(module_list):
|
109 |
+
registries = {}
|
110 |
+
objects_set = set()
|
111 |
+
# import the Registry class,
|
112 |
+
# import at the beginning is not allowed
|
113 |
+
# because it is not the temp package
|
114 |
+
from mmengine.registry import Registry
|
115 |
+
|
116 |
+
# only get the specific registries in module list
|
117 |
+
for module in module_list:
|
118 |
+
for obj_name in dir(module):
|
119 |
+
_obj = getattr(module, obj_name)
|
120 |
+
if isinstance(_obj, Registry):
|
121 |
+
objects_set.add(_obj)
|
122 |
+
for _obj in objects_set:
|
123 |
+
if _obj.scope not in registries:
|
124 |
+
registries[_obj.scope] = {}
|
125 |
+
registries_scope = registries[_obj.scope]
|
126 |
+
assert _obj.name not in registries_scope, \
|
127 |
+
f'multiple definition of {_obj.name} in registries'
|
128 |
+
registries_scope[_obj.name] = {
|
129 |
+
key: str(val)
|
130 |
+
for key, val in _obj.module_dict.items()
|
131 |
+
}
|
132 |
+
print('registries got...')
|
133 |
+
return registries
|
134 |
+
|
135 |
+
|
136 |
+
def merge_registries(src_dict, dst_dict):
|
137 |
+
assert type(src_dict) == type(dst_dict), \
|
138 |
+
(f'merge type is not supported: '
|
139 |
+
f'{type(dst_dict)} and {type(src_dict)}')
|
140 |
+
if isinstance(src_dict, str):
|
141 |
+
return
|
142 |
+
for _k, _v in dst_dict.items():
|
143 |
+
if (_k not in src_dict):
|
144 |
+
src_dict.update({_k: _v})
|
145 |
+
else:
|
146 |
+
assert isinstance(_v, (dict, str)) and \
|
147 |
+
isinstance(src_dict[_k], (dict, str)), \
|
148 |
+
'merge type is not supported: ' \
|
149 |
+
f'{type(_v)} and {type(src_dict[_k])}'
|
150 |
+
merge_registries(src_dict[_k], _v)
|
151 |
+
|
152 |
+
|
153 |
+
def exclude_registries(registries, exclude_key):
|
154 |
+
for _k in list(registries.keys()):
|
155 |
+
_v = registries[_k]
|
156 |
+
if isinstance(_v, str) and _v.startswith(exclude_key):
|
157 |
+
registries.pop(_k)
|
158 |
+
elif isinstance(_v, dict):
|
159 |
+
exclude_registries(_v, exclude_key)
|
160 |
+
|
161 |
+
|
162 |
+
def get_scripts_from_dir(root):
|
163 |
+
|
164 |
+
def _recurse(_dict, _chain):
|
165 |
+
if len(_chain) <= 1:
|
166 |
+
_dict[_chain[0]] = None
|
167 |
+
return
|
168 |
+
_key, *_chain = _chain
|
169 |
+
if _key not in _dict:
|
170 |
+
_dict[_key] = {}
|
171 |
+
_recurse(_dict[_key], _chain)
|
172 |
+
|
173 |
+
# find all scripts in the root directory. (not just ('.py', '.sh'))
|
174 |
+
# can not use the scandir function in mmengine to scan the dir,
|
175 |
+
# because mmengine import is not allowed before git pull
|
176 |
+
scripts = {}
|
177 |
+
for _subroot, _dirs, _files in os.walk(root):
|
178 |
+
for _file in _files:
|
179 |
+
_script = osp.join(osp.relpath(_subroot, root), _file)
|
180 |
+
_recurse(scripts, Path(_script).parts)
|
181 |
+
return scripts
|
182 |
+
|
183 |
+
|
184 |
+
def get_version_from_module_name(module_name, branch):
|
185 |
+
branch_str = str(branch) if branch is not None else ''
|
186 |
+
version_str = ''
|
187 |
+
try:
|
188 |
+
exec(f'import {module_name}')
|
189 |
+
_module = eval(f'{module_name}')
|
190 |
+
if hasattr(_module, '__version__'):
|
191 |
+
version_str = str(_module.__version__)
|
192 |
+
else:
|
193 |
+
version_str = branch_str
|
194 |
+
version_str = f' ({version_str})' if version_str else version_str
|
195 |
+
except (ImportError, AttributeError) as e:
|
196 |
+
print(f'can not get the version of module {module_name}: {e}')
|
197 |
+
return version_str
|
198 |
+
|
199 |
+
|
200 |
+
def print_tree(print_dict):
|
201 |
+
# recursive print the dict tree
|
202 |
+
def _recurse(_dict, _connector='', n=0):
|
203 |
+
assert isinstance(_dict, dict), 'recursive type must be dict'
|
204 |
+
tree = ''
|
205 |
+
for idx, (_key, _val) in enumerate(_dict.items()):
|
206 |
+
sub_tree = ''
|
207 |
+
_last = (idx == (len(_dict) - 1))
|
208 |
+
if isinstance(_val, str):
|
209 |
+
_key += f' ({_val})'
|
210 |
+
elif isinstance(_val, dict):
|
211 |
+
sub_tree = _recurse(_val,
|
212 |
+
_connector + (' ' if _last else '│ '),
|
213 |
+
n + 1)
|
214 |
+
else:
|
215 |
+
assert (_val is None), f'unknown print type {_val}'
|
216 |
+
tree += ' ' + _connector + \
|
217 |
+
('└─' if _last else '├─') + f'({n}) {_key}' + '\n'
|
218 |
+
tree += sub_tree
|
219 |
+
return tree
|
220 |
+
|
221 |
+
for _pname, _pdict in print_dict.items():
|
222 |
+
print('-' * 100)
|
223 |
+
print(f'{_pname}\n' + _recurse(_pdict))
|
224 |
+
|
225 |
+
|
226 |
+
def divide_list_into_groups(_array, _maxsize_per_group):
|
227 |
+
if not _array:
|
228 |
+
return _array
|
229 |
+
_groups = np.asarray(len(_array) / _maxsize_per_group)
|
230 |
+
if len(_array) % _maxsize_per_group:
|
231 |
+
_groups = np.floor(_groups) + 1
|
232 |
+
_groups = _groups.astype(int)
|
233 |
+
return np.array_split(_array, _groups)
|
234 |
+
|
235 |
+
|
236 |
+
def registries_to_html(registries, title=''):
|
237 |
+
max_col_per_row = 5
|
238 |
+
max_size_per_cell = 20
|
239 |
+
html = ''
|
240 |
+
table_data = []
|
241 |
+
# save repository registries
|
242 |
+
for registry_name, registry_dict in registries.items():
|
243 |
+
# filter the empty registries
|
244 |
+
if not registry_dict:
|
245 |
+
continue
|
246 |
+
registry_strings = []
|
247 |
+
if isinstance(registry_dict, dict):
|
248 |
+
registry_dict = list(registry_dict.keys())
|
249 |
+
elif isinstance(registry_dict, list):
|
250 |
+
pass
|
251 |
+
else:
|
252 |
+
raise TypeError(
|
253 |
+
f'unknown type of registry_dict {type(registry_dict)}')
|
254 |
+
for _k in registry_dict:
|
255 |
+
registry_strings.append(f'<li>{_k}</li>')
|
256 |
+
table_data.append((registry_name, registry_strings))
|
257 |
+
|
258 |
+
# sort the data list
|
259 |
+
table_data = sorted(table_data, key=lambda x: len(x[1]))
|
260 |
+
# split multi parts
|
261 |
+
table_data_multi_parts = []
|
262 |
+
for (registry_name, registry_strings) in table_data:
|
263 |
+
multi_parts = False
|
264 |
+
if len(registry_strings) > max_size_per_cell:
|
265 |
+
multi_parts = True
|
266 |
+
for cell_idx, registry_cell in enumerate(
|
267 |
+
divide_list_into_groups(registry_strings, max_size_per_cell)):
|
268 |
+
registry_str = ''.join(registry_cell.tolist())
|
269 |
+
registry_str = f'<ul>{registry_str}</ul>'
|
270 |
+
table_data_multi_parts.append([
|
271 |
+
registry_name if not multi_parts else
|
272 |
+
f'{registry_name} (part {cell_idx + 1})', registry_str
|
273 |
+
])
|
274 |
+
|
275 |
+
for table_data in divide_list_into_groups(table_data_multi_parts,
|
276 |
+
max_col_per_row):
|
277 |
+
table_data = list(zip(*table_data.tolist()))
|
278 |
+
html += dataframe_to_html(
|
279 |
+
pd.DataFrame([table_data[1]], columns=table_data[0]))
|
280 |
+
if html:
|
281 |
+
html = f'<div align=\'center\'><b>{title}</b></div>\n{html}'
|
282 |
+
html = f'<details open>{html}</details>\n'
|
283 |
+
return html
|
284 |
+
|
285 |
+
|
286 |
+
def tools_to_html(tools_dict, repo_name=''):
|
287 |
+
|
288 |
+
def _recurse(_dict, _connector, _result):
|
289 |
+
assert isinstance(_dict, dict), \
|
290 |
+
f'unknown recurse type: {_dict} ({type(_dict)})'
|
291 |
+
for _k, _v in _dict.items():
|
292 |
+
if _v is None:
|
293 |
+
if _connector not in _result:
|
294 |
+
_result[_connector] = []
|
295 |
+
_result[_connector].append(_k)
|
296 |
+
else:
|
297 |
+
_recurse(_v, osp.join(_connector, _k), _result)
|
298 |
+
|
299 |
+
table_data = {}
|
300 |
+
title = f'{capitalize(repo_name)} Tools'
|
301 |
+
_recurse(tools_dict, '', table_data)
|
302 |
+
return registries_to_html(table_data, title)
|
303 |
+
|
304 |
+
|
305 |
+
def dataframe_to_html(dataframe):
|
306 |
+
styler = dataframe.style
|
307 |
+
styler = styler.hide(axis='index')
|
308 |
+
styler = styler.format(na_rep='-')
|
309 |
+
styler = styler.set_properties(**{
|
310 |
+
'text-align': 'left',
|
311 |
+
'align': 'center',
|
312 |
+
'vertical-align': 'top'
|
313 |
+
})
|
314 |
+
styler = styler.set_table_styles([{
|
315 |
+
'selector':
|
316 |
+
'thead th',
|
317 |
+
'props':
|
318 |
+
'align:center;text-align:center;vertical-align:bottom'
|
319 |
+
}])
|
320 |
+
html = styler.to_html()
|
321 |
+
html = f'<div align=\'center\'>\n{html}</div>'
|
322 |
+
return html
|
323 |
+
|
324 |
+
|
325 |
+
def generate_markdown_by_repository(repo_name,
|
326 |
+
module_name,
|
327 |
+
branch,
|
328 |
+
pulldir,
|
329 |
+
throw_error=False):
|
330 |
+
# add the pull dir to the system path so that it can be found
|
331 |
+
if pulldir not in sys.path:
|
332 |
+
sys.path.insert(0, pulldir)
|
333 |
+
module_list, error_dict = load_modules_from_dir(
|
334 |
+
module_name, pulldir, throw_error=throw_error)
|
335 |
+
registries_tree = get_registries_from_modules(module_list)
|
336 |
+
if error_dict:
|
337 |
+
error_dict_name = 'error_modules'
|
338 |
+
assert (error_dict_name not in registries_tree), \
|
339 |
+
f'duplicate module name was found: {error_dict_name}'
|
340 |
+
registries_tree.update({error_dict_name: error_dict})
|
341 |
+
# get the tools files
|
342 |
+
for tools_name in tools_list:
|
343 |
+
assert (tools_name not in registries_tree), \
|
344 |
+
f'duplicate tools name was found: {tools_name}'
|
345 |
+
tools_tree = osp.join(pulldir, tools_name)
|
346 |
+
tools_tree = get_scripts_from_dir(tools_tree)
|
347 |
+
registries_tree.update({tools_name: tools_tree})
|
348 |
+
# print_tree(registries_tree)
|
349 |
+
# get registries markdown string
|
350 |
+
module_registries = registries_tree.get(module_name, {})
|
351 |
+
for merge_key in merge_module_keys.get(module_name, []):
|
352 |
+
merge_dict = registries_tree.get(merge_key, {})
|
353 |
+
merge_registries(module_registries, merge_dict)
|
354 |
+
for exclude_key in exclude_prefix.get(module_name, []):
|
355 |
+
exclude_registries(module_registries, exclude_key)
|
356 |
+
markdown_str = registries_to_html(
|
357 |
+
module_registries, title=f'{capitalize(repo_name)} Module Components')
|
358 |
+
# get tools markdown string
|
359 |
+
tools_registries = {}
|
360 |
+
for tools_name in tools_list:
|
361 |
+
tools_registries.update(
|
362 |
+
{tools_name: registries_tree.get(tools_name, {})})
|
363 |
+
markdown_str += tools_to_html(tools_registries, repo_name=repo_name)
|
364 |
+
version_str = get_version_from_module_name(module_name, branch)
|
365 |
+
title_str = f'\n\n## {capitalize(repo_name)}{version_str}\n'
|
366 |
+
# remove the pull dir from system path
|
367 |
+
if pulldir in sys.path:
|
368 |
+
sys.path.remove(pulldir)
|
369 |
+
return f'{title_str}{markdown_str}'
|
370 |
+
|
371 |
+
|
372 |
+
def parse_args():
|
373 |
+
parser = argparse.ArgumentParser(
|
374 |
+
description='print registries in openmmlab repositories')
|
375 |
+
parser.add_argument(
|
376 |
+
'-r',
|
377 |
+
'--repositories',
|
378 |
+
nargs='+',
|
379 |
+
default=['mmdet', 'mmcls', 'mmseg', 'mmengine', 'mmcv'],
|
380 |
+
type=str,
|
381 |
+
help='git repositories name in OpenMMLab')
|
382 |
+
parser.add_argument(
|
383 |
+
'-b',
|
384 |
+
'--branches',
|
385 |
+
nargs='+',
|
386 |
+
default=['3.x', '1.x', '1.x', 'main', '2.x'],
|
387 |
+
type=str,
|
388 |
+
help='the branch names of git repositories, the length of branches '
|
389 |
+
'must be same as the length of repositories')
|
390 |
+
parser.add_argument(
|
391 |
+
'-o', '--out', type=str, default='.', help='output path of the file')
|
392 |
+
parser.add_argument(
|
393 |
+
'--throw-error',
|
394 |
+
action='store_true',
|
395 |
+
default=False,
|
396 |
+
help='whether to throw error when trying to import modules')
|
397 |
+
args = parser.parse_args()
|
398 |
+
return args
|
399 |
+
|
400 |
+
|
401 |
+
# TODO: Refine
|
402 |
+
def main():
|
403 |
+
args = parse_args()
|
404 |
+
repositories = args.repositories
|
405 |
+
branches = args.branches
|
406 |
+
assert isinstance(repositories, list), \
|
407 |
+
'Type of repositories must be list'
|
408 |
+
if branches is None:
|
409 |
+
branches = [None] * len(repositories)
|
410 |
+
assert isinstance(branches, list) and \
|
411 |
+
len(branches) == len(repositories), \
|
412 |
+
'The length of branches must be same as ' \
|
413 |
+
'that of repositories'
|
414 |
+
assert isinstance(args.out, str), \
|
415 |
+
'The type of output path must be string'
|
416 |
+
# save path of file
|
417 |
+
mkdir_or_exist(args.out)
|
418 |
+
save_path = osp.join(args.out, 'registries_info.md')
|
419 |
+
with tempfile.TemporaryDirectory() as tmpdir:
|
420 |
+
# multi process init
|
421 |
+
pool = Pool(processes=len(repositories))
|
422 |
+
multi_proc_input_list = []
|
423 |
+
multi_proc_output_list = []
|
424 |
+
# get the git repositories
|
425 |
+
for branch, repository in zip(branches, repositories):
|
426 |
+
repo_name, module_name = parse_repo_name(repository)
|
427 |
+
pulldir = osp.join(tmpdir, f'tmp_{repo_name}')
|
428 |
+
git_pull_branch(
|
429 |
+
repo_name=repo_name, branch_name=branch, pulldir=pulldir)
|
430 |
+
multi_proc_input_list.append(
|
431 |
+
(repo_name, module_name, branch, pulldir, args.throw_error))
|
432 |
+
print('starting the multi process to get the registries')
|
433 |
+
for multi_proc_input in multi_proc_input_list:
|
434 |
+
multi_proc_output_list.append(
|
435 |
+
pool.apply_async(generate_markdown_by_repository,
|
436 |
+
multi_proc_input))
|
437 |
+
pool.close()
|
438 |
+
pool.join()
|
439 |
+
with open(save_path, 'w', encoding='utf-8') as fw:
|
440 |
+
fw.write(f'{markdown_title}\n')
|
441 |
+
for multi_proc_output in multi_proc_output_list:
|
442 |
+
markdown_str = multi_proc_output.get()
|
443 |
+
fw.write(f'{markdown_str}\n')
|
444 |
+
print(f'saved registries to the path: {save_path}')
|
445 |
+
|
446 |
+
|
447 |
+
if __name__ == '__main__':
|
448 |
+
main()
|
third_party/mmyolo/.github/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Contributor Covenant Code of Conduct
|
2 |
+
|
3 |
+
## Our Pledge
|
4 |
+
|
5 |
+
In the interest of fostering an open and welcoming environment, we as
|
6 |
+
contributors and maintainers pledge to making participation in our project and
|
7 |
+
our community a harassment-free experience for everyone, regardless of age, body
|
8 |
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9 |
+
level of experience, education, socio-economic status, nationality, personal
|
10 |
+
appearance, race, religion, or sexual identity and orientation.
|
11 |
+
|
12 |
+
## Our Standards
|
13 |
+
|
14 |
+
Examples of behavior that contributes to creating a positive environment
|
15 |
+
include:
|
16 |
+
|
17 |
+
- Using welcoming and inclusive language
|
18 |
+
- Being respectful of differing viewpoints and experiences
|
19 |
+
- Gracefully accepting constructive criticism
|
20 |
+
- Focusing on what is best for the community
|
21 |
+
- Showing empathy towards other community members
|
22 |
+
|
23 |
+
Examples of unacceptable behavior by participants include:
|
24 |
+
|
25 |
+
- The use of sexualized language or imagery and unwelcome sexual attention or
|
26 |
+
advances
|
27 |
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
28 |
+
- Public or private harassment
|
29 |
+
- Publishing others' private information, such as a physical or electronic
|
30 |
+
address, without explicit permission
|
31 |
+
- Other conduct which could reasonably be considered inappropriate in a
|
32 |
+
professional setting
|
33 |
+
|
34 |
+
## Our Responsibilities
|
35 |
+
|
36 |
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37 |
+
behavior and are expected to take appropriate and fair corrective action in
|
38 |
+
response to any instances of unacceptable behavior.
|
39 |
+
|
40 |
+
Project maintainers have the right and responsibility to remove, edit, or
|
41 |
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42 |
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43 |
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44 |
+
threatening, offensive, or harmful.
|
45 |
+
|
46 |
+
## Scope
|
47 |
+
|
48 |
+
This Code of Conduct applies both within project spaces and in public spaces
|
49 |
+
when an individual is representing the project or its community. Examples of
|
50 |
+
representing a project or community include using an official project e-mail
|
51 |
+
address, posting via an official social media account, or acting as an appointed
|
52 |
+
representative at an online or offline event. Representation of a project may be
|
53 |
+
further defined and clarified by project maintainers.
|
54 |
+
|
55 |
+
## Enforcement
|
56 |
+
|
57 |
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58 |
+
reported by contacting the project team at chenkaidev@gmail.com. All
|
59 |
+
complaints will be reviewed and investigated and will result in a response that
|
60 |
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61 |
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62 |
+
Further details of specific enforcement policies may be posted separately.
|
63 |
+
|
64 |
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65 |
+
faith may face temporary or permanent repercussions as determined by other
|
66 |
+
members of the project's leadership.
|
67 |
+
|
68 |
+
## Attribution
|
69 |
+
|
70 |
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71 |
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72 |
+
|
73 |
+
For answers to common questions about this code of conduct, see
|
74 |
+
https://www.contributor-covenant.org/faq
|
75 |
+
|
76 |
+
[homepage]: https://www.contributor-covenant.org
|
third_party/mmyolo/.github/CONTRIBUTING.md
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
We appreciate all contributions to improve MMYOLO. Please refer to [CONTRIBUTING.md](https://github.com/open-mmlab/mmcv/blob/master/CONTRIBUTING.md) in MMCV for more details about the contributing guideline.
|
third_party/mmyolo/.github/ISSUE_TEMPLATE/1-bug-report.yml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: "🐞 Bug report"
|
2 |
+
description: "Create a report to help us reproduce and fix the bug"
|
3 |
+
|
4 |
+
|
5 |
+
body:
|
6 |
+
- type: markdown
|
7 |
+
attributes:
|
8 |
+
value: |
|
9 |
+
Thank you for reporting this issue to help us improve!
|
10 |
+
If you have already identified the reason, we strongly appreciate you creating a new PR to fix it [here](https://github.com/open-mmlab/mmyolo/pulls)!
|
11 |
+
If this issue is about installing MMCV, please file an issue at [MMCV](https://github.com/open-mmlab/mmcv/issues/new/choose).
|
12 |
+
If you need our help, please fill in as much of the following form as you're able.
|
13 |
+
|
14 |
+
- type: checkboxes
|
15 |
+
attributes:
|
16 |
+
label: Prerequisite
|
17 |
+
description: Please check the following items before creating a new issue.
|
18 |
+
options:
|
19 |
+
- label: I have searched [the existing and past issues](https://github.com/open-mmlab/mmyolo/issues) but cannot get the expected help.
|
20 |
+
required: true
|
21 |
+
- label: I have read the [FAQ documentation](https://mmyolo.readthedocs.io/en/latest/faq.html) but cannot get the expected help.
|
22 |
+
required: true
|
23 |
+
- label: The bug has not been fixed in the [latest version](https://github.com/open-mmlab/mmyolo).
|
24 |
+
required: true
|
25 |
+
|
26 |
+
- type: textarea
|
27 |
+
attributes:
|
28 |
+
label: 🐞 Describe the bug
|
29 |
+
description: |
|
30 |
+
Please provide a clear and concise description of what the bug is.
|
31 |
+
Preferably a simple and minimal code snippet that we can reproduce the error by running the code.
|
32 |
+
placeholder: |
|
33 |
+
A clear and concise description of what the bug is.
|
34 |
+
|
35 |
+
```python
|
36 |
+
# Sample code to reproduce the problem
|
37 |
+
```
|
38 |
+
|
39 |
+
```shell
|
40 |
+
The command or script you run.
|
41 |
+
```
|
42 |
+
|
43 |
+
```
|
44 |
+
The error message or logs you got, with the full traceback.
|
45 |
+
```
|
46 |
+
validations:
|
47 |
+
required: true
|
48 |
+
|
49 |
+
- type: textarea
|
50 |
+
attributes:
|
51 |
+
label: Environment
|
52 |
+
description: |
|
53 |
+
Please run `python mmyolo/utils/collect_env.py` to collect necessary environment information and paste it here.
|
54 |
+
You may add addition that may be helpful for locating the problem, such as
|
55 |
+
- How you installed PyTorch \[e.g., pip, conda, source\]
|
56 |
+
- Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)
|
57 |
+
validations:
|
58 |
+
required: true
|
59 |
+
|
60 |
+
- type: textarea
|
61 |
+
attributes:
|
62 |
+
label: Additional information
|
63 |
+
description: Tell us anything else you think we should know.
|
64 |
+
placeholder: |
|
65 |
+
1. Did you make any modifications on the code or config? Did you understand what you have modified?
|
66 |
+
2. What dataset did you use?
|
67 |
+
3. What do you think might be the reason?
|
third_party/mmyolo/.github/ISSUE_TEMPLATE/2-feature-request.yml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: 🚀 Feature request
|
2 |
+
description: Suggest an idea for this project
|
3 |
+
labels: [feature request]
|
4 |
+
|
5 |
+
body:
|
6 |
+
- type: markdown
|
7 |
+
attributes:
|
8 |
+
value: |
|
9 |
+
Thank you for suggesting an idea to make MMYOLO better.
|
10 |
+
We strongly appreciate you creating a PR to implete this feature [here](https://github.com/open-mmlab/mmyolo/pulls)!
|
11 |
+
|
12 |
+
If you need our help, please fill in as much of the following form as you're able.
|
13 |
+
|
14 |
+
- type: textarea
|
15 |
+
attributes:
|
16 |
+
label: What is the problem this feature will solve?
|
17 |
+
placeholder: |
|
18 |
+
E.g., It is inconvenient when \[....\].
|
19 |
+
validations:
|
20 |
+
required: true
|
21 |
+
|
22 |
+
- type: textarea
|
23 |
+
attributes:
|
24 |
+
label: What is the feature you are proposing to solve the problem?
|
25 |
+
validations:
|
26 |
+
required: true
|
27 |
+
|
28 |
+
- type: textarea
|
29 |
+
attributes:
|
30 |
+
label: What alternatives have you considered?
|
31 |
+
description: |
|
32 |
+
Add any other context or screenshots about the feature request here.
|
third_party/mmyolo/.github/ISSUE_TEMPLATE/3-new-model.yml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: "\U0001F31F New model/dataset addition"
|
2 |
+
description: Submit a proposal/request to implement a new model / dataset
|
3 |
+
labels: [ "New model/dataset" ]
|
4 |
+
|
5 |
+
body:
|
6 |
+
- type: textarea
|
7 |
+
id: description-request
|
8 |
+
validations:
|
9 |
+
required: true
|
10 |
+
attributes:
|
11 |
+
label: Model/Dataset description
|
12 |
+
description: |
|
13 |
+
Put any and all important information relative to the model/dataset
|
14 |
+
|
15 |
+
- type: checkboxes
|
16 |
+
attributes:
|
17 |
+
label: Open source status
|
18 |
+
description: |
|
19 |
+
Please provide the open-source status, which would be very helpful
|
20 |
+
options:
|
21 |
+
- label: "The model implementation is available"
|
22 |
+
- label: "The model weights are available."
|
23 |
+
|
24 |
+
- type: textarea
|
25 |
+
id: additional-info
|
26 |
+
attributes:
|
27 |
+
label: Provide useful links for the implementation
|
28 |
+
description: |
|
29 |
+
Please provide information regarding the implementation, the weights, and the authors.
|
30 |
+
Please mention the authors by @gh-username if you're aware of their usernames.
|
third_party/mmyolo/.github/ISSUE_TEMPLATE/4-documentation.yml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: 📚 Documentation
|
2 |
+
description: Report an issue related to https://mmyolo.readthedocs.io/en/latest/.
|
3 |
+
|
4 |
+
body:
|
5 |
+
- type: textarea
|
6 |
+
attributes:
|
7 |
+
label: 📚 The doc issue
|
8 |
+
description: >
|
9 |
+
A clear and concise description of what content in https://mmyolo.readthedocs.io/en/latest/ is an issue.
|
10 |
+
validations:
|
11 |
+
required: true
|
12 |
+
|
13 |
+
- type: textarea
|
14 |
+
attributes:
|
15 |
+
label: Suggest a potential alternative/fix
|
16 |
+
description: >
|
17 |
+
Tell us how we could improve the documentation in this regard.
|
18 |
+
|
19 |
+
- type: markdown
|
20 |
+
attributes:
|
21 |
+
value: >
|
22 |
+
Thanks for contributing 🎉!
|
third_party/mmyolo/.github/ISSUE_TEMPLATE/5-reimplementation.yml
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: "💥 Reimplementation Questions"
|
2 |
+
description: "Ask about questions during model reimplementation"
|
3 |
+
|
4 |
+
|
5 |
+
body:
|
6 |
+
- type: markdown
|
7 |
+
attributes:
|
8 |
+
value: |
|
9 |
+
If you have already identified the reason, we strongly appreciate you creating a new PR to fix it [here](https://github.com/open-mmlab/mmyolo/pulls)!
|
10 |
+
|
11 |
+
- type: checkboxes
|
12 |
+
attributes:
|
13 |
+
label: Prerequisite
|
14 |
+
description: Please check the following items before creating a new issue.
|
15 |
+
options:
|
16 |
+
- label: I have searched [the existing and past issues](https://github.com/open-mmlab/mmyolo/issues) but cannot get the expected help.
|
17 |
+
required: true
|
18 |
+
- label: I have read the [FAQ documentation](https://mmyolo.readthedocs.io/en/latest/faq.html) but cannot get the expected help.
|
19 |
+
required: true
|
20 |
+
- label: The bug has not been fixed in the [latest version](https://github.com/open-mmlab/mmyolo).
|
21 |
+
required: true
|
22 |
+
validations:
|
23 |
+
required: true
|
24 |
+
|
25 |
+
- type: textarea
|
26 |
+
attributes:
|
27 |
+
label: 💬 Describe the reimplementation questions
|
28 |
+
description: |
|
29 |
+
A clear and concise description of what the problem you meet and what have you done.
|
30 |
+
There are several common situations in the reimplementation issues as below
|
31 |
+
|
32 |
+
1. Reimplement a model in the model zoo using the provided configs
|
33 |
+
2. Reimplement a model in the model zoo on other dataset (e.g., custom datasets)
|
34 |
+
3. Reimplement a custom model but all the components are implemented in MMDetection
|
35 |
+
4. Reimplement a custom model with new modules implemented by yourself
|
36 |
+
|
37 |
+
There are several things to do for different cases as below.
|
38 |
+
|
39 |
+
- For case 1 & 3, please follow the steps in the following sections thus we could help to quick identify the issue.
|
40 |
+
- For case 2 & 4, please understand that we are not able to do much help here because we usually do not know the full code and the users should be responsible to the code they write.
|
41 |
+
- One suggestion for case 2 & 4 is that the users should first check whether the bug lies in the self-implemented code or the original code. For example, users can first make sure that the same model runs well on supported datasets. If you still need help, please describe what you have done and what you obtain in the issue, and follow the steps in the following sections and try as clear as possible so that we can better help you.
|
42 |
+
placeholder: |
|
43 |
+
A clear and concise description of what the bug is.
|
44 |
+
What config dir you run?
|
45 |
+
|
46 |
+
```none
|
47 |
+
A placeholder for the config.
|
48 |
+
```
|
49 |
+
|
50 |
+
```shell
|
51 |
+
The command or script you run.
|
52 |
+
```
|
53 |
+
|
54 |
+
```
|
55 |
+
The error message or logs you got, with the full traceback.
|
56 |
+
```
|
57 |
+
validations:
|
58 |
+
required: true
|
59 |
+
|
60 |
+
- type: textarea
|
61 |
+
attributes:
|
62 |
+
label: Environment
|
63 |
+
description: |
|
64 |
+
Please run `python mmyolo/utils/collect_env.py` to collect necessary environment information and paste it here.
|
65 |
+
You may add addition that may be helpful for locating the problem, such as
|
66 |
+
- How you installed PyTorch \[e.g., pip, conda, source\]
|
67 |
+
- Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)
|
68 |
+
validations:
|
69 |
+
required: true
|
70 |
+
|
71 |
+
- type: textarea
|
72 |
+
attributes:
|
73 |
+
label: Expected results
|
74 |
+
description: If applicable, paste the related results here, e.g., what you expect and what you get.
|
75 |
+
placeholder: |
|
76 |
+
```none
|
77 |
+
A placeholder for results comparison
|
78 |
+
```
|
79 |
+
|
80 |
+
- type: textarea
|
81 |
+
attributes:
|
82 |
+
label: Additional information
|
83 |
+
description: Tell us anything else you think we should know.
|
84 |
+
placeholder: |
|
85 |
+
1. Did you make any modifications on the code or config? Did you understand what you have modified?
|
86 |
+
2. What dataset did you use?
|
87 |
+
3. What do you think might be the reason?
|
third_party/mmyolo/.github/ISSUE_TEMPLATE/config.yml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
blank_issues_enabled: true
|
2 |
+
|
3 |
+
contact_links:
|
4 |
+
- name: 💬 Forum
|
5 |
+
url: https://github.com/open-mmlab/mmyolo/discussions
|
6 |
+
about: Ask general usage questions and discuss with other MMYOLO community members
|
7 |
+
- name: 🌐 Explore OpenMMLab
|
8 |
+
url: https://openmmlab.com/
|
9 |
+
about: Get know more about OpenMMLab
|
third_party/mmyolo/.github/pull_request_template.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
|
2 |
+
|
3 |
+
## Motivation
|
4 |
+
|
5 |
+
Please describe the motivation for this PR and the goal you want to achieve through this PR.
|
6 |
+
|
7 |
+
## Modification
|
8 |
+
|
9 |
+
Please briefly describe what modification is made in this PR.
|
10 |
+
|
11 |
+
## BC-breaking (Optional)
|
12 |
+
|
13 |
+
Does the modification introduce changes that break the backward compatibility of the downstream repos?
|
14 |
+
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
|
15 |
+
|
16 |
+
## Use cases (Optional)
|
17 |
+
|
18 |
+
If this PR introduces a new feature, it is better to list some use cases here and update the documentation.
|
19 |
+
|
20 |
+
## Checklist
|
21 |
+
|
22 |
+
1. Pre-commit or other linting tools are used to fix potential lint issues.
|
23 |
+
2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
|
24 |
+
3. If the modification has a potential influence on downstream projects, this PR should be tested with downstream projects, like MMDetection or MMClassification.
|
25 |
+
4. The documentation has been modified accordingly, like docstring or example tutorials.
|
third_party/mmyolo/.github/workflows/deploy.yml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: deploy
|
2 |
+
|
3 |
+
on: push
|
4 |
+
|
5 |
+
concurrency:
|
6 |
+
group: ${{ github.workflow }}-${{ github.ref }}
|
7 |
+
cancel-in-progress: true
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
build-n-publish:
|
11 |
+
runs-on: ubuntu-latest
|
12 |
+
if: startsWith(github.event.ref, 'refs/tags')
|
13 |
+
steps:
|
14 |
+
- uses: actions/checkout@v2
|
15 |
+
- name: Set up Python 3.7
|
16 |
+
uses: actions/setup-python@v2
|
17 |
+
with:
|
18 |
+
python-version: 3.7
|
19 |
+
- name: Install torch
|
20 |
+
run: pip install torch
|
21 |
+
- name: Install wheel
|
22 |
+
run: pip install wheel
|
23 |
+
- name: Build MMYOLO
|
24 |
+
run: python setup.py sdist bdist_wheel
|
25 |
+
- name: Publish distribution to PyPI
|
26 |
+
run: |
|
27 |
+
pip install twine
|
28 |
+
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}
|
third_party/mmyolo/.gitignore
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
mmyolo/.mim
|
118 |
+
output/
|
119 |
+
work_dirs
|
120 |
+
yolov5-6.1/
|
121 |
+
|
122 |
+
# Pytorch
|
123 |
+
*.pth
|
124 |
+
*.pt
|
125 |
+
*.py~
|
126 |
+
*.sh~
|
third_party/mmyolo/.pre-commit-config-zh-cn.yaml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
exclude: ^tests/data/
|
2 |
+
repos:
|
3 |
+
- repo: https://gitee.com/openmmlab/mirrors-flake8
|
4 |
+
rev: 5.0.4
|
5 |
+
hooks:
|
6 |
+
- id: flake8
|
7 |
+
- repo: https://gitee.com/openmmlab/mirrors-isort
|
8 |
+
rev: 5.11.5
|
9 |
+
hooks:
|
10 |
+
- id: isort
|
11 |
+
- repo: https://gitee.com/openmmlab/mirrors-yapf
|
12 |
+
rev: v0.32.0
|
13 |
+
hooks:
|
14 |
+
- id: yapf
|
15 |
+
- repo: https://gitee.com/openmmlab/mirrors-pre-commit-hooks
|
16 |
+
rev: v4.3.0
|
17 |
+
hooks:
|
18 |
+
- id: trailing-whitespace
|
19 |
+
- id: check-yaml
|
20 |
+
- id: end-of-file-fixer
|
21 |
+
- id: requirements-txt-fixer
|
22 |
+
- id: double-quote-string-fixer
|
23 |
+
- id: check-merge-conflict
|
24 |
+
- id: fix-encoding-pragma
|
25 |
+
args: ["--remove"]
|
26 |
+
- id: mixed-line-ending
|
27 |
+
args: ["--fix=lf"]
|
28 |
+
- repo: https://gitee.com/openmmlab/mirrors-mdformat
|
29 |
+
rev: 0.7.9
|
30 |
+
hooks:
|
31 |
+
- id: mdformat
|
32 |
+
args: ["--number"]
|
33 |
+
additional_dependencies:
|
34 |
+
- mdformat-openmmlab
|
35 |
+
- mdformat_frontmatter
|
36 |
+
- linkify-it-py
|
37 |
+
- repo: https://gitee.com/openmmlab/mirrors-codespell
|
38 |
+
rev: v2.2.1
|
39 |
+
hooks:
|
40 |
+
- id: codespell
|
41 |
+
- repo: https://gitee.com/openmmlab/mirrors-docformatter
|
42 |
+
rev: v1.3.1
|
43 |
+
hooks:
|
44 |
+
- id: docformatter
|
45 |
+
args: ["--in-place", "--wrap-descriptions", "79"]
|
46 |
+
- repo: https://gitee.com/openmmlab/mirrors-pyupgrade
|
47 |
+
rev: v3.0.0
|
48 |
+
hooks:
|
49 |
+
- id: pyupgrade
|
50 |
+
args: ["--py36-plus"]
|
51 |
+
- repo: https://github.com/open-mmlab/pre-commit-hooks
|
52 |
+
rev: v0.2.0
|
53 |
+
hooks:
|
54 |
+
- id: check-copyright
|
55 |
+
args: ["mmyolo", "tests"]
|
56 |
+
# - repo: https://gitee.com/openmmlab/mirrors-mypy
|
57 |
+
# rev: v0.812
|
58 |
+
# hooks:
|
59 |
+
# - id: mypy
|
60 |
+
# exclude: "docs"
|
third_party/mmyolo/.pre-commit-config.yaml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
exclude: ^tests/data/
|
2 |
+
repos:
|
3 |
+
- repo: https://github.com/PyCQA/flake8
|
4 |
+
rev: 5.0.4
|
5 |
+
hooks:
|
6 |
+
- id: flake8
|
7 |
+
- repo: https://github.com/PyCQA/isort
|
8 |
+
rev: 5.11.5
|
9 |
+
hooks:
|
10 |
+
- id: isort
|
11 |
+
- repo: https://github.com/pre-commit/mirrors-yapf
|
12 |
+
rev: v0.32.0
|
13 |
+
hooks:
|
14 |
+
- id: yapf
|
15 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
16 |
+
rev: v4.3.0
|
17 |
+
hooks:
|
18 |
+
- id: trailing-whitespace
|
19 |
+
- id: check-yaml
|
20 |
+
- id: end-of-file-fixer
|
21 |
+
- id: requirements-txt-fixer
|
22 |
+
- id: double-quote-string-fixer
|
23 |
+
- id: check-merge-conflict
|
24 |
+
- id: fix-encoding-pragma
|
25 |
+
args: ["--remove"]
|
26 |
+
- id: mixed-line-ending
|
27 |
+
args: ["--fix=lf"]
|
28 |
+
- repo: https://github.com/executablebooks/mdformat
|
29 |
+
rev: 0.7.9
|
30 |
+
hooks:
|
31 |
+
- id: mdformat
|
32 |
+
args: ["--number"]
|
33 |
+
additional_dependencies:
|
34 |
+
- mdformat-openmmlab
|
35 |
+
- mdformat_frontmatter
|
36 |
+
- linkify-it-py
|
37 |
+
- repo: https://github.com/codespell-project/codespell
|
38 |
+
rev: v2.2.1
|
39 |
+
hooks:
|
40 |
+
- id: codespell
|
41 |
+
- repo: https://github.com/myint/docformatter
|
42 |
+
rev: v1.3.1
|
43 |
+
hooks:
|
44 |
+
- id: docformatter
|
45 |
+
args: ["--in-place", "--wrap-descriptions", "79"]
|
46 |
+
- repo: https://github.com/asottile/pyupgrade
|
47 |
+
rev: v3.0.0
|
48 |
+
hooks:
|
49 |
+
- id: pyupgrade
|
50 |
+
args: ["--py36-plus"]
|
51 |
+
- repo: https://github.com/open-mmlab/pre-commit-hooks
|
52 |
+
rev: v0.2.0
|
53 |
+
hooks:
|
54 |
+
- id: check-copyright
|
55 |
+
args: ["mmyolo", "tests"]
|
56 |
+
# - repo: https://github.com/pre-commit/mirrors-mypy
|
57 |
+
# rev: v0.812
|
58 |
+
# hooks:
|
59 |
+
# - id: mypy
|
60 |
+
# exclude: "docs"
|
third_party/mmyolo/.readthedocs.yml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: 2
|
2 |
+
|
3 |
+
formats: all
|
4 |
+
|
5 |
+
python:
|
6 |
+
version: 3.7
|
7 |
+
install:
|
8 |
+
- requirements: requirements/docs.txt
|
third_party/mmyolo/LICENSE
ADDED
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
635 |
+
Copyright (C) <year> <name of author>
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU General Public License
|
648 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If the program does terminal interaction, make it output a short
|
653 |
+
notice like this when it starts in an interactive mode:
|
654 |
+
|
655 |
+
<program> Copyright (C) <year> <name of author>
|
656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
+
This is free software, and you are welcome to redistribute it
|
658 |
+
under certain conditions; type `show c' for details.
|
659 |
+
|
660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
+
parts of the General Public License. Of course, your program's commands
|
662 |
+
might be different; for a GUI interface, you would use an "about box".
|
663 |
+
|
664 |
+
You should also get your employer (if you work as a programmer) or school,
|
665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
+
<https://www.gnu.org/licenses/>.
|
668 |
+
|
669 |
+
The GNU General Public License does not permit incorporating your program
|
670 |
+
into proprietary programs. If your program is a subroutine library, you
|
671 |
+
may consider it more useful to permit linking proprietary applications with
|
672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
+
Public License instead of this License. But first, please read
|
674 |
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
third_party/mmyolo/MANIFEST.in
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
include requirements/*.txt
|
2 |
+
include mmyolo/VERSION
|
3 |
+
include mmyolo/.mim/model-index.yml
|
4 |
+
include mmyolo/.mim/demo/*/*
|
5 |
+
recursive-include mmyolo/.mim/configs *.py *.yml
|
6 |
+
recursive-include mmyolo/.mim/tools *.sh *.py
|
third_party/mmyolo/README.md
ADDED
@@ -0,0 +1,428 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div align="center">
|
2 |
+
<img width="100%" src="https://user-images.githubusercontent.com/27466624/222385101-516e551c-49f5-480d-a135-4b24ee6dc308.png"/>
|
3 |
+
<div> </div>
|
4 |
+
<div align="center">
|
5 |
+
<b><font size="5">OpenMMLab website</font></b>
|
6 |
+
<sup>
|
7 |
+
<a href="https://openmmlab.com">
|
8 |
+
<i><font size="4">HOT</font></i>
|
9 |
+
</a>
|
10 |
+
</sup>
|
11 |
+
|
12 |
+
<b><font size="5">OpenMMLab platform</font></b>
|
13 |
+
<sup>
|
14 |
+
<a href="https://platform.openmmlab.com">
|
15 |
+
<i><font size="4">TRY IT OUT</font></i>
|
16 |
+
</a>
|
17 |
+
</sup>
|
18 |
+
</div>
|
19 |
+
<div> </div>
|
20 |
+
|
21 |
+
[![PyPI](https://img.shields.io/pypi/v/mmyolo)](https://pypi.org/project/mmyolo)
|
22 |
+
[![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmyolo.readthedocs.io/en/latest/)
|
23 |
+
[![deploy](https://github.com/open-mmlab/mmyolo/workflows/deploy/badge.svg)](https://github.com/open-mmlab/mmyolo/actions)
|
24 |
+
[![codecov](https://codecov.io/gh/open-mmlab/mmyolo/branch/main/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmyolo)
|
25 |
+
[![license](https://img.shields.io/github/license/open-mmlab/mmyolo.svg)](https://github.com/open-mmlab/mmyolo/blob/main/LICENSE)
|
26 |
+
[![open issues](https://isitmaintained.com/badge/open/open-mmlab/mmyolo.svg)](https://github.com/open-mmlab/mmyolo/issues)
|
27 |
+
[![issue resolution](https://isitmaintained.com/badge/resolution/open-mmlab/mmyolo.svg)](https://github.com/open-mmlab/mmyolo/issues)
|
28 |
+
|
29 |
+
[📘Documentation](https://mmyolo.readthedocs.io/en/latest/) |
|
30 |
+
[🛠️Installation](https://mmyolo.readthedocs.io/en/latest/get_started/installation.html) |
|
31 |
+
[👀Model Zoo](https://mmyolo.readthedocs.io/en/latest/model_zoo.html) |
|
32 |
+
[🆕Update News](https://mmyolo.readthedocs.io/en/latest/notes/changelog.html) |
|
33 |
+
[🤔Reporting Issues](https://github.com/open-mmlab/mmyolo/issues/new/choose)
|
34 |
+
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div align="center">
|
38 |
+
|
39 |
+
English | [简体中文](README_zh-CN.md)
|
40 |
+
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div align="center">
|
44 |
+
<a href="https://openmmlab.medium.com/" style="text-decoration:none;">
|
45 |
+
<img src="https://user-images.githubusercontent.com/25839884/219255827-67c1a27f-f8c5-46a9-811d-5e57448c61d1.png" width="3%" alt="" /></a>
|
46 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
47 |
+
<a href="https://discord.com/channels/1037617289144569886/1046608014234370059" style="text-decoration:none;">
|
48 |
+
<img src="https://user-images.githubusercontent.com/25839884/218347213-c080267f-cbb6-443e-8532-8e1ed9a58ea9.png" width="3%" alt="" /></a>
|
49 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
50 |
+
<a href="https://twitter.com/OpenMMLab" style="text-decoration:none;">
|
51 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346637-d30c8a0f-3eba-4699-8131-512fb06d46db.png" width="3%" alt="" /></a>
|
52 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
53 |
+
<a href="https://www.youtube.com/openmmlab" style="text-decoration:none;">
|
54 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346691-ceb2116a-465a-40af-8424-9f30d2348ca9.png" width="3%" alt="" /></a>
|
55 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
56 |
+
<a href="https://space.bilibili.com/1293512903" style="text-decoration:none;">
|
57 |
+
<img src="https://user-images.githubusercontent.com/25839884/219026751-d7d14cce-a7c9-4e82-9942-8375fca65b99.png" width="3%" alt="" /></a>
|
58 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
59 |
+
<a href="https://www.zhihu.com/people/openmmlab" style="text-decoration:none;">
|
60 |
+
<img src="https://user-images.githubusercontent.com/25839884/219026120-ba71e48b-6e94-4bd4-b4e9-b7d175b5e362.png" width="3%" alt="" /></a>
|
61 |
+
</div>
|
62 |
+
|
63 |
+
## 📄 Table of Contents
|
64 |
+
|
65 |
+
- [🥳 🚀 What's New](#--whats-new-)
|
66 |
+
- [✨ Highlight](#-highlight-)
|
67 |
+
- [📖 Introduction](#-introduction-)
|
68 |
+
- [🛠️ Installation](#%EF%B8%8F-installation-)
|
69 |
+
- [👨🏫 Tutorial](#-tutorial-)
|
70 |
+
- [📊 Overview of Benchmark and Model Zoo](#-overview-of-benchmark-and-model-zoo-)
|
71 |
+
- [❓ FAQ](#-faq-)
|
72 |
+
- [🙌 Contributing](#-contributing-)
|
73 |
+
- [🤝 Acknowledgement](#-acknowledgement-)
|
74 |
+
- [🖊️ Citation](#️-citation-)
|
75 |
+
- [🎫 License](#-license-)
|
76 |
+
- [🏗️ Projects in OpenMMLab](#%EF%B8%8F-projects-in-openmmlab-)
|
77 |
+
|
78 |
+
## 🥳 🚀 What's New [🔝](#-table-of-contents)
|
79 |
+
|
80 |
+
💎 **v0.6.0** was released on 15/8/2023:
|
81 |
+
|
82 |
+
- Support YOLOv5 instance segmentation
|
83 |
+
- Support YOLOX-Pose based on MMPose
|
84 |
+
- Add 15 minutes instance segmentation tutorial.
|
85 |
+
- YOLOv5 supports using mask annotation to optimize bbox
|
86 |
+
- Add Multi-scale training and testing docs
|
87 |
+
|
88 |
+
For release history and update details, please refer to [changelog](https://mmyolo.readthedocs.io/en/latest/notes/changelog.html).
|
89 |
+
|
90 |
+
### ✨ Highlight [🔝](#-table-of-contents)
|
91 |
+
|
92 |
+
We are excited to announce our latest work on real-time object recognition tasks, **RTMDet**, a family of fully convolutional single-stage detectors. RTMDet not only achieves the best parameter-accuracy trade-off on object detection from tiny to extra-large model sizes but also obtains new state-of-the-art performance on instance segmentation and rotated object detection tasks. Details can be found in the [technical report](https://arxiv.org/abs/2212.07784). Pre-trained models are [here](configs/rtmdet).
|
93 |
+
|
94 |
+
[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/rtmdet-an-empirical-study-of-designing-real/real-time-instance-segmentation-on-mscoco)](https://paperswithcode.com/sota/real-time-instance-segmentation-on-mscoco?p=rtmdet-an-empirical-study-of-designing-real)
|
95 |
+
[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/rtmdet-an-empirical-study-of-designing-real/object-detection-in-aerial-images-on-dota-1)](https://paperswithcode.com/sota/object-detection-in-aerial-images-on-dota-1?p=rtmdet-an-empirical-study-of-designing-real)
|
96 |
+
[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/rtmdet-an-empirical-study-of-designing-real/object-detection-in-aerial-images-on-hrsc2016)](https://paperswithcode.com/sota/object-detection-in-aerial-images-on-hrsc2016?p=rtmdet-an-empirical-study-of-designing-real)
|
97 |
+
|
98 |
+
| Task | Dataset | AP | FPS(TRT FP16 BS1 3090) |
|
99 |
+
| ------------------------ | ------- | ------------------------------------ | ---------------------- |
|
100 |
+
| Object Detection | COCO | 52.8 | 322 |
|
101 |
+
| Instance Segmentation | COCO | 44.6 | 188 |
|
102 |
+
| Rotated Object Detection | DOTA | 78.9(single-scale)/81.3(multi-scale) | 121 |
|
103 |
+
|
104 |
+
<div align=center>
|
105 |
+
<img src="https://user-images.githubusercontent.com/12907710/208044554-1e8de6b5-48d8-44e4-a7b5-75076c7ebb71.png"/>
|
106 |
+
</div>
|
107 |
+
|
108 |
+
MMYOLO currently implements the object detection and rotated object detection algorithm, but it has a significant training acceleration compared to the MMDeteciton version. The training speed is 2.6 times faster than the previous version.
|
109 |
+
|
110 |
+
## 📖 Introduction [🔝](#-table-of-contents)
|
111 |
+
|
112 |
+
MMYOLO is an open source toolbox for YOLO series algorithms based on PyTorch and [MMDetection](https://github.com/open-mmlab/mmdetection). It is a part of the [OpenMMLab](https://openmmlab.com/) project.
|
113 |
+
|
114 |
+
The master branch works with **PyTorch 1.6+**.
|
115 |
+
<img src="https://user-images.githubusercontent.com/45811724/190993591-bd3f1f11-1c30-4b93-b5f4-05c9ff64ff7f.gif"/>
|
116 |
+
|
117 |
+
<details open>
|
118 |
+
<summary>Major features</summary>
|
119 |
+
|
120 |
+
- 🕹️ **Unified and convenient benchmark**
|
121 |
+
|
122 |
+
MMYOLO unifies the implementation of modules in various YOLO algorithms and provides a unified benchmark. Users can compare and analyze in a fair and convenient way.
|
123 |
+
|
124 |
+
- 📚 **Rich and detailed documentation**
|
125 |
+
|
126 |
+
MMYOLO provides rich documentation for getting started, model deployment, advanced usages, and algorithm analysis, making it easy for users at different levels to get started and make extensions quickly.
|
127 |
+
|
128 |
+
- 🧩 **Modular Design**
|
129 |
+
|
130 |
+
MMYOLO decomposes the framework into different components where users can easily customize a model by combining different modules with various training and testing strategies.
|
131 |
+
|
132 |
+
<img src="https://user-images.githubusercontent.com/27466624/199999337-0544a4cb-3cbd-4f3e-be26-bcd9e74db7ff.jpg" alt="BaseModule-P5"/>
|
133 |
+
The figure above is contributed by RangeKing@GitHub, thank you very much!
|
134 |
+
|
135 |
+
And the figure of P6 model is in [model_design.md](docs/en/recommended_topics/model_design.md).
|
136 |
+
|
137 |
+
</details>
|
138 |
+
|
139 |
+
## 🛠️ Installation [🔝](#-table-of-contents)
|
140 |
+
|
141 |
+
MMYOLO relies on PyTorch, MMCV, MMEngine, and MMDetection. Below are quick steps for installation. Please refer to the [Install Guide](docs/en/get_started/installation.md) for more detailed instructions.
|
142 |
+
|
143 |
+
```shell
|
144 |
+
conda create -n mmyolo python=3.8 pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.3 -c pytorch -y
|
145 |
+
conda activate mmyolo
|
146 |
+
pip install openmim
|
147 |
+
mim install "mmengine>=0.6.0"
|
148 |
+
mim install "mmcv>=2.0.0rc4,<2.1.0"
|
149 |
+
mim install "mmdet>=3.0.0,<4.0.0"
|
150 |
+
git clone https://github.com/open-mmlab/mmyolo.git
|
151 |
+
cd mmyolo
|
152 |
+
# Install albumentations
|
153 |
+
pip install -r requirements/albu.txt
|
154 |
+
# Install MMYOLO
|
155 |
+
mim install -v -e .
|
156 |
+
```
|
157 |
+
|
158 |
+
## 👨🏫 Tutorial [🔝](#-table-of-contents)
|
159 |
+
|
160 |
+
MMYOLO is based on MMDetection and adopts the same code structure and design approach. To get better use of this, please read [MMDetection Overview](https://mmdetection.readthedocs.io/en/latest/get_started.html) for the first understanding of MMDetection.
|
161 |
+
|
162 |
+
The usage of MMYOLO is almost identical to MMDetection and all tutorials are straightforward to use, you can also learn about [MMDetection User Guide and Advanced Guide](https://mmdetection.readthedocs.io/en/3.x/).
|
163 |
+
|
164 |
+
For different parts from MMDetection, we have also prepared user guides and advanced guides, please read our [documentation](https://mmyolo.readthedocs.io/zenh_CN/latest/).
|
165 |
+
|
166 |
+
<details>
|
167 |
+
<summary>Get Started</summary>
|
168 |
+
|
169 |
+
- [Overview](docs/en/get_started/overview.md)
|
170 |
+
- [Dependencies](docs/en/get_started/dependencies.md)
|
171 |
+
- [Installation](docs/en/get_started/installation.md)
|
172 |
+
- [15 minutes object detection](docs/en/get_started/15_minutes_object_detection.md)
|
173 |
+
- [15 minutes rotated object detection](docs/en/get_started/15_minutes_rotated_object_detection.md)
|
174 |
+
- [15 minutes instance segmentation](docs/en/get_started/15_minutes_instance_segmentation.md)
|
175 |
+
- [Resources summary](docs/en/get_started/article.md)
|
176 |
+
|
177 |
+
</details>
|
178 |
+
|
179 |
+
<details>
|
180 |
+
<summary>Recommended Topics</summary>
|
181 |
+
|
182 |
+
- [How to contribute code to MMYOLO](docs/en/recommended_topics/contributing.md)
|
183 |
+
- [Training testing tricks](docs/en/recommended_topics/training_testing_tricks.md)
|
184 |
+
- [MMYOLO model design](docs/en/recommended_topics/model_design.md)
|
185 |
+
- [Algorithm principles and implementation](docs/en/recommended_topics/algorithm_descriptions/)
|
186 |
+
- [Replace the backbone network](docs/en/recommended_topics/replace_backbone.md)
|
187 |
+
- [MMYOLO model complexity analysis](docs/en/recommended_topics/complexity_analysis.md)
|
188 |
+
- [Annotation-to-deployment workflow for custom dataset](docs/en/recommended_topics/labeling_to_deployment_tutorials.md)
|
189 |
+
- [Visualization](docs/en/recommended_topics/visualization.md)
|
190 |
+
- [Model deployment](docs/en/recommended_topics/deploy/)
|
191 |
+
- [Troubleshooting steps](docs/en/recommended_topics/troubleshooting_steps.md)
|
192 |
+
- [MMYOLO application examples](docs/en/recommended_topics/application_examples/)
|
193 |
+
- [MM series repo essential basics](docs/en/recommended_topics/mm_basics.md)
|
194 |
+
- [Dataset preparation and description](docs/en/recommended_topics/dataset_preparation.md)
|
195 |
+
|
196 |
+
</details>
|
197 |
+
|
198 |
+
<details>
|
199 |
+
<summary>Common Usage</summary>
|
200 |
+
|
201 |
+
- [Resume training](docs/en/common_usage/resume_training.md)
|
202 |
+
- [Enabling and disabling SyncBatchNorm](docs/en/common_usage/syncbn.md)
|
203 |
+
- [Enabling AMP](docs/en/common_usage/amp_training.md)
|
204 |
+
- [Multi-scale training and testing](docs/en/common_usage/ms_training_testing.md)
|
205 |
+
- [TTA Related Notes](docs/en/common_usage/tta.md)
|
206 |
+
- [Add plugins to the backbone network](docs/en/common_usage/plugins.md)
|
207 |
+
- [Freeze layers](docs/en/common_usage/freeze_layers.md)
|
208 |
+
- [Output model predictions](docs/en/common_usage/output_predictions.md)
|
209 |
+
- [Set random seed](docs/en/common_usage/set_random_seed.md)
|
210 |
+
- [Module combination](docs/en/common_usage/module_combination.md)
|
211 |
+
- [Cross-library calls using mim](docs/en/common_usage/mim_usage.md)
|
212 |
+
- [Apply multiple Necks](docs/en/common_usage/multi_necks.md)
|
213 |
+
- [Specify specific device training or inference](docs/en/common_usage/specify_device.md)
|
214 |
+
- [Single and multi-channel application examples](docs/en/common_usage/single_multi_channel_applications.md)
|
215 |
+
|
216 |
+
</details>
|
217 |
+
|
218 |
+
<details>
|
219 |
+
<summary>Useful Tools</summary>
|
220 |
+
|
221 |
+
- [Browse coco json](docs/en/useful_tools/browse_coco_json.md)
|
222 |
+
- [Browse dataset](docs/en/useful_tools/browse_dataset.md)
|
223 |
+
- [Print config](docs/en/useful_tools/print_config.md)
|
224 |
+
- [Dataset analysis](docs/en/useful_tools/dataset_analysis.md)
|
225 |
+
- [Optimize anchors](docs/en/useful_tools/optimize_anchors.md)
|
226 |
+
- [Extract subcoco](docs/en/useful_tools/extract_subcoco.md)
|
227 |
+
- [Visualization scheduler](docs/en/useful_tools/vis_scheduler.md)
|
228 |
+
- [Dataset converters](docs/en/useful_tools/dataset_converters.md)
|
229 |
+
- [Download dataset](docs/en/useful_tools/download_dataset.md)
|
230 |
+
- [Log analysis](docs/en/useful_tools/log_analysis.md)
|
231 |
+
- [Model converters](docs/en/useful_tools/model_converters.md)
|
232 |
+
|
233 |
+
</details>
|
234 |
+
|
235 |
+
<details>
|
236 |
+
<summary>Basic Tutorials</summary>
|
237 |
+
|
238 |
+
- [Learn about configs with YOLOv5](docs/en/tutorials/config.md)
|
239 |
+
- [Data flow](docs/en/tutorials/data_flow.md)
|
240 |
+
- [Rotated detection](docs/en/tutorials/rotated_detection.md)
|
241 |
+
- [Custom Installation](docs/en/tutorials/custom_installation.md)
|
242 |
+
- [Common Warning Notes](docs/zh_cn/tutorials/warning_notes.md)
|
243 |
+
- [FAQ](docs/en/tutorials/faq.md)
|
244 |
+
|
245 |
+
</details>
|
246 |
+
|
247 |
+
<details>
|
248 |
+
<summary>Advanced Tutorials</summary>
|
249 |
+
|
250 |
+
- [MMYOLO cross-library application](docs/en/advanced_guides/cross-library_application.md)
|
251 |
+
|
252 |
+
</details>
|
253 |
+
|
254 |
+
<details>
|
255 |
+
<summary>Descriptions</summary>
|
256 |
+
|
257 |
+
- [Changelog](docs/en/notes/changelog.md)
|
258 |
+
- [Compatibility](docs/en/notes/compatibility.md)
|
259 |
+
- [Conventions](docs/en/notes/conventions.md)
|
260 |
+
- [Code Style](docs/en/notes/code_style.md)
|
261 |
+
|
262 |
+
</details>
|
263 |
+
|
264 |
+
## 📊 Overview of Benchmark and Model Zoo [🔝](#-table-of-contents)
|
265 |
+
|
266 |
+
<div align=center>
|
267 |
+
<img src="https://user-images.githubusercontent.com/17425982/222087414-168175cc-dae6-4c5c-a8e3-3109a152dd19.png"/>
|
268 |
+
</div>
|
269 |
+
|
270 |
+
Results and models are available in the [model zoo](docs/en/model_zoo.md).
|
271 |
+
|
272 |
+
<details open>
|
273 |
+
<summary><b>Supported Tasks</b></summary>
|
274 |
+
|
275 |
+
- [x] Object detection
|
276 |
+
- [x] Rotated object detection
|
277 |
+
|
278 |
+
</details>
|
279 |
+
|
280 |
+
<details open>
|
281 |
+
<summary><b>Supported Algorithms</b></summary>
|
282 |
+
|
283 |
+
- [x] [YOLOv5](configs/yolov5)
|
284 |
+
- [ ] [YOLOv5u](configs/yolov5/yolov5u) (Inference only)
|
285 |
+
- [x] [YOLOX](configs/yolox)
|
286 |
+
- [x] [RTMDet](configs/rtmdet)
|
287 |
+
- [x] [RTMDet-Rotated](configs/rtmdet)
|
288 |
+
- [x] [YOLOv6](configs/yolov6)
|
289 |
+
- [x] [YOLOv7](configs/yolov7)
|
290 |
+
- [x] [PPYOLOE](configs/ppyoloe)
|
291 |
+
- [x] [YOLOv8](configs/yolov8)
|
292 |
+
|
293 |
+
</details>
|
294 |
+
|
295 |
+
<details open>
|
296 |
+
<summary><b>Supported Datasets</b></summary>
|
297 |
+
|
298 |
+
- [x] COCO Dataset
|
299 |
+
- [x] VOC Dataset
|
300 |
+
- [x] CrowdHuman Dataset
|
301 |
+
- [x] DOTA 1.0 Dataset
|
302 |
+
|
303 |
+
</details>
|
304 |
+
|
305 |
+
<details open>
|
306 |
+
<div align="center">
|
307 |
+
<b>Module Components</b>
|
308 |
+
</div>
|
309 |
+
<table align="center">
|
310 |
+
<tbody>
|
311 |
+
<tr align="center" valign="bottom">
|
312 |
+
<td>
|
313 |
+
<b>Backbones</b>
|
314 |
+
</td>
|
315 |
+
<td>
|
316 |
+
<b>Necks</b>
|
317 |
+
</td>
|
318 |
+
<td>
|
319 |
+
<b>Loss</b>
|
320 |
+
</td>
|
321 |
+
<td>
|
322 |
+
<b>Common</b>
|
323 |
+
</td>
|
324 |
+
</tr>
|
325 |
+
<tr valign="top">
|
326 |
+
<td>
|
327 |
+
<ul>
|
328 |
+
<li>YOLOv5CSPDarknet</li>
|
329 |
+
<li>YOLOv8CSPDarknet</li>
|
330 |
+
<li>YOLOXCSPDarknet</li>
|
331 |
+
<li>EfficientRep</li>
|
332 |
+
<li>CSPNeXt</li>
|
333 |
+
<li>YOLOv7Backbone</li>
|
334 |
+
<li>PPYOLOECSPResNet</li>
|
335 |
+
<li>mmdet backbone</li>
|
336 |
+
<li>mmcls backbone</li>
|
337 |
+
<li>timm</li>
|
338 |
+
</ul>
|
339 |
+
</td>
|
340 |
+
<td>
|
341 |
+
<ul>
|
342 |
+
<li>YOLOv5PAFPN</li>
|
343 |
+
<li>YOLOv8PAFPN</li>
|
344 |
+
<li>YOLOv6RepPAFPN</li>
|
345 |
+
<li>YOLOXPAFPN</li>
|
346 |
+
<li>CSPNeXtPAFPN</li>
|
347 |
+
<li>YOLOv7PAFPN</li>
|
348 |
+
<li>PPYOLOECSPPAFPN</li>
|
349 |
+
</ul>
|
350 |
+
</td>
|
351 |
+
<td>
|
352 |
+
<ul>
|
353 |
+
<li>IoULoss</li>
|
354 |
+
<li>mmdet loss</li>
|
355 |
+
</ul>
|
356 |
+
</td>
|
357 |
+
<td>
|
358 |
+
<ul>
|
359 |
+
</ul>
|
360 |
+
</td>
|
361 |
+
</tr>
|
362 |
+
</td>
|
363 |
+
</tr>
|
364 |
+
</tbody>
|
365 |
+
</table>
|
366 |
+
|
367 |
+
</details>
|
368 |
+
|
369 |
+
## ❓ FAQ [🔝](#-table-of-contents)
|
370 |
+
|
371 |
+
Please refer to the [FAQ](docs/en/tutorials/faq.md) for frequently asked questions.
|
372 |
+
|
373 |
+
## 🙌 Contributing [🔝](#-table-of-contents)
|
374 |
+
|
375 |
+
We appreciate all contributions to improving MMYOLO. Ongoing projects can be found in our [GitHub Projects](https://github.com/open-mmlab/mmyolo/projects). Welcome community users to participate in these projects. Please refer to [CONTRIBUTING.md](.github/CONTRIBUTING.md) for the contributing guideline.
|
376 |
+
|
377 |
+
## 🤝 Acknowledgement [🔝](#-table-of-contents)
|
378 |
+
|
379 |
+
MMYOLO is an open source project that is contributed by researchers and engineers from various colleges and companies. We appreciate all the contributors who implement their methods or add new features, as well as users who give valuable feedback.
|
380 |
+
We wish that the toolbox and benchmark could serve the growing research community by providing a flexible toolkit to re-implement existing methods and develop their own new detectors.
|
381 |
+
|
382 |
+
<div align="center">
|
383 |
+
<a href="https://github.com/open-mmlab/mmyolo/graphs/contributors"><img src="https://contrib.rocks/image?repo=open-mmlab/mmyolo"/></a>
|
384 |
+
</div>
|
385 |
+
|
386 |
+
## 🖊️ Citation [🔝](#-table-of-contents)
|
387 |
+
|
388 |
+
If you find this project useful in your research, please consider citing:
|
389 |
+
|
390 |
+
```latex
|
391 |
+
@misc{mmyolo2022,
|
392 |
+
title={{MMYOLO: OpenMMLab YOLO} series toolbox and benchmark},
|
393 |
+
author={MMYOLO Contributors},
|
394 |
+
howpublished = {\url{https://github.com/open-mmlab/mmyolo}},
|
395 |
+
year={2022}
|
396 |
+
}
|
397 |
+
```
|
398 |
+
|
399 |
+
## 🎫 License [🔝](#-table-of-contents)
|
400 |
+
|
401 |
+
This project is released under the [GPL 3.0 license](LICENSE).
|
402 |
+
|
403 |
+
## 🏗️ Projects in OpenMMLab [🔝](#-table-of-contents)
|
404 |
+
|
405 |
+
- [MMEngine](https://github.com/open-mmlab/mmengine): OpenMMLab foundational library for training deep learning models.
|
406 |
+
- [MMCV](https://github.com/open-mmlab/mmcv): OpenMMLab foundational library for computer vision.
|
407 |
+
- [MMPreTrain](https://github.com/open-mmlab/mmpretrain): OpenMMLab pre-training toolbox and benchmark.
|
408 |
+
- [MMagic](https://github.com/open-mmlab/mmagic): Open**MM**Lab **A**dvanced, **G**enerative and **I**ntelligent **C**reation toolbox.
|
409 |
+
- [MMDetection](https://github.com/open-mmlab/mmdetection): OpenMMLab detection toolbox and benchmark.
|
410 |
+
- [MMDetection3D](https://github.com/open-mmlab/mmdetection3d): OpenMMLab's next-generation platform for general 3D object detection.
|
411 |
+
- [MMRotate](https://github.com/open-mmlab/mmrotate): OpenMMLab rotated object detection toolbox and benchmark.
|
412 |
+
- [MMYOLO](https://github.com/open-mmlab/mmyolo): OpenMMLab YOLO series toolbox and benchmark.
|
413 |
+
- [MMSegmentation](https://github.com/open-mmlab/mmsegmentation): OpenMMLab semantic segmentation toolbox and benchmark.
|
414 |
+
- [MMOCR](https://github.com/open-mmlab/mmocr): OpenMMLab text detection, recognition, and understanding toolbox.
|
415 |
+
- [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab pose estimation toolbox and benchmark.
|
416 |
+
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 3D human parametric model toolbox and benchmark.
|
417 |
+
- [MMSelfSup](https://github.com/open-mmlab/mmselfsup): OpenMMLab self-supervised learning toolbox and benchmark.
|
418 |
+
- [MMRazor](https://github.com/open-mmlab/mmrazor): OpenMMLab model compression toolbox and benchmark.
|
419 |
+
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab fewshot learning toolbox and benchmark.
|
420 |
+
- [MMAction2](https://github.com/open-mmlab/mmaction2): OpenMMLab's next-generation action understanding toolbox and benchmark.
|
421 |
+
- [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab video perception toolbox and benchmark.
|
422 |
+
- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab optical flow toolbox and benchmark.
|
423 |
+
- [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab image and video editing toolbox.
|
424 |
+
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab image and video generative models toolbox.
|
425 |
+
- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab model deployment framework.
|
426 |
+
- [MIM](https://github.com/open-mmlab/mim): MIM installs OpenMMLab packages.
|
427 |
+
- [MMEval](https://github.com/open-mmlab/mmeval): OpenMMLab machine learning evaluation library.
|
428 |
+
- [Playground](https://github.com/open-mmlab/playground): A central hub for gathering and showcasing amazing projects built upon OpenMMLab.
|
third_party/mmyolo/README_zh-CN.md
ADDED
@@ -0,0 +1,468 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div align="center">
|
2 |
+
<img src="https://user-images.githubusercontent.com/27466624/222385182-1247251c-8fac-4e77-94f5-57580e0ce3bd.png" width="100%"/>
|
3 |
+
<div> </div>
|
4 |
+
<div align="center">
|
5 |
+
<b><font size="5">OpenMMLab 官网</font></b>
|
6 |
+
<sup>
|
7 |
+
<a href="https://openmmlab.com">
|
8 |
+
<i><font size="4">HOT</font></i>
|
9 |
+
</a>
|
10 |
+
</sup>
|
11 |
+
|
12 |
+
<b><font size="5">OpenMMLab 开放平台</font></b>
|
13 |
+
<sup>
|
14 |
+
<a href="https://platform.openmmlab.com">
|
15 |
+
<i><font size="4">TRY IT OUT</font></i>
|
16 |
+
</a>
|
17 |
+
</sup>
|
18 |
+
</div>
|
19 |
+
<div> </div>
|
20 |
+
|
21 |
+
[![PyPI](https://img.shields.io/pypi/v/mmyolo)](https://pypi.org/project/mmyolo)
|
22 |
+
[![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmyolo.readthedocs.io/zh_CN/latest/)
|
23 |
+
[![deploy](https://github.com/open-mmlab/mmyolo/workflows/deploy/badge.svg)](https://github.com/open-mmlab/mmyolo/actions)
|
24 |
+
[![codecov](https://codecov.io/gh/open-mmlab/mmyolo/branch/main/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmyolo)
|
25 |
+
[![license](https://img.shields.io/github/license/open-mmlab/mmyolo.svg)](https://github.com/open-mmlab/mmyolo/blob/main/LICENSE)
|
26 |
+
[![open issues](https://isitmaintained.com/badge/open/open-mmlab/mmyolo.svg)](https://github.com/open-mmlab/mmyolo/issues)
|
27 |
+
[![issue resolution](https://isitmaintained.com/badge/resolution/open-mmlab/mmyolo.svg)](https://github.com/open-mmlab/mmyolo/issues)
|
28 |
+
|
29 |
+
[📘使用文档](https://mmyolo.readthedocs.io/zh_CN/latest/) |
|
30 |
+
[🛠️安装教程](https://mmyolo.readthedocs.io/zh_CN/latest/get_started/installation.html) |
|
31 |
+
[👀模型库](https://mmyolo.readthedocs.io/zh_CN/latest/model_zoo.html) |
|
32 |
+
[🆕更新日志](https://mmyolo.readthedocs.io/zh_CN/latest/notes/changelog.html) |
|
33 |
+
[🤔报告问题](https://github.com/open-mmlab/mmyolo/issues/new/choose)
|
34 |
+
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div align="center">
|
38 |
+
|
39 |
+
[English](README.md) | 简体中文
|
40 |
+
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div align="center">
|
44 |
+
<a href="https://openmmlab.medium.com/" style="text-decoration:none;">
|
45 |
+
<img src="https://user-images.githubusercontent.com/25839884/219255827-67c1a27f-f8c5-46a9-811d-5e57448c61d1.png" width="3%" alt="" /></a>
|
46 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
47 |
+
<a href="https://discord.com/channels/1037617289144569886/1046608014234370059" style="text-decoration:none;">
|
48 |
+
<img src="https://user-images.githubusercontent.com/25839884/218347213-c080267f-cbb6-443e-8532-8e1ed9a58ea9.png" width="3%" alt="" /></a>
|
49 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
50 |
+
<a href="https://twitter.com/OpenMMLab" style="text-decoration:none;">
|
51 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346637-d30c8a0f-3eba-4699-8131-512fb06d46db.png" width="3%" alt="" /></a>
|
52 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
53 |
+
<a href="https://www.youtube.com/openmmlab" style="text-decoration:none;">
|
54 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346691-ceb2116a-465a-40af-8424-9f30d2348ca9.png" width="3%" alt="" /></a>
|
55 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
56 |
+
<a href="https://space.bilibili.com/1293512903" style="text-decoration:none;">
|
57 |
+
<img src="https://user-images.githubusercontent.com/25839884/219026751-d7d14cce-a7c9-4e82-9942-8375fca65b99.png" width="3%" alt="" /></a>
|
58 |
+
<img src="https://user-images.githubusercontent.com/25839884/218346358-56cc8e2f-a2b8-487f-9088-32480cceabcf.png" width="3%" alt="" />
|
59 |
+
<a href="https://www.zhihu.com/people/openmmlab" style="text-decoration:none;">
|
60 |
+
<img src="https://user-images.githubusercontent.com/25839884/219026120-ba71e48b-6e94-4bd4-b4e9-b7d175b5e362.png" width="3%" alt="" /></a>
|
61 |
+
</div>
|
62 |
+
|
63 |
+
## 📄 Table of Contents
|
64 |
+
|
65 |
+
- [🥳 🚀 最新进展](#--最新进展-)
|
66 |
+
- [✨ 亮点](#-亮点-)
|
67 |
+
- [📖 简介](#-简介-)
|
68 |
+
- [🛠️ 安装](#️%EF%B8%8F-安装-)
|
69 |
+
- [👨🏫 教程](#-教程-)
|
70 |
+
- [📊 基准测试和模型库](#-基准测试和模型库-)
|
71 |
+
- [❓ 常见问题](#-常见问题-)
|
72 |
+
- [🙌 贡献指南](#-贡献指南-)
|
73 |
+
- [🤝 致谢](#🤝-致谢-)
|
74 |
+
- [🖊️ 引用](#️-引用-)
|
75 |
+
- [🎫 开源许可证](#-开源许可证-)
|
76 |
+
- [🏗️ OpenMMLab 的其他项目](#%EF%B8%8F-openmmlab-的其他项目-)
|
77 |
+
- [❤️ 欢迎加入 OpenMMLab 社区](#%EF%B8%8F-欢迎加入-openmmlab-社区-)
|
78 |
+
|
79 |
+
## 🥳 🚀 最新进展 [🔝](#-table-of-contents)
|
80 |
+
|
81 |
+
💎 **v0.6.0** 版本已经在 2023.8.15 发布:
|
82 |
+
|
83 |
+
- 支持 YOLOv5 实例分割
|
84 |
+
- 基于 MMPose 支持 YOLOX-Pose
|
85 |
+
- 添加 15 分钟的实例分割教程
|
86 |
+
- YOLOv5 支持使用 mask 标注来优化边界框
|
87 |
+
- 添加多尺度训练和测试文档
|
88 |
+
|
89 |
+
我们提供了实用的**脚本命令速查表**
|
90 |
+
|
91 |
+
<div align=center>
|
92 |
+
<img src="https://user-images.githubusercontent.com/27466624/213104312-3580c783-2423-442f-b5f6-79204a06adb5.png">
|
93 |
+
</div>
|
94 |
+
|
95 |
+
你可以点击[链接](https://pan.baidu.com/s/1QEaqT7YayUdEvh1an0gjHg?pwd=yolo),下载高清版 PDF 文件。
|
96 |
+
|
97 |
+
同时我们也推出了解读视频:
|
98 |
+
|
99 |
+
| | 内容 | 视频 | 课程中的代码 |
|
100 |
+
| :-: | :--------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
101 |
+
| 🌟 | 特征图可视化 | [![Link](https://i2.hdslb.com/bfs/archive/480a0eb41fce26e0acb65f82a74501418eee1032.jpg@112w_63h_1c.webp)](https://www.bilibili.com/video/BV188411s7o8) [![bilibili](https://img.shields.io/badge/dynamic/json?label=views&style=social&logo=bilibili&query=data.stat.view&url=https%3A%2F%2Fapi.bilibili.com%2Fx%2Fweb-interface%2Fview%3Fbvid%3DBV188411s7o8)](https://www.bilibili.com/video/BV188411s7o8) | [特征图可视化.ipynb](https://github.com/open-mmlab/OpenMMLabCourse/blob/main/codes/MMYOLO_tutorials/%5B%E5%B7%A5%E5%85%B7%E7%B1%BB%E7%AC%AC%E4%B8%80%E6%9C%9F%5D%E7%89%B9%E5%BE%81%E5%9B%BE%E5%8F%AF%E8%A7%86%E5%8C%96.ipynb) |
|
102 |
+
| 🌟 | 源码阅读和调试「必备」技巧 | [![Link](https://i2.hdslb.com/bfs/archive/790d2422c879ff20488910da1c4422b667ea6af7.jpg@112w_63h_1c.webp)](https://www.bilibili.com/video/BV1N14y1V7mB) [![bilibili](https://img.shields.io/badge/dynamic/json?label=views&style=social&logo=bilibili&query=data.stat.view&url=https%3A%2F%2Fapi.bilibili.com%2Fx%2Fweb-interface%2Fview%3Fbvid%3DBV1N14y1V7mB)](https://www.bilibili.com/video/BV1N14y1V7mB) | [源码阅读和调试「必备」技巧文档](https://zhuanlan.zhihu.com/p/580885852) |
|
103 |
+
| 🌟 | 10分钟换遍主干网络 | [![Link](http://i0.hdslb.com/bfs/archive/c51f1aef7c605856777249a7b4478f44bd69f3bd.jpg@112w_63h_1c.webp)](https://www.bilibili.com/video/BV1JG4y1d7GC) [![bilibili](https://img.shields.io/badge/dynamic/json?label=views&style=social&logo=bilibili&query=data.stat.view&url=https%3A%2F%2Fapi.bilibili.com%2Fx%2Fweb-interface%2Fview%3Fbvid%3DBV1JG4y1d7GC)](https://www.bilibili.com/video/BV1JG4y1d7GC) | [10分钟换遍主干网络文档](https://zhuanlan.zhihu.com/p/585641598)<br>[10分钟换遍主干网络.ipynb](https://github.com/open-mmlab/OpenMMLabCourse/blob/main/codes/MMYOLO_tutorials/[实用类第二期]10分钟换遍主干网络.ipynb) |
|
104 |
+
| 🌟 | 自定义数据集从标注到部署保姆级教程 | [![Link](https://i2.hdslb.com/bfs/archive/13f566c89a18c9c881713b63ec14da952d4c0b14.jpg@112w_63h_1c.webp)](https://www.bilibili.com/video/BV1RG4y137i5) [![bilibili](https://img.shields.io/badge/dynamic/json?label=views&style=social&logo=bilibili&query=data.stat.view&url=https%3A%2F%2Fapi.bilibili.com%2Fx%2Fweb-interface%2Fview%3Fbvid%3DBV1RG4y137i5)](https://www.bilibili.com/video/BV1JG4y1d7GC) | [自定义数据集从标注到部署保姆级教程](https://github.com/open-mmlab/mmyolo/blob/dev/docs/zh_cn/user_guides/custom_dataset.md) |
|
105 |
+
| 🌟 | 顶会第一步 · 模块自定义 | [![Link](http://i2.hdslb.com/bfs/archive/5b23d41ac57466824eaf185ef806ef734414e93b.jpg@112w_63h_1c.webp)](https://www.bilibili.com/video/BV1yd4y1j7VD) [![bilibili](https://img.shields.io/badge/dynamic/json?label=views&style=social&logo=bilibili&query=data.stat.view&url=https%3A%2F%2Fapi.bilibili.com%2Fx%2Fweb-interface%2Fview%3Fbvid%3DBV1yd4y1j7VD)](https://www.bilibili.com/video/BV1yd4y1j7VD) | [顶会第一步·模块自定义.ipynb](https://github.com/open-mmlab/OpenMMLabCourse/blob/main/codes/MMYOLO_tutorials/[实用类第四期]顶会第一步·模块自定义.ipynb) |
|
106 |
+
|
107 |
+
完整视频列表请参考 [中文解��资源汇总 - 视频](https://mmyolo.readthedocs.io/zh_CN/latest/get_started/article.html)
|
108 |
+
|
109 |
+
发布历史和更新细节请参考 [更新日志](https://mmyolo.readthedocs.io/zh_CN/latest/notes/changelog.html)
|
110 |
+
|
111 |
+
### ✨ 亮点 [🔝](#-table-of-contents)
|
112 |
+
|
113 |
+
我们很高兴向大家介绍我们在实时目标识别任务方面的最新成果 RTMDet,包含了一系列的全卷积单阶段检测模型。 RTMDet 不仅在从 tiny 到 extra-large 尺寸的目标检测模型上实现了最佳的参数量和精度的平衡,而且在实时实例分割和旋转目标检测任务上取得了最先进的成果。 更多细节请参阅[技术报告](https://arxiv.org/abs/2212.07784)。 预训练模型可以在[这里](configs/rtmdet)找到。
|
114 |
+
|
115 |
+
[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/rtmdet-an-empirical-study-of-designing-real/real-time-instance-segmentation-on-mscoco)](https://paperswithcode.com/sota/real-time-instance-segmentation-on-mscoco?p=rtmdet-an-empirical-study-of-designing-real)
|
116 |
+
[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/rtmdet-an-empirical-study-of-designing-real/object-detection-in-aerial-images-on-dota-1)](https://paperswithcode.com/sota/object-detection-in-aerial-images-on-dota-1?p=rtmdet-an-empirical-study-of-designing-real)
|
117 |
+
[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/rtmdet-an-empirical-study-of-designing-real/object-detection-in-aerial-images-on-hrsc2016)](https://paperswithcode.com/sota/object-detection-in-aerial-images-on-hrsc2016?p=rtmdet-an-empirical-study-of-designing-real)
|
118 |
+
|
119 |
+
| Task | Dataset | AP | FPS(TRT FP16 BS1 3090) |
|
120 |
+
| ------------------------ | ------- | ------------------------------------ | ---------------------- |
|
121 |
+
| Object Detection | COCO | 52.8 | 322 |
|
122 |
+
| Instance Segmentation | COCO | 44.6 | 188 |
|
123 |
+
| Rotated Object Detection | DOTA | 78.9(single-scale)/81.3(multi-scale) | 121 |
|
124 |
+
|
125 |
+
<div align=center>
|
126 |
+
<img src="https://user-images.githubusercontent.com/12907710/208044554-1e8de6b5-48d8-44e4-a7b5-75076c7ebb71.png"/>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
MMYOLO 中目前实现了目标检测和旋转框目标检测算法,但是相比 MMDeteciton 版本有显著训练加速,训练速度相比原先版本提升 2.6 倍。
|
130 |
+
|
131 |
+
## 📖 简介 [🔝](#-table-of-contents)
|
132 |
+
|
133 |
+
MMYOLO 是一个基于 PyTorch 和 MMDetection 的 YOLO 系列算法开源工具箱。它是 [OpenMMLab](https://openmmlab.com/) 项目的一部分。
|
134 |
+
|
135 |
+
主分支代码目前支持 PyTorch 1.6 以上的版本。
|
136 |
+
<img src="https://user-images.githubusercontent.com/45811724/190993591-bd3f1f11-1c30-4b93-b5f4-05c9ff64ff7f.gif"/>
|
137 |
+
|
138 |
+
<details open>
|
139 |
+
<summary>主要特性</summary>
|
140 |
+
|
141 |
+
- 🕹️ **统一便捷的算法评测**
|
142 |
+
|
143 |
+
MMYOLO 统一了各类 YOLO 算法模块的实现, 并提供了统一的评测流程,用户可以公平便捷地进行对比分析。
|
144 |
+
|
145 |
+
- 📚 **丰富的入门和进阶文档**
|
146 |
+
|
147 |
+
MMYOLO 提供了从入门到部署到进阶和算法解析等一系列文档,方便不同用户快速上手和扩展。
|
148 |
+
|
149 |
+
- 🧩 **模块化设计**
|
150 |
+
|
151 |
+
MMYOLO 将框架解耦成不同的模块组件,通过组合不同的模块和训练测试策略,用户可以便捷地构建自定义模型。
|
152 |
+
|
153 |
+
<img src="https://user-images.githubusercontent.com/27466624/199999337-0544a4cb-3cbd-4f3e-be26-bcd9e74db7ff.jpg" alt="基类-P5"/>
|
154 |
+
图为 RangeKing@GitHub 提供,非常感谢!
|
155 |
+
|
156 |
+
P6 模型图详见 [model_design.md](docs/zh_cn/recommended_topics/model_design.md)。
|
157 |
+
|
158 |
+
</details>
|
159 |
+
|
160 |
+
## 🛠️ 安装 [🔝](#-table-of-contents)
|
161 |
+
|
162 |
+
MMYOLO 依赖 PyTorch, MMCV, MMEngine 和 MMDetection,以下是安装的简要步骤。 更详细的安装指南请参考[安装文档](docs/zh_cn/get_started/installation.md)。
|
163 |
+
|
164 |
+
```shell
|
165 |
+
conda create -n mmyolo python=3.8 pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.3 -c pytorch -y
|
166 |
+
conda activate mmyolo
|
167 |
+
pip install openmim
|
168 |
+
mim install "mmengine>=0.6.0"
|
169 |
+
mim install "mmcv>=2.0.0rc4,<2.1.0"
|
170 |
+
mim install "mmdet>=3.0.0,<4.0.0"
|
171 |
+
git clone https://github.com/open-mmlab/mmyolo.git
|
172 |
+
cd mmyolo
|
173 |
+
# Install albumentations
|
174 |
+
pip install -r requirements/albu.txt
|
175 |
+
# Install MMYOLO
|
176 |
+
mim install -v -e .
|
177 |
+
```
|
178 |
+
|
179 |
+
## 👨🏫 教程 [🔝](#-table-of-contents)
|
180 |
+
|
181 |
+
MMYOLO 基于 MMDetection 开源库,并且采用相同的代码组织和设计方式。为了更好的使用本开源库,请先阅读 [MMDetection 概述](https://mmdetection.readthedocs.io/zh_CN/latest/get_started.html) 对 MMDetection 进行初步地了解。
|
182 |
+
|
183 |
+
MMYOLO 用法和 MMDetection 几乎一致,所有教程都是通用的,你也可以了解 [MMDetection 用户指南和进阶指南](https://mmdetection.readthedocs.io/zh_CN/3.x/) 。
|
184 |
+
|
185 |
+
针对和 MMDetection 不同的部分,我们也准备了用户指南和进阶指南,请阅读我们的 [文档](https://mmyolo.readthedocs.io/zh_CN/latest/) 。
|
186 |
+
|
187 |
+
<details>
|
188 |
+
<summary>开启 MMYOLO ���旅</summary>
|
189 |
+
|
190 |
+
- [概述](docs/zh_cn/get_started/overview.md)
|
191 |
+
- [依赖](docs/zh_cn/get_started/dependencies.md)
|
192 |
+
- [安装和验证](docs/zh_cn/get_started/installation.md)
|
193 |
+
- [15 分钟上手 MMYOLO 目标检测](docs/zh_cn/get_started/15_minutes_object_detection.md)
|
194 |
+
- [15 分钟上手 MMYOLO 旋转框目标检测](docs/zh_cn/get_started/15_minutes_rotated_object_detection.md)
|
195 |
+
- [15 分钟上手 MMYOLO 实例分割](docs/zh_cn/get_started/15_minutes_instance_segmentation.md)
|
196 |
+
- [中文解读资源汇总](docs/zh_cn/get_started/article.md)
|
197 |
+
|
198 |
+
</details>
|
199 |
+
|
200 |
+
<details>
|
201 |
+
<summary>推荐专题</summary>
|
202 |
+
|
203 |
+
- [如何给 MMYOLO 贡献代码](docs/zh_cn/recommended_topics/contributing.md)
|
204 |
+
- [训练和测试技巧](docs/zh_cn/recommended_topics/training_testing_tricks.md)
|
205 |
+
- [MMYOLO 模型结构设计](docs/zh_cn/recommended_topics/model_design.md)
|
206 |
+
- [原理和实现全解析](docs/zh_cn/recommended_topics/algorithm_descriptions/)
|
207 |
+
- [轻松更换主干网络](docs/zh_cn/recommended_topics/replace_backbone.md)
|
208 |
+
- [MMYOLO 模型复杂度分析](docs/zh_cn/recommended_topics/complexity_analysis.md)
|
209 |
+
- [标注+训练+测试+部署全流程](docs/zh_cn/recommended_topics/labeling_to_deployment_tutorials.md)
|
210 |
+
- [关于可视化的一切](docs/zh_cn/recommended_topics/visualization.md)
|
211 |
+
- [模型部署流程](docs/zh_cn/recommended_topics/deploy/)
|
212 |
+
- [常见错误排查步骤](docs/zh_cn/recommended_topics/troubleshooting_steps.md)
|
213 |
+
- [MMYOLO 应用范例介绍](docs/zh_cn/recommended_topics/application_examples/)
|
214 |
+
- [MM 系列 Repo 必备基础](docs/zh_cn/recommended_topics/mm_basics.md)
|
215 |
+
- [数据集准备和说明](docs/zh_cn/recommended_topics/dataset_preparation.md)
|
216 |
+
|
217 |
+
</details>
|
218 |
+
|
219 |
+
<details>
|
220 |
+
<summary>常用功能</summary>
|
221 |
+
|
222 |
+
- [恢复训练](docs/zh_cn/common_usage/resume_training.md)
|
223 |
+
- [开启和关闭 SyncBatchNorm](docs/zh_cn/common_usage/syncbn.md)
|
224 |
+
- [开启混合精度训练](docs/zh_cn/common_usage/amp_training.md)
|
225 |
+
- [多尺度训练和测试](docs/zh_cn/common_usage/ms_training_testing.md)
|
226 |
+
- [测试时增强相关说明](docs/zh_cn/common_usage/tta.md)
|
227 |
+
- [给主干网络增加插件](docs/zh_cn/common_usage/plugins.md)
|
228 |
+
- [冻结指定网络层权重](docs/zh_cn/common_usage/freeze_layers.md)
|
229 |
+
- [输出模型预测结果](docs/zh_cn/common_usage/output_predictions.md)
|
230 |
+
- [设置随机种子](docs/zh_cn/common_usage/set_random_seed.md)
|
231 |
+
- [算法组合替换教程](docs/zh_cn/common_usage/module_combination.md)
|
232 |
+
- [使用 mim 跨库调用其他 OpenMMLab 仓库的脚本](docs/zh_cn/common_usage/mim_usage.md)
|
233 |
+
- [应用多个 Neck](docs/zh_cn/common_usage/multi_necks.md)
|
234 |
+
- [指定特定设备训练或推理](docs/zh_cn/common_usage/specify_device.md)
|
235 |
+
- [单通道和多通道应用案例](docs/zh_cn/common_usage/single_multi_channel_applications.md)
|
236 |
+
- [MM 系列开源库注册表](docs/zh_cn/common_usage/registries_info.md)
|
237 |
+
|
238 |
+
</details>
|
239 |
+
|
240 |
+
<details>
|
241 |
+
<summary>实用工具</summary>
|
242 |
+
|
243 |
+
- [可视化 COCO 标签](docs/zh_cn/useful_tools/browse_coco_json.md)
|
244 |
+
- [可视化数据集](docs/zh_cn/useful_tools/browse_dataset.md)
|
245 |
+
- [打印完整配置文件](docs/zh_cn/useful_tools/print_config.md)
|
246 |
+
- [可视化数据集分析结果](docs/zh_cn/useful_tools/dataset_analysis.md)
|
247 |
+
- [优化锚框尺寸](docs/zh_cn/useful_tools/optimize_anchors.md)
|
248 |
+
- [提取 COCO 子集](docs/zh_cn/useful_tools/extract_subcoco.md)
|
249 |
+
- [可视化优化器参数策略](docs/zh_cn/useful_tools/vis_scheduler.md)
|
250 |
+
- [数据集转换](docs/zh_cn/useful_tools/dataset_converters.md)
|
251 |
+
- [数据集下载](docs/zh_cn/useful_tools/download_dataset.md)
|
252 |
+
- [日志分析](docs/zh_cn/useful_tools/log_analysis.md)
|
253 |
+
- [模型转换](docs/zh_cn/useful_tools/model_converters.md)
|
254 |
+
|
255 |
+
</details>
|
256 |
+
|
257 |
+
<details>
|
258 |
+
<summary>基础教程</summary>
|
259 |
+
|
260 |
+
- [学习 YOLOv5 配置文件](docs/zh_cn/tutorials/config.md)
|
261 |
+
- [数据流](docs/zh_cn/tutorials/data_flow.md)
|
262 |
+
- [旋转目标检测](docs/zh_cn/tutorials/rotated_detection.md)
|
263 |
+
- [自定义安装](docs/zh_cn/tutorials/custom_installation.md)
|
264 |
+
- [常见警告说明](docs/zh_cn/tutorials/warning_notes.md)
|
265 |
+
- [常见问题](docs/zh_cn/tutorials/faq.md)
|
266 |
+
|
267 |
+
</details>
|
268 |
+
|
269 |
+
<details>
|
270 |
+
<summary>进阶教程</summary>
|
271 |
+
|
272 |
+
- [MMYOLO 跨库应用解析](docs/zh_cn/advanced_guides/cross-library_application.md)
|
273 |
+
|
274 |
+
</details>
|
275 |
+
|
276 |
+
<details>
|
277 |
+
<summary>说明</summary>
|
278 |
+
|
279 |
+
- [更新日志](docs/zh_cn/notes/changelog.md)
|
280 |
+
- [兼容性说明](docs/zh_cn/notes/compatibility.md)
|
281 |
+
- [默认约定](docs/zh_cn/notes/conventions.md)
|
282 |
+
- [代码规范](docs/zh_cn/notes/code_style.md)
|
283 |
+
|
284 |
+
</details>
|
285 |
+
|
286 |
+
## 📊 基准测试和模型库 [🔝](#-table-of-contents)
|
287 |
+
|
288 |
+
<div align=center>
|
289 |
+
<img src="https://user-images.githubusercontent.com/17425982/222087414-168175cc-dae6-4c5c-a8e3-3109a152dd19.png"/>
|
290 |
+
</div>
|
291 |
+
|
292 |
+
测试结果和模型可以在 [模型库](docs/zh_cn/model_zoo.md) 中找到。
|
293 |
+
|
294 |
+
<details open>
|
295 |
+
<summary><b>支持的任务</b></summary>
|
296 |
+
|
297 |
+
- [x] 目标检测
|
298 |
+
- [x] 旋转框目标检测
|
299 |
+
|
300 |
+
</details>
|
301 |
+
|
302 |
+
<details open>
|
303 |
+
<summary><b>支持的算法</b></summary>
|
304 |
+
|
305 |
+
- [x] [YOLOv5](configs/yolov5)
|
306 |
+
- [ ] [YOLOv5u](configs/yolov5/yolov5u) (��推理)
|
307 |
+
- [x] [YOLOX](configs/yolox)
|
308 |
+
- [x] [RTMDet](configs/rtmdet)
|
309 |
+
- [x] [RTMDet-Rotated](configs/rtmdet)
|
310 |
+
- [x] [YOLOv6](configs/yolov6)
|
311 |
+
- [x] [YOLOv7](configs/yolov7)
|
312 |
+
- [x] [PPYOLOE](configs/ppyoloe)
|
313 |
+
- [x] [YOLOv8](configs/yolov8)
|
314 |
+
|
315 |
+
</details>
|
316 |
+
|
317 |
+
<details open>
|
318 |
+
<summary><b>支持的数据集</b></summary>
|
319 |
+
|
320 |
+
- [x] COCO Dataset
|
321 |
+
- [x] VOC Dataset
|
322 |
+
- [x] CrowdHuman Dataset
|
323 |
+
- [x] DOTA 1.0 Dataset
|
324 |
+
|
325 |
+
</details>
|
326 |
+
|
327 |
+
<details open>
|
328 |
+
<div align="center">
|
329 |
+
<b>模块组件</b>
|
330 |
+
</div>
|
331 |
+
<table align="center">
|
332 |
+
<tbody>
|
333 |
+
<tr align="center" valign="bottom">
|
334 |
+
<td>
|
335 |
+
<b>Backbones</b>
|
336 |
+
</td>
|
337 |
+
<td>
|
338 |
+
<b>Necks</b>
|
339 |
+
</td>
|
340 |
+
<td>
|
341 |
+
<b>Loss</b>
|
342 |
+
</td>
|
343 |
+
<td>
|
344 |
+
<b>Common</b>
|
345 |
+
</td>
|
346 |
+
</tr>
|
347 |
+
<tr valign="top">
|
348 |
+
<td>
|
349 |
+
<ul>
|
350 |
+
<li>YOLOv5CSPDarknet</li>
|
351 |
+
<li>YOLOv8CSPDarknet</li>
|
352 |
+
<li>YOLOXCSPDarknet</li>
|
353 |
+
<li>EfficientRep</li>
|
354 |
+
<li>CSPNeXt</li>
|
355 |
+
<li>YOLOv7Backbone</li>
|
356 |
+
<li>PPYOLOECSPResNet</li>
|
357 |
+
<li>mmdet backbone</li>
|
358 |
+
<li>mmcls backbone</li>
|
359 |
+
<li>timm</li>
|
360 |
+
</ul>
|
361 |
+
</td>
|
362 |
+
<td>
|
363 |
+
<ul>
|
364 |
+
<li>YOLOv5PAFPN</li>
|
365 |
+
<li>YOLOv8PAFPN</li>
|
366 |
+
<li>YOLOv6RepPAFPN</li>
|
367 |
+
<li>YOLOXPAFPN</li>
|
368 |
+
<li>CSPNeXtPAFPN</li>
|
369 |
+
<li>YOLOv7PAFPN</li>
|
370 |
+
<li>PPYOLOECSPPAFPN</li>
|
371 |
+
</ul>
|
372 |
+
</td>
|
373 |
+
<td>
|
374 |
+
<ul>
|
375 |
+
<li>IoULoss</li>
|
376 |
+
<li>mmdet loss</li>
|
377 |
+
</ul>
|
378 |
+
</td>
|
379 |
+
<td>
|
380 |
+
<ul>
|
381 |
+
</ul>
|
382 |
+
</td>
|
383 |
+
</tr>
|
384 |
+
</td>
|
385 |
+
</tr>
|
386 |
+
</tbody>
|
387 |
+
</table>
|
388 |
+
|
389 |
+
</details>
|
390 |
+
|
391 |
+
## ❓ 常见问题 [🔝](#-table-of-contents)
|
392 |
+
|
393 |
+
请参考 [FAQ](docs/zh_cn/tutorials/faq.md) 了解其他用户的常见问题。
|
394 |
+
|
395 |
+
## 🙌 贡献指南 [🔝](#-table-of-contents)
|
396 |
+
|
397 |
+
我们感谢所有的贡献者为改进和提升 MMYOLO 所作出的努力。我们将正在进行中的项目添加进了[GitHub Projects](https://github.com/open-mmlab/mmyolo/projects)页面,非常欢迎社区用户能参与进这些项目中来。请参考[贡献指南](.github/CONTRIBUTING.md)来了解参与项目贡献的相关指引。
|
398 |
+
|
399 |
+
## 🤝 致谢 [🔝](#-table-of-contents)
|
400 |
+
|
401 |
+
MMYOLO 是一款由来自不同高校和企业的研发人员共同参与贡献的开源项目。我们感谢所有为项目提供算法复现和新功能支持的贡献者,以及提供宝贵反馈的用户。 我们希望这个工具箱和基准测试可以为社区提供灵活的代码工具,供用户复现已有算法并开发自己的新模型,从而不断为开源社区提供贡献。
|
402 |
+
|
403 |
+
<div align="center">
|
404 |
+
<a href="https://github.com/open-mmlab/mmyolo/graphs/contributors"><img src="https://contrib.rocks/image?repo=open-mmlab/mmyolo"/></a>
|
405 |
+
</div>
|
406 |
+
|
407 |
+
## 🖊️ 引用 [🔝](#-table-of-contents)
|
408 |
+
|
409 |
+
如果你觉得本项目对你的研究工作有所帮助,请参考如下 bibtex 引用 MMYOLO
|
410 |
+
|
411 |
+
```latex
|
412 |
+
@misc{mmyolo2022,
|
413 |
+
title={{MMYOLO: OpenMMLab YOLO} series toolbox and benchmark},
|
414 |
+
author={MMYOLO Contributors},
|
415 |
+
howpublished = {\url{https://github.com/open-mmlab/mmyolo}},
|
416 |
+
year={2022}
|
417 |
+
}
|
418 |
+
```
|
419 |
+
|
420 |
+
## 🎫 开源许可证 [🔝](#-table-of-contents)
|
421 |
+
|
422 |
+
该项目采用 [GPL 3.0 开源许可证](LICENSE)。
|
423 |
+
|
424 |
+
## 🏗️ OpenMMLab 的其他项目 [🔝](#-table-of-contents)
|
425 |
+
|
426 |
+
- [MMEngine](https://github.com/open-mmlab/mmengine): OpenMMLab 深度学习模型训练基础库
|
427 |
+
- [MMCV](https://github.com/open-mmlab/mmcv): OpenMMLab 计算机视觉基础库
|
428 |
+
- [MMPreTrain](https://github.com/open-mmlab/mmpretrain): OpenMMLab 深度学习预训练工具箱
|
429 |
+
- [MMagic](https://github.com/open-mmlab/mmagic): OpenMMLab 新一代人工智能内容生成(AIGC)工具箱
|
430 |
+
- [MMDetection](https://github.com/open-mmlab/mmdetection): OpenMMLab 目标检测工具箱
|
431 |
+
- [MMDetection3D](https://github.com/open-mmlab/mmdetection3d): OpenMMLab 新一代通用 3D 目标检测平台
|
432 |
+
- [MMRotate](https://github.com/open-mmlab/mmrotate): OpenMMLab 旋转框检测工具箱与测试基准
|
433 |
+
- [MMYOLO](https://github.com/open-mmlab/mmyolo): OpenMMLab YOLO 系列工具箱
|
434 |
+
- [MMSegmentation](https://github.com/open-mmlab/mmsegmentation): OpenMMLab 语义分割工具箱
|
435 |
+
- [MMOCR](https://github.com/open-mmlab/mmocr): OpenMMLab 全流程文字检测识别理解工具包
|
436 |
+
- [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab 姿态估计工具箱
|
437 |
+
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 人体参数化模型工具箱与测试基准
|
438 |
+
- [MMSelfSup](https://github.com/open-mmlab/mmselfsup): OpenMMLab 自监督学习工具箱与测试基准
|
439 |
+
- [MMRazor](https://github.com/open-mmlab/mmrazor): OpenMMLab 模型压缩工具箱与测试基准
|
440 |
+
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab 少样本学习工具箱与测试基准
|
441 |
+
- [MMAction2](https://github.com/open-mmlab/mmaction2): OpenMMLab 新一代视频理解工具箱
|
442 |
+
- [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab 一体化视频目标感知平台
|
443 |
+
- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab 光流估计工具箱与测试基准
|
444 |
+
- [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab 图像视频编辑工具箱
|
445 |
+
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab 图片视频生成模型工具箱
|
446 |
+
- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab 模型部署框架
|
447 |
+
- [MIM](https://github.com/open-mmlab/mim): MIM 是 OpenMMlab 项目、算法、模型的统一入口
|
448 |
+
- [MMEval](https://github.com/open-mmlab/mmeval): OpenMMLab 机器学习算法评测库
|
449 |
+
- [Playground](https://github.com/open-mmlab/playground): 收集和展示 OpenMMLab 相关的前沿、有趣的社区项目
|
450 |
+
|
451 |
+
## ❤️ 欢迎加入 OpenMMLab 社区 [🔝](#-table-of-contents)
|
452 |
+
|
453 |
+
扫描下方的二维码可关注 OpenMMLab 团队的 [知乎官方账号](https://www.zhihu.com/people/openmmlab),加入 OpenMMLab 团队的 [官方交流 QQ 群](https://jq.qq.com/?_wv=1027&k=aCvMxdr3)
|
454 |
+
|
455 |
+
<div align="center">
|
456 |
+
<img src="resources/zhihu_qrcode.jpg" height="400" /> <img src="resources/qq_group_qrcode.jpg" height="400" />
|
457 |
+
</div>
|
458 |
+
|
459 |
+
我们会在 OpenMMLab 社区为大家
|
460 |
+
|
461 |
+
- 📢 分享 AI 框架的前沿核心技术
|
462 |
+
- 💻 解读 PyTorch 常用模块源码
|
463 |
+
- 📰 发布 OpenMMLab 的相关新闻
|
464 |
+
- 🚀 介绍 OpenMMLab 开发的前沿算法
|
465 |
+
- 🏃 获取更高效的问题答疑和意见反馈
|
466 |
+
- 🔥 提供与各行各业开发者充分交流的平台
|
467 |
+
|
468 |
+
干货满满 📘,等你来撩 💗,OpenMMLab 社区期待您的加入 👬
|
third_party/mmyolo/configs/_base_/default_runtime.py
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
default_scope = 'mmyolo'
|
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='mmdet.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='mmdet.DetLocalVisualizer',
|
20 |
+
vis_backends=vis_backends,
|
21 |
+
name='visualizer')
|
22 |
+
log_processor = dict(type='LogProcessor', window_size=50, by_epoch=True)
|
23 |
+
|
24 |
+
log_level = 'INFO'
|
25 |
+
load_from = None
|
26 |
+
resume = False
|
27 |
+
|
28 |
+
# Example to use different file client
|
29 |
+
# Method 1: simply set the data root and let the file I/O module
|
30 |
+
# automatically infer from prefix (not support LMDB and Memcache yet)
|
31 |
+
|
32 |
+
# data_root = 's3://openmmlab/datasets/detection/coco/'
|
33 |
+
|
34 |
+
# Method 2: Use `backend_args`, `file_client_args` in versions
|
35 |
+
# before MMDet 3.0.0rc6
|
36 |
+
# backend_args = dict(
|
37 |
+
# backend='petrel',
|
38 |
+
# path_mapping=dict({
|
39 |
+
# './data/': 's3://openmmlab/datasets/detection/',
|
40 |
+
# 'data/': 's3://openmmlab/datasets/detection/'
|
41 |
+
# }))
|
42 |
+
|
43 |
+
backend_args = None
|
third_party/mmyolo/configs/_base_/det_p5_tta.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# TODO: Need to solve the problem of multiple backend_args parameters
|
2 |
+
# _backend_args = dict(
|
3 |
+
# backend='petrel',
|
4 |
+
# path_mapping=dict({
|
5 |
+
# './data/': 's3://openmmlab/datasets/detection/',
|
6 |
+
# 'data/': 's3://openmmlab/datasets/detection/'
|
7 |
+
# }))
|
8 |
+
|
9 |
+
_backend_args = None
|
10 |
+
|
11 |
+
tta_model = dict(
|
12 |
+
type='mmdet.DetTTAModel',
|
13 |
+
tta_cfg=dict(nms=dict(type='nms', iou_threshold=0.65), max_per_img=300))
|
14 |
+
|
15 |
+
img_scales = [(640, 640), (320, 320), (960, 960)]
|
16 |
+
|
17 |
+
# LoadImageFromFile
|
18 |
+
# / | \
|
19 |
+
# (RatioResize,LetterResize) (RatioResize,LetterResize) (RatioResize,LetterResize) # noqa
|
20 |
+
# / \ / \ / \
|
21 |
+
# RandomFlip RandomFlip RandomFlip RandomFlip RandomFlip RandomFlip # noqa
|
22 |
+
# | | | | | |
|
23 |
+
# LoadAnn LoadAnn LoadAnn LoadAnn LoadAnn LoadAnn
|
24 |
+
# | | | | | |
|
25 |
+
# PackDetIn PackDetIn PackDetIn PackDetIn PackDetIn PackDetIn # noqa
|
26 |
+
|
27 |
+
_multiscale_resize_transforms = [
|
28 |
+
dict(
|
29 |
+
type='Compose',
|
30 |
+
transforms=[
|
31 |
+
dict(type='YOLOv5KeepRatioResize', scale=s),
|
32 |
+
dict(
|
33 |
+
type='LetterResize',
|
34 |
+
scale=s,
|
35 |
+
allow_scale_up=False,
|
36 |
+
pad_val=dict(img=114))
|
37 |
+
]) for s in img_scales
|
38 |
+
]
|
39 |
+
|
40 |
+
tta_pipeline = [
|
41 |
+
dict(type='LoadImageFromFile', backend_args=_backend_args),
|
42 |
+
dict(
|
43 |
+
type='TestTimeAug',
|
44 |
+
transforms=[
|
45 |
+
_multiscale_resize_transforms,
|
46 |
+
[
|
47 |
+
dict(type='mmdet.RandomFlip', prob=1.),
|
48 |
+
dict(type='mmdet.RandomFlip', prob=0.)
|
49 |
+
], [dict(type='mmdet.LoadAnnotations', with_bbox=True)],
|
50 |
+
[
|
51 |
+
dict(
|
52 |
+
type='mmdet.PackDetInputs',
|
53 |
+
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
|
54 |
+
'scale_factor', 'pad_param', 'flip',
|
55 |
+
'flip_direction'))
|
56 |
+
]
|
57 |
+
])
|
58 |
+
]
|
third_party/mmyolo/configs/_base_/pose/coco.py
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
dataset_info = dict(
|
2 |
+
dataset_name='coco',
|
3 |
+
paper_info=dict(
|
4 |
+
author='Lin, Tsung-Yi and Maire, Michael and '
|
5 |
+
'Belongie, Serge and Hays, James and '
|
6 |
+
'Perona, Pietro and Ramanan, Deva and '
|
7 |
+
r'Doll{\'a}r, Piotr and Zitnick, C Lawrence',
|
8 |
+
title='Microsoft coco: Common objects in context',
|
9 |
+
container='European conference on computer vision',
|
10 |
+
year='2014',
|
11 |
+
homepage='http://cocodataset.org/',
|
12 |
+
),
|
13 |
+
keypoint_info={
|
14 |
+
0:
|
15 |
+
dict(name='nose', id=0, color=[51, 153, 255], type='upper', swap=''),
|
16 |
+
1:
|
17 |
+
dict(
|
18 |
+
name='left_eye',
|
19 |
+
id=1,
|
20 |
+
color=[51, 153, 255],
|
21 |
+
type='upper',
|
22 |
+
swap='right_eye'),
|
23 |
+
2:
|
24 |
+
dict(
|
25 |
+
name='right_eye',
|
26 |
+
id=2,
|
27 |
+
color=[51, 153, 255],
|
28 |
+
type='upper',
|
29 |
+
swap='left_eye'),
|
30 |
+
3:
|
31 |
+
dict(
|
32 |
+
name='left_ear',
|
33 |
+
id=3,
|
34 |
+
color=[51, 153, 255],
|
35 |
+
type='upper',
|
36 |
+
swap='right_ear'),
|
37 |
+
4:
|
38 |
+
dict(
|
39 |
+
name='right_ear',
|
40 |
+
id=4,
|
41 |
+
color=[51, 153, 255],
|
42 |
+
type='upper',
|
43 |
+
swap='left_ear'),
|
44 |
+
5:
|
45 |
+
dict(
|
46 |
+
name='left_shoulder',
|
47 |
+
id=5,
|
48 |
+
color=[0, 255, 0],
|
49 |
+
type='upper',
|
50 |
+
swap='right_shoulder'),
|
51 |
+
6:
|
52 |
+
dict(
|
53 |
+
name='right_shoulder',
|
54 |
+
id=6,
|
55 |
+
color=[255, 128, 0],
|
56 |
+
type='upper',
|
57 |
+
swap='left_shoulder'),
|
58 |
+
7:
|
59 |
+
dict(
|
60 |
+
name='left_elbow',
|
61 |
+
id=7,
|
62 |
+
color=[0, 255, 0],
|
63 |
+
type='upper',
|
64 |
+
swap='right_elbow'),
|
65 |
+
8:
|
66 |
+
dict(
|
67 |
+
name='right_elbow',
|
68 |
+
id=8,
|
69 |
+
color=[255, 128, 0],
|
70 |
+
type='upper',
|
71 |
+
swap='left_elbow'),
|
72 |
+
9:
|
73 |
+
dict(
|
74 |
+
name='left_wrist',
|
75 |
+
id=9,
|
76 |
+
color=[0, 255, 0],
|
77 |
+
type='upper',
|
78 |
+
swap='right_wrist'),
|
79 |
+
10:
|
80 |
+
dict(
|
81 |
+
name='right_wrist',
|
82 |
+
id=10,
|
83 |
+
color=[255, 128, 0],
|
84 |
+
type='upper',
|
85 |
+
swap='left_wrist'),
|
86 |
+
11:
|
87 |
+
dict(
|
88 |
+
name='left_hip',
|
89 |
+
id=11,
|
90 |
+
color=[0, 255, 0],
|
91 |
+
type='lower',
|
92 |
+
swap='right_hip'),
|
93 |
+
12:
|
94 |
+
dict(
|
95 |
+
name='right_hip',
|
96 |
+
id=12,
|
97 |
+
color=[255, 128, 0],
|
98 |
+
type='lower',
|
99 |
+
swap='left_hip'),
|
100 |
+
13:
|
101 |
+
dict(
|
102 |
+
name='left_knee',
|
103 |
+
id=13,
|
104 |
+
color=[0, 255, 0],
|
105 |
+
type='lower',
|
106 |
+
swap='right_knee'),
|
107 |
+
14:
|
108 |
+
dict(
|
109 |
+
name='right_knee',
|
110 |
+
id=14,
|
111 |
+
color=[255, 128, 0],
|
112 |
+
type='lower',
|
113 |
+
swap='left_knee'),
|
114 |
+
15:
|
115 |
+
dict(
|
116 |
+
name='left_ankle',
|
117 |
+
id=15,
|
118 |
+
color=[0, 255, 0],
|
119 |
+
type='lower',
|
120 |
+
swap='right_ankle'),
|
121 |
+
16:
|
122 |
+
dict(
|
123 |
+
name='right_ankle',
|
124 |
+
id=16,
|
125 |
+
color=[255, 128, 0],
|
126 |
+
type='lower',
|
127 |
+
swap='left_ankle')
|
128 |
+
},
|
129 |
+
skeleton_info={
|
130 |
+
0:
|
131 |
+
dict(link=('left_ankle', 'left_knee'), id=0, color=[0, 255, 0]),
|
132 |
+
1:
|
133 |
+
dict(link=('left_knee', 'left_hip'), id=1, color=[0, 255, 0]),
|
134 |
+
2:
|
135 |
+
dict(link=('right_ankle', 'right_knee'), id=2, color=[255, 128, 0]),
|
136 |
+
3:
|
137 |
+
dict(link=('right_knee', 'right_hip'), id=3, color=[255, 128, 0]),
|
138 |
+
4:
|
139 |
+
dict(link=('left_hip', 'right_hip'), id=4, color=[51, 153, 255]),
|
140 |
+
5:
|
141 |
+
dict(link=('left_shoulder', 'left_hip'), id=5, color=[51, 153, 255]),
|
142 |
+
6:
|
143 |
+
dict(link=('right_shoulder', 'right_hip'), id=6, color=[51, 153, 255]),
|
144 |
+
7:
|
145 |
+
dict(
|
146 |
+
link=('left_shoulder', 'right_shoulder'),
|
147 |
+
id=7,
|
148 |
+
color=[51, 153, 255]),
|
149 |
+
8:
|
150 |
+
dict(link=('left_shoulder', 'left_elbow'), id=8, color=[0, 255, 0]),
|
151 |
+
9:
|
152 |
+
dict(
|
153 |
+
link=('right_shoulder', 'right_elbow'), id=9, color=[255, 128, 0]),
|
154 |
+
10:
|
155 |
+
dict(link=('left_elbow', 'left_wrist'), id=10, color=[0, 255, 0]),
|
156 |
+
11:
|
157 |
+
dict(link=('right_elbow', 'right_wrist'), id=11, color=[255, 128, 0]),
|
158 |
+
12:
|
159 |
+
dict(link=('left_eye', 'right_eye'), id=12, color=[51, 153, 255]),
|
160 |
+
13:
|
161 |
+
dict(link=('nose', 'left_eye'), id=13, color=[51, 153, 255]),
|
162 |
+
14:
|
163 |
+
dict(link=('nose', 'right_eye'), id=14, color=[51, 153, 255]),
|
164 |
+
15:
|
165 |
+
dict(link=('left_eye', 'left_ear'), id=15, color=[51, 153, 255]),
|
166 |
+
16:
|
167 |
+
dict(link=('right_eye', 'right_ear'), id=16, color=[51, 153, 255]),
|
168 |
+
17:
|
169 |
+
dict(link=('left_ear', 'left_shoulder'), id=17, color=[51, 153, 255]),
|
170 |
+
18:
|
171 |
+
dict(
|
172 |
+
link=('right_ear', 'right_shoulder'), id=18, color=[51, 153, 255])
|
173 |
+
},
|
174 |
+
joint_weights=[
|
175 |
+
1., 1., 1., 1., 1., 1., 1., 1.2, 1.2, 1.5, 1.5, 1., 1., 1.2, 1.2, 1.5,
|
176 |
+
1.5
|
177 |
+
],
|
178 |
+
sigmas=[
|
179 |
+
0.026, 0.025, 0.025, 0.035, 0.035, 0.079, 0.079, 0.072, 0.072, 0.062,
|
180 |
+
0.062, 0.107, 0.107, 0.087, 0.087, 0.089, 0.089
|
181 |
+
])
|
third_party/mmyolo/configs/deploy/base_dynamic.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ['./base_static.py']
|
2 |
+
onnx_config = dict(
|
3 |
+
dynamic_axes={
|
4 |
+
'input': {
|
5 |
+
0: 'batch',
|
6 |
+
2: 'height',
|
7 |
+
3: 'width'
|
8 |
+
},
|
9 |
+
'dets': {
|
10 |
+
0: 'batch',
|
11 |
+
1: 'num_dets'
|
12 |
+
},
|
13 |
+
'labels': {
|
14 |
+
0: 'batch',
|
15 |
+
1: 'num_dets'
|
16 |
+
}
|
17 |
+
})
|
third_party/mmyolo/configs/deploy/base_static.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
onnx_config = dict(
|
2 |
+
type='onnx',
|
3 |
+
export_params=True,
|
4 |
+
keep_initializers_as_inputs=False,
|
5 |
+
opset_version=11,
|
6 |
+
save_file='end2end.onnx',
|
7 |
+
input_names=['input'],
|
8 |
+
output_names=['dets', 'labels'],
|
9 |
+
input_shape=None,
|
10 |
+
optimize=True)
|
11 |
+
codebase_config = dict(
|
12 |
+
type='mmyolo',
|
13 |
+
task='ObjectDetection',
|
14 |
+
model_type='end2end',
|
15 |
+
post_processing=dict(
|
16 |
+
score_threshold=0.05,
|
17 |
+
confidence_threshold=0.005,
|
18 |
+
iou_threshold=0.5,
|
19 |
+
max_output_boxes_per_class=200,
|
20 |
+
pre_top_k=5000,
|
21 |
+
keep_top_k=100,
|
22 |
+
background_label_id=-1),
|
23 |
+
module=['mmyolo.deploy'])
|
third_party/mmyolo/configs/deploy/detection_onnxruntime_dynamic.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_base_ = ['./base_dynamic.py']
|
2 |
+
codebase_config = dict(
|
3 |
+
type='mmyolo',
|
4 |
+
task='ObjectDetection',
|
5 |
+
model_type='end2end',
|
6 |
+
post_processing=dict(
|
7 |
+
score_threshold=0.05,
|
8 |
+
confidence_threshold=0.005,
|
9 |
+
iou_threshold=0.5,
|
10 |
+
max_output_boxes_per_class=200,
|
11 |
+
pre_top_k=5000,
|
12 |
+
keep_top_k=100,
|
13 |
+
background_label_id=-1),
|
14 |
+
module=['mmyolo.deploy'])
|
15 |
+
backend_config = dict(type='onnxruntime')
|