LSZTT commited on
Commit
cfcd76a
1 Parent(s): 0404c06

Upload 295 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +222 -0
  2. .gitattributes +50 -35
  3. .github/ISSUE_TEMPLATE/bug-report.yml +85 -0
  4. .github/ISSUE_TEMPLATE/config.yml +11 -0
  5. .github/ISSUE_TEMPLATE/feature-request.yml +50 -0
  6. .github/ISSUE_TEMPLATE/question.yml +33 -0
  7. .github/PULL_REQUEST_TEMPLATE.md +13 -0
  8. .github/dependabot.yml +27 -0
  9. .github/workflows/ci-testing.yml +155 -0
  10. .github/workflows/codeql-analysis.yml +55 -0
  11. .github/workflows/docker.yml +60 -0
  12. .github/workflows/greetings.yml +65 -0
  13. .github/workflows/links.yml +45 -0
  14. .github/workflows/stale.yml +47 -0
  15. .gitignore +257 -0
  16. .idea/.gitignore +3 -0
  17. .idea/.name +1 -0
  18. .idea/inspectionProfiles/Project_Default.xml +60 -0
  19. .idea/inspectionProfiles/profiles_settings.xml +6 -0
  20. .idea/misc.xml +7 -0
  21. .idea/modules.xml +8 -0
  22. .idea/workspace.xml +233 -0
  23. .idea/yolov5-master.iml +12 -0
  24. .pre-commit-config.yaml +73 -0
  25. 00/IMG_0127.png +3 -0
  26. 00/IMG_0197.png +3 -0
  27. 00/IMG_0198.png +3 -0
  28. 00/IMG_0200.png +3 -0
  29. 00/IMG_0224.png +3 -0
  30. 00/IMG_0281.png +3 -0
  31. 00/IMG_0282.png +3 -0
  32. 00/IMG_0300.png +3 -0
  33. 00/IMG_0301.png +3 -0
  34. CITATION.cff +14 -0
  35. CONTRIBUTING.md +93 -0
  36. LICENSE +661 -0
  37. README.md +477 -12
  38. README.zh-CN.md +473 -0
  39. __pycache__/export.cpython-38.pyc +0 -0
  40. __pycache__/hubconf.cpython-38.pyc +0 -0
  41. __pycache__/val.cpython-38.pyc +0 -0
  42. benchmarks.py +174 -0
  43. data/Argoverse.yaml +74 -0
  44. data/GlobalWheat2020.yaml +54 -0
  45. data/ImageNet.yaml +1022 -0
  46. data/Objects365.yaml +438 -0
  47. data/SKU-110K.yaml +53 -0
  48. data/VOC.yaml +100 -0
  49. data/VisDrone.yaml +70 -0
  50. data/coco.yaml +116 -0
.dockerignore ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Repo-specific DockerIgnore -------------------------------------------------------------------------------------------
2
+ .git
3
+ .cache
4
+ .idea
5
+ runs
6
+ output
7
+ coco
8
+ storage.googleapis.com
9
+
10
+ data/samples/*
11
+ **/results*.csv
12
+ *.jpg
13
+
14
+ # Neural Network weights -----------------------------------------------------------------------------------------------
15
+ **/*.pt
16
+ **/*.pth
17
+ **/*.onnx
18
+ **/*.engine
19
+ **/*.mlmodel
20
+ **/*.torchscript
21
+ **/*.torchscript.pt
22
+ **/*.tflite
23
+ **/*.h5
24
+ **/*.pb
25
+ *_saved_model/
26
+ *_web_model/
27
+ *_openvino_model/
28
+
29
+ # Below Copied From .gitignore -----------------------------------------------------------------------------------------
30
+ # Below Copied From .gitignore -----------------------------------------------------------------------------------------
31
+
32
+
33
+ # GitHub Python GitIgnore ----------------------------------------------------------------------------------------------
34
+ # Byte-compiled / optimized / DLL files
35
+ __pycache__/
36
+ *.py[cod]
37
+ *$py.class
38
+
39
+ # C extensions
40
+ *.so
41
+
42
+ # Distribution / packaging
43
+ .Python
44
+ env/
45
+ build/
46
+ develop-eggs/
47
+ dist/
48
+ downloads/
49
+ eggs/
50
+ .eggs/
51
+ lib/
52
+ lib64/
53
+ parts/
54
+ sdist/
55
+ var/
56
+ wheels/
57
+ *.egg-info/
58
+ wandb/
59
+ .installed.cfg
60
+ *.egg
61
+
62
+ # PyInstaller
63
+ # Usually these files are written by a python script from a template
64
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
65
+ *.manifest
66
+ *.spec
67
+
68
+ # Installer logs
69
+ pip-log.txt
70
+ pip-delete-this-directory.txt
71
+
72
+ # Unit test / coverage reports
73
+ htmlcov/
74
+ .tox/
75
+ .coverage
76
+ .coverage.*
77
+ .cache
78
+ nosetests.xml
79
+ coverage.xml
80
+ *.cover
81
+ .hypothesis/
82
+
83
+ # Translations
84
+ *.mo
85
+ *.pot
86
+
87
+ # Django stuff:
88
+ *.log
89
+ local_settings.py
90
+
91
+ # Flask stuff:
92
+ instance/
93
+ .webassets-cache
94
+
95
+ # Scrapy stuff:
96
+ .scrapy
97
+
98
+ # Sphinx documentation
99
+ docs/_build/
100
+
101
+ # PyBuilder
102
+ target/
103
+
104
+ # Jupyter Notebook
105
+ .ipynb_checkpoints
106
+
107
+ # pyenv
108
+ .python-version
109
+
110
+ # celery beat schedule file
111
+ celerybeat-schedule
112
+
113
+ # SageMath parsed files
114
+ *.sage.py
115
+
116
+ # dotenv
117
+ .env
118
+
119
+ # virtualenv
120
+ .venv*
121
+ venv*/
122
+ ENV*/
123
+
124
+ # Spyder project settings
125
+ .spyderproject
126
+ .spyproject
127
+
128
+ # Rope project settings
129
+ .ropeproject
130
+
131
+ # mkdocs documentation
132
+ /site
133
+
134
+ # mypy
135
+ .mypy_cache/
136
+
137
+
138
+ # https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -----------------------------------------------
139
+
140
+ # General
141
+ .DS_Store
142
+ .AppleDouble
143
+ .LSOverride
144
+
145
+ # Icon must end with two \r
146
+ Icon
147
+ Icon?
148
+
149
+ # Thumbnails
150
+ ._*
151
+
152
+ # Files that might appear in the root of a volume
153
+ .DocumentRevisions-V100
154
+ .fseventsd
155
+ .Spotlight-V100
156
+ .TemporaryItems
157
+ .Trashes
158
+ .VolumeIcon.icns
159
+ .com.apple.timemachine.donotpresent
160
+
161
+ # Directories potentially created on remote AFP share
162
+ .AppleDB
163
+ .AppleDesktop
164
+ Network Trash Folder
165
+ Temporary Items
166
+ .apdisk
167
+
168
+
169
+ # https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
170
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
171
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
172
+
173
+ # User-specific stuff:
174
+ .idea/*
175
+ .idea/**/workspace.xml
176
+ .idea/**/tasks.xml
177
+ .idea/dictionaries
178
+ .html # Bokeh Plots
179
+ .pg # TensorFlow Frozen Graphs
180
+ .avi # videos
181
+
182
+ # Sensitive or high-churn files:
183
+ .idea/**/dataSources/
184
+ .idea/**/dataSources.ids
185
+ .idea/**/dataSources.local.xml
186
+ .idea/**/sqlDataSources.xml
187
+ .idea/**/dynamic.xml
188
+ .idea/**/uiDesigner.xml
189
+
190
+ # Gradle:
191
+ .idea/**/gradle.xml
192
+ .idea/**/libraries
193
+
194
+ # CMake
195
+ cmake-build-debug/
196
+ cmake-build-release/
197
+
198
+ # Mongo Explorer plugin:
199
+ .idea/**/mongoSettings.xml
200
+
201
+ ## File-based project format:
202
+ *.iws
203
+
204
+ ## Plugin-specific files:
205
+
206
+ # IntelliJ
207
+ out/
208
+
209
+ # mpeltonen/sbt-idea plugin
210
+ .idea_modules/
211
+
212
+ # JIRA plugin
213
+ atlassian-ide-plugin.xml
214
+
215
+ # Cursive Clojure plugin
216
+ .idea/replstate.xml
217
+
218
+ # Crashlytics plugin (for Android Studio and IntelliJ)
219
+ com_crashlytics_export_strings.xml
220
+ crashlytics.properties
221
+ crashlytics-build.properties
222
+ fabric.properties
.gitattributes CHANGED
@@ -1,35 +1,50 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # this drop notebooks from GitHub language stats
2
+ *.ipynb linguist-vendored
3
+ 00/IMG_0127.png filter=lfs diff=lfs merge=lfs -text
4
+ 00/IMG_0197.png filter=lfs diff=lfs merge=lfs -text
5
+ 00/IMG_0198.png filter=lfs diff=lfs merge=lfs -text
6
+ 00/IMG_0200.png filter=lfs diff=lfs merge=lfs -text
7
+ 00/IMG_0224.png filter=lfs diff=lfs merge=lfs -text
8
+ 00/IMG_0281.png filter=lfs diff=lfs merge=lfs -text
9
+ 00/IMG_0282.png filter=lfs diff=lfs merge=lfs -text
10
+ 00/IMG_0300.png filter=lfs diff=lfs merge=lfs -text
11
+ 00/IMG_0301.png filter=lfs diff=lfs merge=lfs -text
12
+ runs/detect/exp/IMG_0180.jpg filter=lfs diff=lfs merge=lfs -text
13
+ runs/detect/exp/IMG_0183.jpg filter=lfs diff=lfs merge=lfs -text
14
+ runs/detect/exp/IMG_0190.jpg filter=lfs diff=lfs merge=lfs -text
15
+ runs/detect/exp/IMG_0191.jpg filter=lfs diff=lfs merge=lfs -text
16
+ runs/detect/exp/IMG_0197.jpg filter=lfs diff=lfs merge=lfs -text
17
+ runs/detect/exp/IMG_0198.jpg filter=lfs diff=lfs merge=lfs -text
18
+ runs/detect/exp/IMG_0199.jpg filter=lfs diff=lfs merge=lfs -text
19
+ runs/detect/exp/IMG_0200.jpg filter=lfs diff=lfs merge=lfs -text
20
+ runs/detect/exp/IMG_0201.jpg filter=lfs diff=lfs merge=lfs -text
21
+ runs/detect/exp/IMG_0202.jpg filter=lfs diff=lfs merge=lfs -text
22
+ runs/detect/exp/IMG_0208.jpg filter=lfs diff=lfs merge=lfs -text
23
+ runs/detect/exp/IMG_0210.jpg filter=lfs diff=lfs merge=lfs -text
24
+ runs/detect/exp/IMG_0218.jpg filter=lfs diff=lfs merge=lfs -text
25
+ runs/detect/exp/IMG_0219.jpg filter=lfs diff=lfs merge=lfs -text
26
+ runs/detect/exp/IMG_0224.jpg filter=lfs diff=lfs merge=lfs -text
27
+ runs/detect/exp/IMG_0280.jpg filter=lfs diff=lfs merge=lfs -text
28
+ runs/detect/exp/IMG_0281.jpg filter=lfs diff=lfs merge=lfs -text
29
+ runs/detect/exp/IMG_0282.jpg filter=lfs diff=lfs merge=lfs -text
30
+ runs/detect/exp/IMG_0283.jpg filter=lfs diff=lfs merge=lfs -text
31
+ runs/detect/exp/IMG_0291.jpg filter=lfs diff=lfs merge=lfs -text
32
+ runs/detect/exp/IMG_0293.jpg filter=lfs diff=lfs merge=lfs -text
33
+ runs/detect/exp/IMG_0295.jpg filter=lfs diff=lfs merge=lfs -text
34
+ runs/detect/exp/IMG_0298.jpg filter=lfs diff=lfs merge=lfs -text
35
+ runs/detect/exp/IMG_0300.jpg filter=lfs diff=lfs merge=lfs -text
36
+ runs/detect/exp/IMG_0301.jpg filter=lfs diff=lfs merge=lfs -text
37
+ runs/detect/exp/IMG_0492.jpg filter=lfs diff=lfs merge=lfs -text
38
+ runs/detect/exp/IMG_0501.jpg filter=lfs diff=lfs merge=lfs -text
39
+ runs/detect/exp/IMG_0502.jpg filter=lfs diff=lfs merge=lfs -text
40
+ runs/detect/exp/IMG_0525.jpg filter=lfs diff=lfs merge=lfs -text
41
+ runs/detect/exp/IMG_0526.jpg filter=lfs diff=lfs merge=lfs -text
42
+ runs/detect/exp/IMG_0528.jpg filter=lfs diff=lfs merge=lfs -text
43
+ runs/detect/exp/IMG_0529.jpg filter=lfs diff=lfs merge=lfs -text
44
+ runs/train/yolov5s/events.out.tfevents.1714033382.DESKTOP-92O853D.19764.0 filter=lfs diff=lfs merge=lfs -text
45
+ runs/train/yolov5s/weights/best.pt filter=lfs diff=lfs merge=lfs -text
46
+ runs/train/yolov5s/weights/last.pt filter=lfs diff=lfs merge=lfs -text
47
+ runs/train/yolov5s+SimAm/weights/best.pt filter=lfs diff=lfs merge=lfs -text
48
+ runs/train/yolov5s+SimAm/weights/last.pt filter=lfs diff=lfs merge=lfs -text
49
+ yolov5n.pt filter=lfs diff=lfs merge=lfs -text
50
+ yolov5s.pt filter=lfs diff=lfs merge=lfs -text
.github/ISSUE_TEMPLATE/bug-report.yml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: 🐛 Bug Report
2
+ # title: " "
3
+ description: Problems with YOLOv5
4
+ labels: [bug, triage]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you for submitting a YOLOv5 🐛 Bug Report!
10
+
11
+ - type: checkboxes
12
+ attributes:
13
+ label: Search before asking
14
+ description: >
15
+ Please search the [issues](https://github.com/ultralytics/yolov5/issues) to see if a similar bug report already exists.
16
+ options:
17
+ - label: >
18
+ I have searched the YOLOv5 [issues](https://github.com/ultralytics/yolov5/issues) and found no similar bug report.
19
+ required: true
20
+
21
+ - type: dropdown
22
+ attributes:
23
+ label: YOLOv5 Component
24
+ description: |
25
+ Please select the part of YOLOv5 where you found the bug.
26
+ multiple: true
27
+ options:
28
+ - "Training"
29
+ - "Validation"
30
+ - "Detection"
31
+ - "Export"
32
+ - "PyTorch Hub"
33
+ - "Multi-GPU"
34
+ - "Evolution"
35
+ - "Integrations"
36
+ - "Other"
37
+ validations:
38
+ required: false
39
+
40
+ - type: textarea
41
+ attributes:
42
+ label: Bug
43
+ description: Provide console output with error messages and/or screenshots of the bug.
44
+ placeholder: |
45
+ 💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
46
+ validations:
47
+ required: true
48
+
49
+ - type: textarea
50
+ attributes:
51
+ label: Environment
52
+ description: Please specify the software and hardware you used to produce the bug.
53
+ placeholder: |
54
+ - YOLO: YOLOv5 🚀 v6.0-67-g60e42e1 torch 1.9.0+cu111 CUDA:0 (A100-SXM4-40GB, 40536MiB)
55
+ - OS: Ubuntu 20.04
56
+ - Python: 3.9.0
57
+ validations:
58
+ required: false
59
+
60
+ - type: textarea
61
+ attributes:
62
+ label: Minimal Reproducible Example
63
+ description: >
64
+ When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to **reproduce** the problem.
65
+ This is referred to by community members as creating a [minimal reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/).
66
+ placeholder: |
67
+ ```
68
+ # Code to reproduce your issue here
69
+ ```
70
+ validations:
71
+ required: false
72
+
73
+ - type: textarea
74
+ attributes:
75
+ label: Additional
76
+ description: Anything else you would like to share?
77
+
78
+ - type: checkboxes
79
+ attributes:
80
+ label: Are you willing to submit a PR?
81
+ description: >
82
+ (Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/yolov5/pulls) (PR) to help improve YOLOv5 for everyone, especially if you have a good understanding of how to implement a fix or feature.
83
+ See the YOLOv5 [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started.
84
+ options:
85
+ - label: Yes I'd like to help by submitting a PR!
.github/ISSUE_TEMPLATE/config.yml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: 📄 Docs
4
+ url: https://docs.ultralytics.com/yolov5
5
+ about: View Ultralytics YOLOv5 Docs
6
+ - name: 💬 Forum
7
+ url: https://community.ultralytics.com/
8
+ about: Ask on Ultralytics Community Forum
9
+ - name: 🎧 Discord
10
+ url: https://ultralytics.com/discord
11
+ about: Ask on Ultralytics Discord
.github/ISSUE_TEMPLATE/feature-request.yml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: 🚀 Feature Request
2
+ description: Suggest a YOLOv5 idea
3
+ # title: " "
4
+ labels: [enhancement]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you for submitting a YOLOv5 🚀 Feature Request!
10
+
11
+ - type: checkboxes
12
+ attributes:
13
+ label: Search before asking
14
+ description: >
15
+ Please search the [issues](https://github.com/ultralytics/yolov5/issues) to see if a similar feature request already exists.
16
+ options:
17
+ - label: >
18
+ I have searched the YOLOv5 [issues](https://github.com/ultralytics/yolov5/issues) and found no similar feature requests.
19
+ required: true
20
+
21
+ - type: textarea
22
+ attributes:
23
+ label: Description
24
+ description: A short description of your feature.
25
+ placeholder: |
26
+ What new feature would you like to see in YOLOv5?
27
+ validations:
28
+ required: true
29
+
30
+ - type: textarea
31
+ attributes:
32
+ label: Use case
33
+ description: |
34
+ Describe the use case of your feature request. It will help us understand and prioritize the feature request.
35
+ placeholder: |
36
+ How would this feature be used, and who would use it?
37
+
38
+ - type: textarea
39
+ attributes:
40
+ label: Additional
41
+ description: Anything else you would like to share?
42
+
43
+ - type: checkboxes
44
+ attributes:
45
+ label: Are you willing to submit a PR?
46
+ description: >
47
+ (Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/yolov5/pulls) (PR) to help improve YOLOv5 for everyone, especially if you have a good understanding of how to implement a fix or feature.
48
+ See the YOLOv5 [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started.
49
+ options:
50
+ - label: Yes I'd like to help by submitting a PR!
.github/ISSUE_TEMPLATE/question.yml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ❓ Question
2
+ description: Ask a YOLOv5 question
3
+ # title: " "
4
+ labels: [question]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you for asking a YOLOv5 ❓ Question!
10
+
11
+ - type: checkboxes
12
+ attributes:
13
+ label: Search before asking
14
+ description: >
15
+ Please search the [issues](https://github.com/ultralytics/yolov5/issues) and [discussions](https://github.com/ultralytics/yolov5/discussions) to see if a similar question already exists.
16
+ options:
17
+ - label: >
18
+ I have searched the YOLOv5 [issues](https://github.com/ultralytics/yolov5/issues) and [discussions](https://github.com/ultralytics/yolov5/discussions) and found no similar questions.
19
+ required: true
20
+
21
+ - type: textarea
22
+ attributes:
23
+ label: Question
24
+ description: What is your question?
25
+ placeholder: |
26
+ 💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
27
+ validations:
28
+ required: true
29
+
30
+ - type: textarea
31
+ attributes:
32
+ label: Additional
33
+ description: Anything else you would like to share?
.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--
2
+ Thank you for submitting a YOLOv5 🚀 Pull Request! We want to make contributing to YOLOv5 as easy and transparent as possible. A few tips to get you started:
3
+
4
+ - Search existing YOLOv5 [PRs](https://github.com/ultralytics/yolov5/pull) to see if a similar PR already exists.
5
+ - Link this PR to a YOLOv5 [issue](https://github.com/ultralytics/yolov5/issues) to help us understand what bug fix or feature is being implemented.
6
+ - Provide before and after profiling/inference/training results to help us quantify the improvement your PR provides (if applicable).
7
+
8
+ Please see our ✅ [Contributing Guide](https://docs.ultralytics.com/help/contributing) for more details.
9
+
10
+ Note that Copilot will summarize this PR below, do not modify the 'copilot:all' line.
11
+ -->
12
+
13
+ copilot:all
.github/dependabot.yml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Dependabot for package version updates
3
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
4
+
5
+ version: 2
6
+ updates:
7
+ - package-ecosystem: pip
8
+ directory: "/"
9
+ schedule:
10
+ interval: weekly
11
+ time: "04:00"
12
+ open-pull-requests-limit: 10
13
+ reviewers:
14
+ - glenn-jocher
15
+ labels:
16
+ - dependencies
17
+
18
+ - package-ecosystem: github-actions
19
+ directory: "/.github/workflows"
20
+ schedule:
21
+ interval: weekly
22
+ time: "04:00"
23
+ open-pull-requests-limit: 5
24
+ reviewers:
25
+ - glenn-jocher
26
+ labels:
27
+ - dependencies
.github/workflows/ci-testing.yml ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # YOLOv5 Continuous Integration (CI) GitHub Actions tests
3
+
4
+ name: YOLOv5 CI
5
+
6
+ on:
7
+ push:
8
+ branches: [ master ]
9
+ pull_request:
10
+ branches: [ master ]
11
+ schedule:
12
+ - cron: '0 0 * * *' # runs at 00:00 UTC every day
13
+
14
+ jobs:
15
+ Benchmarks:
16
+ runs-on: ${{ matrix.os }}
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ ubuntu-latest ]
21
+ python-version: [ '3.11' ] # requires python<=3.10
22
+ model: [ yolov5n ]
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: actions/setup-python@v4
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+ cache: 'pip' # caching pip dependencies
29
+ - name: Install requirements
30
+ run: |
31
+ python -m pip install --upgrade pip wheel
32
+ pip install -r requirements.txt coremltools openvino-dev tensorflow-cpu --extra-index-url https://download.pytorch.org/whl/cpu
33
+ yolo checks
34
+ pip list
35
+ - name: Benchmark DetectionModel
36
+ run: |
37
+ python benchmarks.py --data coco128.yaml --weights ${{ matrix.model }}.pt --img 320 --hard-fail 0.29
38
+ - name: Benchmark SegmentationModel
39
+ run: |
40
+ python benchmarks.py --data coco128-seg.yaml --weights ${{ matrix.model }}-seg.pt --img 320 --hard-fail 0.22
41
+ - name: Test predictions
42
+ run: |
43
+ python export.py --weights ${{ matrix.model }}-cls.pt --include onnx --img 224
44
+ python detect.py --weights ${{ matrix.model }}.onnx --img 320
45
+ python segment/predict.py --weights ${{ matrix.model }}-seg.onnx --img 320
46
+ python classify/predict.py --weights ${{ matrix.model }}-cls.onnx --img 224
47
+
48
+ Tests:
49
+ timeout-minutes: 60
50
+ runs-on: ${{ matrix.os }}
51
+ strategy:
52
+ fail-fast: false
53
+ matrix:
54
+ os: [ ubuntu-latest, windows-latest ] # macos-latest bug https://github.com/ultralytics/yolov5/pull/9049
55
+ python-version: [ '3.11' ]
56
+ model: [ yolov5n ]
57
+ include:
58
+ - os: ubuntu-latest
59
+ python-version: '3.8' # '3.6.8' min
60
+ model: yolov5n
61
+ - os: ubuntu-latest
62
+ python-version: '3.9'
63
+ model: yolov5n
64
+ - os: ubuntu-latest
65
+ python-version: '3.8' # torch 1.8.0 requires python >=3.6, <=3.8
66
+ model: yolov5n
67
+ torch: '1.8.0' # min torch version CI https://pypi.org/project/torchvision/
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ - uses: actions/setup-python@v4
71
+ with:
72
+ python-version: ${{ matrix.python-version }}
73
+ cache: 'pip' # caching pip dependencies
74
+ - name: Install requirements
75
+ run: |
76
+ python -m pip install --upgrade pip wheel
77
+ if [ "${{ matrix.torch }}" == "1.8.0" ]; then
78
+ pip install -r requirements.txt torch==1.8.0 torchvision==0.9.0 --extra-index-url https://download.pytorch.org/whl/cpu
79
+ else
80
+ pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
81
+ fi
82
+ shell: bash # for Windows compatibility
83
+ - name: Check environment
84
+ run: |
85
+ yolo checks
86
+ pip list
87
+ - name: Test detection
88
+ shell: bash # for Windows compatibility
89
+ run: |
90
+ # export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories
91
+ m=${{ matrix.model }} # official weights
92
+ b=runs/train/exp/weights/best # best.pt checkpoint
93
+ python train.py --imgsz 64 --batch 32 --weights $m.pt --cfg $m.yaml --epochs 1 --device cpu # train
94
+ for d in cpu; do # devices
95
+ for w in $m $b; do # weights
96
+ python val.py --imgsz 64 --batch 32 --weights $w.pt --device $d # val
97
+ python detect.py --imgsz 64 --weights $w.pt --device $d # detect
98
+ done
99
+ done
100
+ python hubconf.py --model $m # hub
101
+ # python models/tf.py --weights $m.pt # build TF model
102
+ python models/yolo.py --cfg $m.yaml # build PyTorch model
103
+ python export.py --weights $m.pt --img 64 --include torchscript # export
104
+ python - <<EOF
105
+ import torch
106
+ im = torch.zeros([1, 3, 64, 64])
107
+ for path in '$m', '$b':
108
+ model = torch.hub.load('.', 'custom', path=path, source='local')
109
+ print(model('data/images/bus.jpg'))
110
+ model(im) # warmup, build grids for trace
111
+ torch.jit.trace(model, [im])
112
+ EOF
113
+ - name: Test segmentation
114
+ shell: bash # for Windows compatibility
115
+ run: |
116
+ m=${{ matrix.model }}-seg # official weights
117
+ b=runs/train-seg/exp/weights/best # best.pt checkpoint
118
+ python segment/train.py --imgsz 64 --batch 32 --weights $m.pt --cfg $m.yaml --epochs 1 --device cpu # train
119
+ python segment/train.py --imgsz 64 --batch 32 --weights '' --cfg $m.yaml --epochs 1 --device cpu # train
120
+ for d in cpu; do # devices
121
+ for w in $m $b; do # weights
122
+ python segment/val.py --imgsz 64 --batch 32 --weights $w.pt --device $d # val
123
+ python segment/predict.py --imgsz 64 --weights $w.pt --device $d # predict
124
+ python export.py --weights $w.pt --img 64 --include torchscript --device $d # export
125
+ done
126
+ done
127
+ - name: Test classification
128
+ shell: bash # for Windows compatibility
129
+ run: |
130
+ m=${{ matrix.model }}-cls.pt # official weights
131
+ b=runs/train-cls/exp/weights/best.pt # best.pt checkpoint
132
+ python classify/train.py --imgsz 32 --model $m --data mnist160 --epochs 1 # train
133
+ python classify/val.py --imgsz 32 --weights $b --data ../datasets/mnist160 # val
134
+ python classify/predict.py --imgsz 32 --weights $b --source ../datasets/mnist160/test/7/60.png # predict
135
+ python classify/predict.py --imgsz 32 --weights $m --source data/images/bus.jpg # predict
136
+ python export.py --weights $b --img 64 --include torchscript # export
137
+ python - <<EOF
138
+ import torch
139
+ for path in '$m', '$b':
140
+ model = torch.hub.load('.', 'custom', path=path, source='local')
141
+ EOF
142
+
143
+ Summary:
144
+ runs-on: ubuntu-latest
145
+ needs: [Benchmarks, Tests] # Add job names that you want to check for failure
146
+ if: always() # This ensures the job runs even if previous jobs fail
147
+ steps:
148
+ - name: Check for failure and notify
149
+ if: (needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' || needs.Benchmarks.result == 'cancelled' || needs.Tests.result == 'cancelled') && github.repository == 'ultralytics/yolov5' && (github.event_name == 'schedule' || github.event_name == 'push')
150
+ uses: slackapi/slack-github-action@v1.24.0
151
+ with:
152
+ payload: |
153
+ {"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"}
154
+ env:
155
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
.github/workflows/codeql-analysis.yml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This action runs GitHub's industry-leading static analysis engine, CodeQL, against a repository's source code to find security vulnerabilities.
2
+ # https://github.com/github/codeql-action
3
+
4
+ name: "CodeQL"
5
+
6
+ on:
7
+ schedule:
8
+ - cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st of every month
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ analyze:
13
+ name: Analyze
14
+ runs-on: ubuntu-latest
15
+
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ language: ['python']
20
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
21
+ # Learn more:
22
+ # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
23
+
24
+ steps:
25
+ - name: Checkout repository
26
+ uses: actions/checkout@v4
27
+
28
+ # Initializes the CodeQL tools for scanning.
29
+ - name: Initialize CodeQL
30
+ uses: github/codeql-action/init@v2
31
+ with:
32
+ languages: ${{ matrix.language }}
33
+ # If you wish to specify custom queries, you can do so here or in a config file.
34
+ # By default, queries listed here will override any specified in a config file.
35
+ # Prefix the list here with "+" to use these queries and those in the config file.
36
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
37
+
38
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
39
+ # If this step fails, then you should remove it and run the build manually (see below)
40
+ - name: Autobuild
41
+ uses: github/codeql-action/autobuild@v2
42
+
43
+ # ℹ️ Command-line programs to run using the OS shell.
44
+ # 📚 https://git.io/JvXDl
45
+
46
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
47
+ # and modify them (or add more) to build your code if your project
48
+ # uses a compiled language
49
+
50
+ #- run: |
51
+ # make bootstrap
52
+ # make release
53
+
54
+ - name: Perform CodeQL Analysis
55
+ uses: github/codeql-action/analyze@v2
.github/workflows/docker.yml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # Builds ultralytics/yolov5:latest images on DockerHub https://hub.docker.com/r/ultralytics/yolov5
3
+
4
+ name: Publish Docker Images
5
+
6
+ on:
7
+ push:
8
+ branches: [ master ]
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ docker:
13
+ if: github.repository == 'ultralytics/yolov5'
14
+ name: Push Docker image to Docker Hub
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout repo
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0 # copy full .git directory to access full git history in Docker images
21
+
22
+ - name: Set up QEMU
23
+ uses: docker/setup-qemu-action@v3
24
+
25
+ - name: Set up Docker Buildx
26
+ uses: docker/setup-buildx-action@v3
27
+
28
+ - name: Login to Docker Hub
29
+ uses: docker/login-action@v3
30
+ with:
31
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
32
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
33
+
34
+ - name: Build and push arm64 image
35
+ uses: docker/build-push-action@v5
36
+ continue-on-error: true
37
+ with:
38
+ context: .
39
+ platforms: linux/arm64
40
+ file: utils/docker/Dockerfile-arm64
41
+ push: true
42
+ tags: ultralytics/yolov5:latest-arm64
43
+
44
+ - name: Build and push CPU image
45
+ uses: docker/build-push-action@v5
46
+ continue-on-error: true
47
+ with:
48
+ context: .
49
+ file: utils/docker/Dockerfile-cpu
50
+ push: true
51
+ tags: ultralytics/yolov5:latest-cpu
52
+
53
+ - name: Build and push GPU image
54
+ uses: docker/build-push-action@v5
55
+ continue-on-error: true
56
+ with:
57
+ context: .
58
+ file: utils/docker/Dockerfile
59
+ push: true
60
+ tags: ultralytics/yolov5:latest
.github/workflows/greetings.yml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+
3
+ name: Greetings
4
+
5
+ on:
6
+ pull_request_target:
7
+ types: [opened]
8
+ issues:
9
+ types: [opened]
10
+
11
+ jobs:
12
+ greeting:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/first-interaction@v1
16
+ with:
17
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
18
+ pr-message: |
19
+ 👋 Hello @${{ github.actor }}, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
20
+
21
+ - ✅ Verify your PR is **up-to-date** with `ultralytics/yolov5` `master` branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running `git pull` and `git merge master` locally.
22
+ - ✅ Verify all YOLOv5 Continuous Integration (CI) **checks are passing**.
23
+ - ✅ Reduce changes to the absolute **minimum** required for your bug fix or feature addition. _"It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is."_ — Bruce Lee
24
+
25
+ issue-message: |
26
+ 👋 Hello @${{ github.actor }}, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ [Tutorials](https://docs.ultralytics.com/yolov5/) to get started, where you can find quickstart guides for simple tasks like [Custom Data Training](https://docs.ultralytics.com/yolov5/tutorials/train_custom_data/) all the way to advanced concepts like [Hyperparameter Evolution](https://docs.ultralytics.com/yolov5/tutorials/hyperparameter_evolution/).
27
+
28
+ If this is a 🐛 Bug Report, please provide a **minimum reproducible example** to help us debug it.
29
+
30
+ If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our [Tips for Best Training Results](https://docs.ultralytics.com/yolov5/tutorials/tips_for_best_training_results/).
31
+
32
+ ## Requirements
33
+
34
+ [**Python>=3.8.0**](https://www.python.org/) with all [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) installed including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). To get started:
35
+ ```bash
36
+ git clone https://github.com/ultralytics/yolov5 # clone
37
+ cd yolov5
38
+ pip install -r requirements.txt # install
39
+ ```
40
+
41
+ ## Environments
42
+
43
+ YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including [CUDA](https://developer.nvidia.com/cuda)/[CUDNN](https://developer.nvidia.com/cudnn), [Python](https://www.python.org/) and [PyTorch](https://pytorch.org/) preinstalled):
44
+
45
+ - **Notebooks** with free GPU: <a href="https://bit.ly/yolov5-paperspace-notebook"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a> <a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> <a href="https://www.kaggle.com/ultralytics/yolov5"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
46
+ - **Google Cloud** Deep Learning VM. See [GCP Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/)
47
+ - **Amazon** Deep Learning AMI. See [AWS Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/)
48
+ - **Docker Image**. See [Docker Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/docker_image_quickstart_tutorial/) <a href="https://hub.docker.com/r/ultralytics/yolov5"><img src="https://img.shields.io/docker/pulls/ultralytics/yolov5?logo=docker" alt="Docker Pulls"></a>
49
+
50
+ ## Status
51
+
52
+ <a href="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml"><img src="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml/badge.svg" alt="YOLOv5 CI"></a>
53
+
54
+ If this badge is green, all [YOLOv5 GitHub Actions](https://github.com/ultralytics/yolov5/actions) Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 [training](https://github.com/ultralytics/yolov5/blob/master/train.py), [validation](https://github.com/ultralytics/yolov5/blob/master/val.py), [inference](https://github.com/ultralytics/yolov5/blob/master/detect.py), [export](https://github.com/ultralytics/yolov5/blob/master/export.py) and [benchmarks](https://github.com/ultralytics/yolov5/blob/master/benchmarks.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.
55
+
56
+ ## Introducing YOLOv8 🚀
57
+
58
+ We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - [YOLOv8](https://github.com/ultralytics/ultralytics) 🚀!
59
+
60
+ Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.
61
+
62
+ Check out our [YOLOv8 Docs](https://docs.ultralytics.com/) for details and get started with:
63
+ ```bash
64
+ pip install ultralytics
65
+ ```
.github/workflows/links.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Continuous Integration (CI) GitHub Actions tests broken link checker using https://github.com/lycheeverse/lychee
3
+ # Ignores the following status codes to reduce false positives:
4
+ # - 403(OpenVINO, 'forbidden')
5
+ # - 429(Instagram, 'too many requests')
6
+ # - 500(Zenodo, 'cached')
7
+ # - 502(Zenodo, 'bad gateway')
8
+ # - 999(LinkedIn, 'unknown status code')
9
+
10
+ name: Check Broken links
11
+
12
+ on:
13
+ workflow_dispatch:
14
+ schedule:
15
+ - cron: '0 0 * * *' # runs at 00:00 UTC every day
16
+
17
+ jobs:
18
+ Links:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Download and install lychee
24
+ run: |
25
+ LYCHEE_URL=$(curl -s https://api.github.com/repos/lycheeverse/lychee/releases/latest | grep "browser_download_url" | grep "x86_64-unknown-linux-gnu.tar.gz" | cut -d '"' -f 4)
26
+ curl -L $LYCHEE_URL -o lychee.tar.gz
27
+ tar xzf lychee.tar.gz
28
+ sudo mv lychee /usr/local/bin
29
+
30
+ - name: Test Markdown and HTML links with retry
31
+ uses: nick-invision/retry@v2
32
+ with:
33
+ timeout_minutes: 5
34
+ retry_wait_seconds: 60
35
+ max_attempts: 3
36
+ command: lychee --accept 403,429,500,502,999 --exclude-loopback --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html'
37
+
38
+ - name: Test Markdown, HTML, YAML, Python and Notebook links with retry
39
+ if: github.event_name == 'workflow_dispatch'
40
+ uses: nick-invision/retry@v2
41
+ with:
42
+ timeout_minutes: 5
43
+ retry_wait_seconds: 60
44
+ max_attempts: 3
45
+ command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html' './**/*.yml' './**/*.yaml' './**/*.py' './**/*.ipynb'
.github/workflows/stale.yml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+
3
+ name: Close stale issues
4
+ on:
5
+ schedule:
6
+ - cron: '0 0 * * *' # Runs at 00:00 UTC every day
7
+
8
+ jobs:
9
+ stale:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/stale@v8
13
+ with:
14
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
15
+
16
+ stale-issue-message: |
17
+ 👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
18
+
19
+ For additional resources and information, please see the links below:
20
+
21
+ - **Docs**: https://docs.ultralytics.com
22
+ - **HUB**: https://hub.ultralytics.com
23
+ - **Community**: https://community.ultralytics.com
24
+
25
+ Feel free to inform us of any other **issues** you discover or **feature requests** that come to mind in the future. Pull Requests (PRs) are also always welcomed!
26
+
27
+ Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
28
+
29
+ stale-pr-message: |
30
+ 👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap.
31
+
32
+ We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved.
33
+
34
+ For additional resources and information, please see the links below:
35
+
36
+ - **Docs**: https://docs.ultralytics.com
37
+ - **HUB**: https://hub.ultralytics.com
38
+ - **Community**: https://community.ultralytics.com
39
+
40
+ Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
41
+
42
+ days-before-issue-stale: 30
43
+ days-before-issue-close: 10
44
+ days-before-pr-stale: 90
45
+ days-before-pr-close: 30
46
+ exempt-issue-labels: 'documentation,tutorial,TODO'
47
+ operations-per-run: 300 # The maximum number of operations per run, used to control rate limiting.
.gitignore ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Repo-specific GitIgnore ----------------------------------------------------------------------------------------------
2
+ *.jpg
3
+ *.jpeg
4
+ *.png
5
+ *.bmp
6
+ *.tif
7
+ *.tiff
8
+ *.heic
9
+ *.JPG
10
+ *.JPEG
11
+ *.PNG
12
+ *.BMP
13
+ *.TIF
14
+ *.TIFF
15
+ *.HEIC
16
+ *.mp4
17
+ *.mov
18
+ *.MOV
19
+ *.avi
20
+ *.data
21
+ *.json
22
+ *.cfg
23
+ !setup.cfg
24
+ !cfg/yolov3*.cfg
25
+
26
+ storage.googleapis.com
27
+ runs/*
28
+ data/*
29
+ data/images/*
30
+ !data/*.yaml
31
+ !data/hyps
32
+ !data/scripts
33
+ !data/images
34
+ !data/images/zidane.jpg
35
+ !data/images/bus.jpg
36
+ !data/*.sh
37
+
38
+ results*.csv
39
+
40
+ # Datasets -------------------------------------------------------------------------------------------------------------
41
+ coco/
42
+ coco128/
43
+ VOC/
44
+
45
+ # MATLAB GitIgnore -----------------------------------------------------------------------------------------------------
46
+ *.m~
47
+ *.mat
48
+ !targets*.mat
49
+
50
+ # Neural Network weights -----------------------------------------------------------------------------------------------
51
+ *.weights
52
+ *.pt
53
+ *.pb
54
+ *.onnx
55
+ *.engine
56
+ *.mlmodel
57
+ *.torchscript
58
+ *.tflite
59
+ *.h5
60
+ *_saved_model/
61
+ *_web_model/
62
+ *_openvino_model/
63
+ *_paddle_model/
64
+ darknet53.conv.74
65
+ yolov3-tiny.conv.15
66
+
67
+ # GitHub Python GitIgnore ----------------------------------------------------------------------------------------------
68
+ # Byte-compiled / optimized / DLL files
69
+ __pycache__/
70
+ *.py[cod]
71
+ *$py.class
72
+
73
+ # C extensions
74
+ *.so
75
+
76
+ # Distribution / packaging
77
+ .Python
78
+ env/
79
+ build/
80
+ develop-eggs/
81
+ dist/
82
+ downloads/
83
+ eggs/
84
+ .eggs/
85
+ lib/
86
+ lib64/
87
+ parts/
88
+ sdist/
89
+ var/
90
+ wheels/
91
+ *.egg-info/
92
+ /wandb/
93
+ .installed.cfg
94
+ *.egg
95
+
96
+
97
+ # PyInstaller
98
+ # Usually these files are written by a python script from a template
99
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
100
+ *.manifest
101
+ *.spec
102
+
103
+ # Installer logs
104
+ pip-log.txt
105
+ pip-delete-this-directory.txt
106
+
107
+ # Unit test / coverage reports
108
+ htmlcov/
109
+ .tox/
110
+ .coverage
111
+ .coverage.*
112
+ .cache
113
+ nosetests.xml
114
+ coverage.xml
115
+ *.cover
116
+ .hypothesis/
117
+
118
+ # Translations
119
+ *.mo
120
+ *.pot
121
+
122
+ # Django stuff:
123
+ *.log
124
+ local_settings.py
125
+
126
+ # Flask stuff:
127
+ instance/
128
+ .webassets-cache
129
+
130
+ # Scrapy stuff:
131
+ .scrapy
132
+
133
+ # Sphinx documentation
134
+ docs/_build/
135
+
136
+ # PyBuilder
137
+ target/
138
+
139
+ # Jupyter Notebook
140
+ .ipynb_checkpoints
141
+
142
+ # pyenv
143
+ .python-version
144
+
145
+ # celery beat schedule file
146
+ celerybeat-schedule
147
+
148
+ # SageMath parsed files
149
+ *.sage.py
150
+
151
+ # dotenv
152
+ .env
153
+
154
+ # virtualenv
155
+ .venv*
156
+ venv*/
157
+ ENV*/
158
+
159
+ # Spyder project settings
160
+ .spyderproject
161
+ .spyproject
162
+
163
+ # Rope project settings
164
+ .ropeproject
165
+
166
+ # mkdocs documentation
167
+ /site
168
+
169
+ # mypy
170
+ .mypy_cache/
171
+
172
+
173
+ # https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -----------------------------------------------
174
+
175
+ # General
176
+ .DS_Store
177
+ .AppleDouble
178
+ .LSOverride
179
+
180
+ # Icon must end with two \r
181
+ Icon
182
+ Icon?
183
+
184
+ # Thumbnails
185
+ ._*
186
+
187
+ # Files that might appear in the root of a volume
188
+ .DocumentRevisions-V100
189
+ .fseventsd
190
+ .Spotlight-V100
191
+ .TemporaryItems
192
+ .Trashes
193
+ .VolumeIcon.icns
194
+ .com.apple.timemachine.donotpresent
195
+
196
+ # Directories potentially created on remote AFP share
197
+ .AppleDB
198
+ .AppleDesktop
199
+ Network Trash Folder
200
+ Temporary Items
201
+ .apdisk
202
+
203
+
204
+ # https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
205
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
206
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
207
+
208
+ # User-specific stuff:
209
+ .idea/*
210
+ .idea/**/workspace.xml
211
+ .idea/**/tasks.xml
212
+ .idea/dictionaries
213
+ .html # Bokeh Plots
214
+ .pg # TensorFlow Frozen Graphs
215
+ .avi # videos
216
+
217
+ # Sensitive or high-churn files:
218
+ .idea/**/dataSources/
219
+ .idea/**/dataSources.ids
220
+ .idea/**/dataSources.local.xml
221
+ .idea/**/sqlDataSources.xml
222
+ .idea/**/dynamic.xml
223
+ .idea/**/uiDesigner.xml
224
+
225
+ # Gradle:
226
+ .idea/**/gradle.xml
227
+ .idea/**/libraries
228
+
229
+ # CMake
230
+ cmake-build-debug/
231
+ cmake-build-release/
232
+
233
+ # Mongo Explorer plugin:
234
+ .idea/**/mongoSettings.xml
235
+
236
+ ## File-based project format:
237
+ *.iws
238
+
239
+ ## Plugin-specific files:
240
+
241
+ # IntelliJ
242
+ out/
243
+
244
+ # mpeltonen/sbt-idea plugin
245
+ .idea_modules/
246
+
247
+ # JIRA plugin
248
+ atlassian-ide-plugin.xml
249
+
250
+ # Cursive Clojure plugin
251
+ .idea/replstate.xml
252
+
253
+ # Crashlytics plugin (for Android Studio and IntelliJ)
254
+ com_crashlytics_export_strings.xml
255
+ crashlytics.properties
256
+ crashlytics-build.properties
257
+ fabric.properties
.idea/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # 默认忽略的文件
2
+ /shelf/
3
+ /workspace.xml
.idea/.name ADDED
@@ -0,0 +1 @@
 
 
1
+ yolo-hanfeng.yaml
.idea/inspectionProfiles/Project_Default.xml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="ignoredPackages">
6
+ <value>
7
+ <list size="20">
8
+ <item index="0" class="java.lang.String" itemvalue="tqdm" />
9
+ <item index="1" class="java.lang.String" itemvalue="lxml" />
10
+ <item index="2" class="java.lang.String" itemvalue="torch" />
11
+ <item index="3" class="java.lang.String" itemvalue="torchvision" />
12
+ <item index="4" class="java.lang.String" itemvalue="pycocotools" />
13
+ <item index="5" class="java.lang.String" itemvalue="opencv_python" />
14
+ <item index="6" class="java.lang.String" itemvalue="thop" />
15
+ <item index="7" class="java.lang.String" itemvalue="pandas" />
16
+ <item index="8" class="java.lang.String" itemvalue="scipy" />
17
+ <item index="9" class="java.lang.String" itemvalue="seaborn" />
18
+ <item index="10" class="java.lang.String" itemvalue="opencv-python" />
19
+ <item index="11" class="java.lang.String" itemvalue="PyYAML" />
20
+ <item index="12" class="java.lang.String" itemvalue="matplotlib" />
21
+ <item index="13" class="java.lang.String" itemvalue="requests" />
22
+ <item index="14" class="java.lang.String" itemvalue="Pillow" />
23
+ <item index="15" class="java.lang.String" itemvalue="psutil" />
24
+ <item index="16" class="java.lang.String" itemvalue="ultralytics" />
25
+ <item index="17" class="java.lang.String" itemvalue="gitpython" />
26
+ <item index="18" class="java.lang.String" itemvalue="numpy" />
27
+ <item index="19" class="java.lang.String" itemvalue="setuptools" />
28
+ </list>
29
+ </value>
30
+ </option>
31
+ </inspection_tool>
32
+ <inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
33
+ <option name="ignoredErrors">
34
+ <list>
35
+ <option value="W292" />
36
+ </list>
37
+ </option>
38
+ </inspection_tool>
39
+ <inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
40
+ <option name="ignoredErrors">
41
+ <list>
42
+ <option value="N806" />
43
+ </list>
44
+ </option>
45
+ </inspection_tool>
46
+ <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
47
+ <option name="ignoredIdentifiers">
48
+ <list>
49
+ <option value="pytorch_object_detection.faster_rcnn.train_utils.coco_eval.*" />
50
+ <option value="color.SelectedContourAreaImage" />
51
+ <option value="color.ReadImage" />
52
+ <option value="cv2" />
53
+ <option value="color.image_path" />
54
+ <option value="color.low_threshold" />
55
+ <option value="color.high_threshold" />
56
+ </list>
57
+ </option>
58
+ </inspection_tool>
59
+ </profile>
60
+ </component>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.8 (yolov5)" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="YOLO" project-jdk-type="Python SDK" />
7
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/yolov5-master.iml" filepath="$PROJECT_DIR$/.idea/yolov5-master.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/workspace.xml ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AutoImportSettings">
4
+ <option name="autoReloadType" value="SELECTIVE" />
5
+ </component>
6
+ <component name="ChangeListManager">
7
+ <list default="true" id="b20e3f67-f286-48dc-a5d9-2ffdc3935253" name="更改" comment="" />
8
+ <option name="SHOW_DIALOG" value="false" />
9
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+ <option name="LAST_RESOLUTION" value="IGNORE" />
12
+ </component>
13
+ <component name="FileTemplateManagerImpl">
14
+ <option name="RECENT_TEMPLATES">
15
+ <list>
16
+ <option value="Python Script" />
17
+ </list>
18
+ </option>
19
+ </component>
20
+ <component name="MarkdownSettingsMigration">
21
+ <option name="stateVersion" value="1" />
22
+ </component>
23
+ <component name="ProjectColorInfo">{
24
+ &quot;associatedIndex&quot;: 0
25
+ }</component>
26
+ <component name="ProjectId" id="2ZSwDlxfHwx3WZ4ieobO0OIQO8Q" />
27
+ <component name="ProjectViewState">
28
+ <option name="hideEmptyMiddlePackages" value="true" />
29
+ <option name="showLibraryContents" value="true" />
30
+ </component>
31
+ <component name="PropertiesComponent">{
32
+ &quot;keyToString&quot;: {
33
+ &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
34
+ &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
35
+ &quot;last_opened_file_path&quot;: &quot;D:/yolov5/shiyan1/yolov5-master&quot;
36
+ }
37
+ }</component>
38
+ <component name="RecentsManager">
39
+ <key name="CopyFile.RECENT_KEYS">
40
+ <recent name="D:\yolov5\shiyan1\yolov5-master" />
41
+ <recent name="D:\yolov5\shiyan1\yolov5-master\data" />
42
+ <recent name="D:\yolov5\shiyan1\yolov5-master\models" />
43
+ </key>
44
+ <key name="MoveFile.RECENT_KEYS">
45
+ <recent name="D:\yolov5\shiyan1\yolov5-master\data\yilao\images" />
46
+ <recent name="D:\yolov5\shiyan1\yolov5-master" />
47
+ <recent name="D:\yolov5\shiyan1\yolov5-master\data" />
48
+ </key>
49
+ </component>
50
+ <component name="RunManager" selected="Python.gradio_demo">
51
+ <configuration name="欧拉公式 (1)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
52
+ <module name="yolov5-master" />
53
+ <option name="INTERPRETER_OPTIONS" value="" />
54
+ <option name="PARENT_ENVS" value="true" />
55
+ <envs>
56
+ <env name="PYTHONUNBUFFERED" value="1" />
57
+ </envs>
58
+ <option name="SDK_HOME" value="" />
59
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
60
+ <option name="IS_MODULE_SDK" value="true" />
61
+ <option name="ADD_CONTENT_ROOTS" value="true" />
62
+ <option name="ADD_SOURCE_ROOTS" value="true" />
63
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/欧拉公式.py" />
64
+ <option name="PARAMETERS" value="" />
65
+ <option name="SHOW_COMMAND_LINE" value="false" />
66
+ <option name="EMULATE_TERMINAL" value="false" />
67
+ <option name="MODULE_MODE" value="false" />
68
+ <option name="REDIRECT_INPUT" value="false" />
69
+ <option name="INPUT_FILE" value="" />
70
+ <method v="2" />
71
+ </configuration>
72
+ <configuration name="欧拉公式" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
73
+ <module name="yolov5-master" />
74
+ <option name="INTERPRETER_OPTIONS" value="" />
75
+ <option name="PARENT_ENVS" value="true" />
76
+ <envs>
77
+ <env name="PYTHONUNBUFFERED" value="1" />
78
+ </envs>
79
+ <option name="SDK_HOME" value="" />
80
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
81
+ <option name="IS_MODULE_SDK" value="true" />
82
+ <option name="ADD_CONTENT_ROOTS" value="true" />
83
+ <option name="ADD_SOURCE_ROOTS" value="true" />
84
+ <option name="SCRIPT_NAME" value="D:\yolov5\shiyan1\yolov5-master\欧拉公式.py" />
85
+ <option name="PARAMETERS" value="" />
86
+ <option name="SHOW_COMMAND_LINE" value="false" />
87
+ <option name="EMULATE_TERMINAL" value="false" />
88
+ <option name="MODULE_MODE" value="false" />
89
+ <option name="REDIRECT_INPUT" value="false" />
90
+ <option name="INPUT_FILE" value="" />
91
+ <method v="2" />
92
+ </configuration>
93
+ <configuration name="作业" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
94
+ <module name="yolov5-master" />
95
+ <option name="INTERPRETER_OPTIONS" value="" />
96
+ <option name="PARENT_ENVS" value="true" />
97
+ <envs>
98
+ <env name="PYTHONUNBUFFERED" value="1" />
99
+ </envs>
100
+ <option name="SDK_HOME" value="" />
101
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
102
+ <option name="IS_MODULE_SDK" value="true" />
103
+ <option name="ADD_CONTENT_ROOTS" value="true" />
104
+ <option name="ADD_SOURCE_ROOTS" value="true" />
105
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/作业.py" />
106
+ <option name="PARAMETERS" value="" />
107
+ <option name="SHOW_COMMAND_LINE" value="false" />
108
+ <option name="EMULATE_TERMINAL" value="false" />
109
+ <option name="MODULE_MODE" value="false" />
110
+ <option name="REDIRECT_INPUT" value="false" />
111
+ <option name="INPUT_FILE" value="" />
112
+ <method v="2" />
113
+ </configuration>
114
+ <configuration name="作业" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
115
+ <module name="yolov5-master" />
116
+ <option name="INTERPRETER_OPTIONS" value="" />
117
+ <option name="PARENT_ENVS" value="true" />
118
+ <envs>
119
+ <env name="PYTHONUNBUFFERED" value="1" />
120
+ </envs>
121
+ <option name="SDK_HOME" value="" />
122
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
123
+ <option name="IS_MODULE_SDK" value="true" />
124
+ <option name="ADD_CONTENT_ROOTS" value="true" />
125
+ <option name="ADD_SOURCE_ROOTS" value="true" />
126
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/作业.py" />
127
+ <option name="PARAMETERS" value="" />
128
+ <option name="SHOW_COMMAND_LINE" value="false" />
129
+ <option name="EMULATE_TERMINAL" value="false" />
130
+ <option name="MODULE_MODE" value="false" />
131
+ <option name="REDIRECT_INPUT" value="false" />
132
+ <option name="INPUT_FILE" value="" />
133
+ <method v="2" />
134
+ </configuration>
135
+ <configuration name="detect" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
136
+ <module name="yolov5-master" />
137
+ <option name="INTERPRETER_OPTIONS" value="" />
138
+ <option name="PARENT_ENVS" value="true" />
139
+ <envs>
140
+ <env name="PYTHONUNBUFFERED" value="1" />
141
+ </envs>
142
+ <option name="SDK_HOME" value="" />
143
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
144
+ <option name="IS_MODULE_SDK" value="true" />
145
+ <option name="ADD_CONTENT_ROOTS" value="true" />
146
+ <option name="ADD_SOURCE_ROOTS" value="true" />
147
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/detect.py" />
148
+ <option name="PARAMETERS" value="" />
149
+ <option name="SHOW_COMMAND_LINE" value="false" />
150
+ <option name="EMULATE_TERMINAL" value="false" />
151
+ <option name="MODULE_MODE" value="false" />
152
+ <option name="REDIRECT_INPUT" value="false" />
153
+ <option name="INPUT_FILE" value="" />
154
+ <method v="2" />
155
+ </configuration>
156
+ <configuration name="gradio_demo" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
157
+ <module name="yolov5-master" />
158
+ <option name="INTERPRETER_OPTIONS" value="" />
159
+ <option name="PARENT_ENVS" value="true" />
160
+ <envs>
161
+ <env name="PYTHONUNBUFFERED" value="1" />
162
+ </envs>
163
+ <option name="SDK_HOME" value="" />
164
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
165
+ <option name="IS_MODULE_SDK" value="true" />
166
+ <option name="ADD_CONTENT_ROOTS" value="true" />
167
+ <option name="ADD_SOURCE_ROOTS" value="true" />
168
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/gradio_demo.py" />
169
+ <option name="PARAMETERS" value="" />
170
+ <option name="SHOW_COMMAND_LINE" value="false" />
171
+ <option name="EMULATE_TERMINAL" value="false" />
172
+ <option name="MODULE_MODE" value="false" />
173
+ <option name="REDIRECT_INPUT" value="false" />
174
+ <option name="INPUT_FILE" value="" />
175
+ <method v="2" />
176
+ </configuration>
177
+ <configuration name="train" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
178
+ <module name="yolov5-master" />
179
+ <option name="INTERPRETER_OPTIONS" value="" />
180
+ <option name="PARENT_ENVS" value="true" />
181
+ <envs>
182
+ <env name="PYTHONUNBUFFERED" value="1" />
183
+ </envs>
184
+ <option name="SDK_HOME" value="" />
185
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
186
+ <option name="IS_MODULE_SDK" value="true" />
187
+ <option name="ADD_CONTENT_ROOTS" value="true" />
188
+ <option name="ADD_SOURCE_ROOTS" value="true" />
189
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/train.py" />
190
+ <option name="PARAMETERS" value="" />
191
+ <option name="SHOW_COMMAND_LINE" value="false" />
192
+ <option name="EMULATE_TERMINAL" value="false" />
193
+ <option name="MODULE_MODE" value="false" />
194
+ <option name="REDIRECT_INPUT" value="false" />
195
+ <option name="INPUT_FILE" value="" />
196
+ <method v="2" />
197
+ </configuration>
198
+ <recent_temporary>
199
+ <list>
200
+ <item itemvalue="Python.gradio_demo" />
201
+ <item itemvalue="Python.detect" />
202
+ <item itemvalue="Python.train" />
203
+ <item itemvalue="Python.欧拉公式 (1)" />
204
+ <item itemvalue="Python.欧拉公式" />
205
+ </list>
206
+ </recent_temporary>
207
+ </component>
208
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
209
+ <component name="TaskManager">
210
+ <task active="true" id="Default" summary="默认任务">
211
+ <changelist id="b20e3f67-f286-48dc-a5d9-2ffdc3935253" name="更改" comment="" />
212
+ <created>1702428680560</created>
213
+ <option name="number" value="Default" />
214
+ <option name="presentableId" value="Default" />
215
+ <updated>1702428680560</updated>
216
+ </task>
217
+ <servers />
218
+ </component>
219
+ <component name="UnknownFeatures">
220
+ <option featureType="com.intellij.fileTypeFactory" implementationName="*.csv" />
221
+ </component>
222
+ <component name="XDebuggerManager">
223
+ <breakpoint-manager>
224
+ <breakpoints>
225
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
226
+ <url>file://$PROJECT_DIR$/detect.py</url>
227
+ <line>55</line>
228
+ <option name="timeStamp" value="1" />
229
+ </line-breakpoint>
230
+ </breakpoints>
231
+ </breakpoint-manager>
232
+ </component>
233
+ </project>
.idea/yolov5-master.iml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="jdk" jdkName="YOLO" jdkType="Python SDK" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ <component name="PyDocumentationSettings">
9
+ <option name="format" value="GOOGLE" />
10
+ <option name="myDocStringFormat" value="Google" />
11
+ </component>
12
+ </module>
.pre-commit-config.yaml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Pre-commit hooks. For more information see https://github.com/pre-commit/pre-commit-hooks/blob/main/README.md
3
+
4
+ exclude: 'docs/'
5
+ # Define bot property if installed via https://github.com/marketplace/pre-commit-ci
6
+ ci:
7
+ autofix_prs: true
8
+ autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
9
+ autoupdate_schedule: monthly
10
+ # submodules: true
11
+
12
+ repos:
13
+ - repo: https://github.com/pre-commit/pre-commit-hooks
14
+ rev: v4.5.0
15
+ hooks:
16
+ - id: end-of-file-fixer
17
+ - id: trailing-whitespace
18
+ - id: check-case-conflict
19
+ # - id: check-yaml
20
+ - id: check-docstring-first
21
+ - id: double-quote-string-fixer
22
+ - id: detect-private-key
23
+
24
+ - repo: https://github.com/asottile/pyupgrade
25
+ rev: v3.15.0
26
+ hooks:
27
+ - id: pyupgrade
28
+ name: Upgrade code
29
+
30
+ - repo: https://github.com/PyCQA/isort
31
+ rev: 5.12.0
32
+ hooks:
33
+ - id: isort
34
+ name: Sort imports
35
+
36
+ - repo: https://github.com/google/yapf
37
+ rev: v0.40.2
38
+ hooks:
39
+ - id: yapf
40
+ name: YAPF formatting
41
+
42
+ - repo: https://github.com/executablebooks/mdformat
43
+ rev: 0.7.17
44
+ hooks:
45
+ - id: mdformat
46
+ name: MD formatting
47
+ additional_dependencies:
48
+ - mdformat-gfm
49
+ - mdformat-black
50
+ # exclude: "README.md|README.zh-CN.md|CONTRIBUTING.md"
51
+
52
+ - repo: https://github.com/PyCQA/flake8
53
+ rev: 6.1.0
54
+ hooks:
55
+ - id: flake8
56
+ name: PEP8
57
+
58
+ - repo: https://github.com/codespell-project/codespell
59
+ rev: v2.2.6
60
+ hooks:
61
+ - id: codespell
62
+ args:
63
+ - --ignore-words-list=crate,nd,strack,dota
64
+
65
+ # - repo: https://github.com/asottile/yesqa
66
+ # rev: v1.4.0
67
+ # hooks:
68
+ # - id: yesqa
69
+
70
+ # - repo: https://github.com/asottile/dead
71
+ # rev: v1.5.0
72
+ # hooks:
73
+ # - id: dead
00/IMG_0127.png ADDED

Git LFS Details

  • SHA256: 2abdcbe9fb13728de8cf1d46420722afad6fd789b6509489d0f91fbf946ae0c1
  • Pointer size: 132 Bytes
  • Size of remote file: 2.43 MB
00/IMG_0197.png ADDED

Git LFS Details

  • SHA256: 590b56df196c68aebff2025ae079cc9c611836bc5e638186bea237e9dabc5966
  • Pointer size: 132 Bytes
  • Size of remote file: 4.38 MB
00/IMG_0198.png ADDED

Git LFS Details

  • SHA256: c22c02a87b92a4f43520d0bdf53c876320809a3d213a1c814cea4c81711ea776
  • Pointer size: 132 Bytes
  • Size of remote file: 4.24 MB
00/IMG_0200.png ADDED

Git LFS Details

  • SHA256: 914e5e8828d7cb007c277e7bb3a2aa03b14d8e3c3736f33cc638e91514b85c09
  • Pointer size: 132 Bytes
  • Size of remote file: 4.3 MB
00/IMG_0224.png ADDED

Git LFS Details

  • SHA256: 52fca5bbd1379054f4f87f8228f40c1959ecae9809d5b141b03ee42fb50bdc8c
  • Pointer size: 132 Bytes
  • Size of remote file: 3.31 MB
00/IMG_0281.png ADDED

Git LFS Details

  • SHA256: 5233a5fca4298e3192883a978e5c7d02215be658bb093313354957b137db4504
  • Pointer size: 132 Bytes
  • Size of remote file: 3.19 MB
00/IMG_0282.png ADDED

Git LFS Details

  • SHA256: dedefe74f3efc9d2fe0770d465e2f8707b7007927dacbf6e8257d09634978bb6
  • Pointer size: 132 Bytes
  • Size of remote file: 3.09 MB
00/IMG_0300.png ADDED

Git LFS Details

  • SHA256: 9186f530e5e235265f845912ea2143545923322f85f96b7d80b3c33ac168a7a2
  • Pointer size: 132 Bytes
  • Size of remote file: 3.17 MB
00/IMG_0301.png ADDED

Git LFS Details

  • SHA256: f7a96b19e8be9d6987a0b08896884be27a23ba8d8259ec233769b63d170641a9
  • Pointer size: 132 Bytes
  • Size of remote file: 3.05 MB
CITATION.cff ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cff-version: 1.2.0
2
+ preferred-citation:
3
+ type: software
4
+ message: If you use YOLOv5, please cite it as below.
5
+ authors:
6
+ - family-names: Jocher
7
+ given-names: Glenn
8
+ orcid: "https://orcid.org/0000-0001-5950-6979"
9
+ title: "YOLOv5 by Ultralytics"
10
+ version: 7.0
11
+ doi: 10.5281/zenodo.3908559
12
+ date-released: 2020-5-29
13
+ license: AGPL-3.0
14
+ url: "https://github.com/ultralytics/yolov5"
CONTRIBUTING.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Contributing to YOLOv5 🚀
2
+
3
+ We love your input! We want to make contributing to YOLOv5 as easy and transparent as possible, whether it's:
4
+
5
+ - Reporting a bug
6
+ - Discussing the current state of the code
7
+ - Submitting a fix
8
+ - Proposing a new feature
9
+ - Becoming a maintainer
10
+
11
+ YOLOv5 works so well due to our combined community effort, and for every small improvement you contribute you will be
12
+ helping push the frontiers of what's possible in AI 😃!
13
+
14
+ ## Submitting a Pull Request (PR) 🛠️
15
+
16
+ Submitting a PR is easy! This example shows how to submit a PR for updating `requirements.txt` in 4 steps:
17
+
18
+ ### 1. Select File to Update
19
+
20
+ Select `requirements.txt` to update by clicking on it in GitHub.
21
+
22
+ <p align="center"><img width="800" alt="PR_step1" src="https://user-images.githubusercontent.com/26833433/122260847-08be2600-ced4-11eb-828b-8287ace4136c.png"></p>
23
+
24
+ ### 2. Click 'Edit this file'
25
+
26
+ The button is in the top-right corner.
27
+
28
+ <p align="center"><img width="800" alt="PR_step2" src="https://user-images.githubusercontent.com/26833433/122260844-06f46280-ced4-11eb-9eec-b8a24be519ca.png"></p>
29
+
30
+ ### 3. Make Changes
31
+
32
+ Change the `matplotlib` version from `3.2.2` to `3.3`.
33
+
34
+ <p align="center"><img width="800" alt="PR_step3" src="https://user-images.githubusercontent.com/26833433/122260853-0a87e980-ced4-11eb-9fd2-3650fb6e0842.png"></p>
35
+
36
+ ### 4. Preview Changes and Submit PR
37
+
38
+ Click on the **Preview changes** tab to verify your updates. At the bottom of the screen select 'Create a **new branch**
39
+ for this commit', assign your branch a descriptive name such as `fix/matplotlib_version` and click the green **Propose
40
+ changes** button. All done, your PR is now submitted to YOLOv5 for review and approval 😃!
41
+
42
+ <p align="center"><img width="800" alt="PR_step4" src="https://user-images.githubusercontent.com/26833433/122260856-0b208000-ced4-11eb-8e8e-77b6151cbcc3.png"></p>
43
+
44
+ ### PR recommendations
45
+
46
+ To allow your work to be integrated as seamlessly as possible, we advise you to:
47
+
48
+ - ✅ Verify your PR is **up-to-date** with `ultralytics/yolov5` `master` branch. If your PR is behind you can update
49
+ your code by clicking the 'Update branch' button or by running `git pull` and `git merge master` locally.
50
+
51
+ <p align="center"><img width="751" alt="Screenshot 2022-08-29 at 22 47 15" src="https://user-images.githubusercontent.com/26833433/187295893-50ed9f44-b2c9-4138-a614-de69bd1753d7.png"></p>
52
+
53
+ - ✅ Verify all YOLOv5 Continuous Integration (CI) **checks are passing**.
54
+
55
+ <p align="center"><img width="751" alt="Screenshot 2022-08-29 at 22 47 03" src="https://user-images.githubusercontent.com/26833433/187296922-545c5498-f64a-4d8c-8300-5fa764360da6.png"></p>
56
+
57
+ - ✅ Reduce changes to the absolute **minimum** required for your bug fix or feature addition. _"It is not daily increase
58
+ but daily decrease, hack away the unessential. The closer to the source, the less wastage there is."_ — Bruce Lee
59
+
60
+ ## Submitting a Bug Report 🐛
61
+
62
+ If you spot a problem with YOLOv5 please submit a Bug Report!
63
+
64
+ For us to start investigating a possible problem we need to be able to reproduce it ourselves first. We've created a few
65
+ short guidelines below to help users provide what we need to get started.
66
+
67
+ When asking a question, people will be better able to provide help if you provide **code** that they can easily
68
+ understand and use to **reproduce** the problem. This is referred to by community members as creating
69
+ a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/). Your code that reproduces
70
+ the problem should be:
71
+
72
+ - ✅ **Minimal** – Use as little code as possible that still produces the same problem
73
+ - ✅ **Complete** – Provide **all** parts someone else needs to reproduce your problem in the question itself
74
+ - ✅ **Reproducible** – Test the code you're about to provide to make sure it reproduces the problem
75
+
76
+ In addition to the above requirements, for [Ultralytics](https://ultralytics.com/) to provide assistance your code
77
+ should be:
78
+
79
+ - ✅ **Current** – Verify that your code is up-to-date with the current
80
+ GitHub [master](https://github.com/ultralytics/yolov5/tree/master), and if necessary `git pull` or `git clone` a new
81
+ copy to ensure your problem has not already been resolved by previous commits.
82
+ - ✅ **Unmodified** – Your problem must be reproducible without any modifications to the codebase in this
83
+ repository. [Ultralytics](https://ultralytics.com/) does not provide support for custom code ⚠️.
84
+
85
+ If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the 🐛
86
+ **Bug Report** [template](https://github.com/ultralytics/yolov5/issues/new/choose) and provide
87
+ a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us better
88
+ understand and diagnose your problem.
89
+
90
+ ## License
91
+
92
+ By contributing, you agree that your contributions will be licensed under
93
+ the [AGPL-3.0 license](https://choosealicense.com/licenses/agpl-3.0/)
LICENSE ADDED
@@ -0,0 +1,661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 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 Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
13
+
14
+ The licenses for most software and other practical works are designed
15
+ to take away your freedom to share and change the works. By contrast,
16
+ our General Public Licenses are intended to guarantee your freedom to
17
+ share and change all versions of a program--to make sure it remains free
18
+ software for all its users.
19
+
20
+ When we speak of free software, we are referring to freedom, not
21
+ price. Our General Public Licenses are designed to make sure that you
22
+ have the freedom to distribute copies of free software (and charge for
23
+ them if you wish), that you receive source code or can get it if you
24
+ want it, that you can change the software or use pieces of it in new
25
+ free programs, and that you know you can do these things.
26
+
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ TERMS AND CONDITIONS
60
+
61
+ 0. Definitions.
62
+
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
64
+
65
+ "Copyright" also means copyright-like laws that apply to other kinds of
66
+ works, such as semiconductor masks.
67
+
68
+ "The Program" refers to any copyrightable work licensed under this
69
+ License. Each licensee is addressed as "you". "Licensees" and
70
+ "recipients" may be individuals or organizations.
71
+
72
+ To "modify" a work means to copy from or adapt all or part of the work
73
+ in a fashion requiring copyright permission, other than the making of an
74
+ exact copy. The resulting work is called a "modified version" of the
75
+ earlier work or a work "based on" the earlier work.
76
+
77
+ A "covered work" means either the unmodified Program or a work based
78
+ on the Program.
79
+
80
+ To "propagate" a work means to do anything with it that, without
81
+ permission, would make you directly or secondarily liable for
82
+ infringement under applicable copyright law, except executing it on a
83
+ computer or modifying a private copy. Propagation includes copying,
84
+ distribution (with or without modification), making available to the
85
+ public, and in some countries other activities as well.
86
+
87
+ To "convey" a work means any kind of propagation that enables other
88
+ parties to make or receive copies. Mere interaction with a user through
89
+ a computer network, with no transfer of a copy, is not conveying.
90
+
91
+ An interactive user interface displays "Appropriate Legal Notices"
92
+ to the extent that it includes a convenient and prominently visible
93
+ feature that (1) displays an appropriate copyright notice, and (2)
94
+ tells the user that there is no warranty for the work (except to the
95
+ extent that warranties are provided), that licensees may convey the
96
+ work under this License, and how to view a copy of this License. If
97
+ the interface presents a list of user commands or options, such as a
98
+ menu, a prominent item in the list meets this criterion.
99
+
100
+ 1. Source Code.
101
+
102
+ The "source code" for a work means the preferred form of the work
103
+ for making modifications to it. "Object code" means any non-source
104
+ form of a work.
105
+
106
+ A "Standard Interface" means an interface that either is an official
107
+ standard defined by a recognized standards body, or, in the case of
108
+ interfaces specified for a particular programming language, one that
109
+ is widely used among developers working in that language.
110
+
111
+ The "System Libraries" of an executable work include anything, other
112
+ than the work as a whole, that (a) is included in the normal form of
113
+ packaging a Major Component, but which is not part of that Major
114
+ Component, and (b) serves only to enable use of the work with that
115
+ Major Component, or to implement a Standard Interface for which an
116
+ implementation is available to the public in source code form. A
117
+ "Major Component", in this context, means a major essential component
118
+ (kernel, window system, and so on) of the specific operating system
119
+ (if any) on which the executable work runs, or a compiler used to
120
+ produce the work, or an object code interpreter used to run it.
121
+
122
+ The "Corresponding Source" for a work in object code form means all
123
+ the source code needed to generate, install, and (for an executable
124
+ work) run the object code and to modify the work, including scripts to
125
+ control those activities. However, it does not include the work's
126
+ System Libraries, or general-purpose tools or generally available free
127
+ programs which are used unmodified in performing those activities but
128
+ which are not part of the work. For example, Corresponding Source
129
+ includes interface definition files associated with source files for
130
+ the work, and the source code for shared libraries and dynamically
131
+ linked subprograms that the work is specifically designed to require,
132
+ such as by intimate data communication or control flow between those
133
+ subprograms and other parts of the work.
134
+
135
+ The Corresponding Source need not include anything that users
136
+ can regenerate automatically from other parts of the Corresponding
137
+ Source.
138
+
139
+ The Corresponding Source for a work in source code form is that
140
+ same work.
141
+
142
+ 2. Basic Permissions.
143
+
144
+ All rights granted under this License are granted for the term of
145
+ copyright on the Program, and are irrevocable provided the stated
146
+ conditions are met. This License explicitly affirms your unlimited
147
+ permission to run the unmodified Program. The output from running a
148
+ covered work is covered by this License only if the output, given its
149
+ content, constitutes a covered work. This License acknowledges your
150
+ rights of fair use or other equivalent, as provided by copyright law.
151
+
152
+ You may make, run and propagate covered works that you do not
153
+ convey, without conditions so long as your license otherwise remains
154
+ in force. You may convey covered works to others for the sole purpose
155
+ of having them make modifications exclusively for you, or provide you
156
+ with facilities for running those works, provided that you comply with
157
+ the terms of this License in conveying all material for which you do
158
+ not control copyright. Those thus making or running the covered works
159
+ for you must do so exclusively on your behalf, under your direction
160
+ and control, on terms that prohibit them from making any copies of
161
+ your copyrighted material outside their relationship with you.
162
+
163
+ Conveying under any other circumstances is permitted solely under
164
+ the conditions stated below. Sublicensing is not allowed; section 10
165
+ makes it unnecessary.
166
+
167
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168
+
169
+ No covered work shall be deemed part of an effective technological
170
+ measure under any applicable law fulfilling obligations under article
171
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172
+ similar laws prohibiting or restricting circumvention of such
173
+ measures.
174
+
175
+ When you convey a covered work, you waive any legal power to forbid
176
+ circumvention of technological measures to the extent such circumvention
177
+ is effected by exercising rights under this License with respect to
178
+ the covered work, and you disclaim any intention to limit operation or
179
+ modification of the work as a means of enforcing, against the work's
180
+ users, your or third parties' legal rights to forbid circumvention of
181
+ technological measures.
182
+
183
+ 4. Conveying Verbatim Copies.
184
+
185
+ You may convey verbatim copies of the Program's source code as you
186
+ receive it, in any medium, provided that you conspicuously and
187
+ appropriately publish on each copy an appropriate copyright notice;
188
+ keep intact all notices stating that this License and any
189
+ non-permissive terms added in accord with section 7 apply to the code;
190
+ keep intact all notices of the absence of any warranty; and give all
191
+ recipients a copy of this License along with the Program.
192
+
193
+ You may charge any price or no price for each copy that you convey,
194
+ and you may offer support or warranty protection for a fee.
195
+
196
+ 5. Conveying Modified Source Versions.
197
+
198
+ You may convey a work based on the Program, or the modifications to
199
+ produce it from the Program, in the form of source code under the
200
+ terms of section 4, provided that you also meet all of these conditions:
201
+
202
+ a) The work must carry prominent notices stating that you modified
203
+ it, and giving a relevant date.
204
+
205
+ b) The work must carry prominent notices stating that it is
206
+ released under this License and any conditions added under section
207
+ 7. This requirement modifies the requirement in section 4 to
208
+ "keep intact all notices".
209
+
210
+ c) You must license the entire work, as a whole, under this
211
+ License to anyone who comes into possession of a copy. This
212
+ License will therefore apply, along with any applicable section 7
213
+ additional terms, to the whole of the work, and all its parts,
214
+ regardless of how they are packaged. This License gives no
215
+ permission to license the work in any other way, but it does not
216
+ invalidate such permission if you have separately received it.
217
+
218
+ d) If the work has interactive user interfaces, each must display
219
+ Appropriate Legal Notices; however, if the Program has interactive
220
+ interfaces that do not display Appropriate Legal Notices, your
221
+ work need not make them do so.
222
+
223
+ A compilation of a covered work with other separate and independent
224
+ works, which are not by their nature extensions of the covered work,
225
+ and which are not combined with it such as to form a larger program,
226
+ in or on a volume of a storage or distribution medium, is called an
227
+ "aggregate" if the compilation and its resulting copyright are not
228
+ used to limit the access or legal rights of the compilation's users
229
+ beyond what the individual works permit. Inclusion of a covered work
230
+ in an aggregate does not cause this License to apply to the other
231
+ parts of the aggregate.
232
+
233
+ 6. Conveying Non-Source Forms.
234
+
235
+ You may convey a covered work in object code form under the terms
236
+ of sections 4 and 5, provided that you also convey the
237
+ machine-readable Corresponding Source under the terms of this License,
238
+ in one of these ways:
239
+
240
+ a) Convey the object code in, or embodied in, a physical product
241
+ (including a physical distribution medium), accompanied by the
242
+ Corresponding Source fixed on a durable physical medium
243
+ customarily used for software interchange.
244
+
245
+ b) Convey the object code in, or embodied in, a physical product
246
+ (including a physical distribution medium), accompanied by a
247
+ written offer, valid for at least three years and valid for as
248
+ long as you offer spare parts or customer support for that product
249
+ model, to give anyone who possesses the object code either (1) a
250
+ copy of the Corresponding Source for all the software in the
251
+ product that is covered by this License, on a durable physical
252
+ medium customarily used for software interchange, for a price no
253
+ more than your reasonable cost of physically performing this
254
+ conveying of source, or (2) access to copy the
255
+ Corresponding Source from a network server at no charge.
256
+
257
+ c) Convey individual copies of the object code with a copy of the
258
+ written offer to provide the Corresponding Source. This
259
+ alternative is allowed only occasionally and noncommercially, and
260
+ only if you received the object code with such an offer, in accord
261
+ with subsection 6b.
262
+
263
+ d) Convey the object code by offering access from a designated
264
+ place (gratis or for a charge), and offer equivalent access to the
265
+ Corresponding Source in the same way through the same place at no
266
+ further charge. You need not require recipients to copy the
267
+ Corresponding Source along with the object code. If the place to
268
+ copy the object code is a network server, the Corresponding Source
269
+ may be on a different server (operated by you or a third party)
270
+ that supports equivalent copying facilities, provided you maintain
271
+ clear directions next to the object code saying where to find the
272
+ Corresponding Source. Regardless of what server hosts the
273
+ Corresponding Source, you remain obligated to ensure that it is
274
+ available for as long as needed to satisfy these requirements.
275
+
276
+ e) Convey the object code using peer-to-peer transmission, provided
277
+ you inform other peers where the object code and Corresponding
278
+ Source of the work are being offered to the general public at no
279
+ charge under subsection 6d.
280
+
281
+ A separable portion of the object code, whose source code is excluded
282
+ from the Corresponding Source as a System Library, need not be
283
+ included in conveying the object code work.
284
+
285
+ A "User Product" is either (1) a "consumer product", which means any
286
+ tangible personal property which is normally used for personal, family,
287
+ or household purposes, or (2) anything designed or sold for incorporation
288
+ into a dwelling. In determining whether a product is a consumer product,
289
+ doubtful cases shall be resolved in favor of coverage. For a particular
290
+ product received by a particular user, "normally used" refers to a
291
+ typical or common use of that class of product, regardless of the status
292
+ of the particular user or of the way in which the particular user
293
+ actually uses, or expects or is expected to use, the product. A product
294
+ is a consumer product regardless of whether the product has substantial
295
+ commercial, industrial or non-consumer uses, unless such uses represent
296
+ the only significant mode of use of the product.
297
+
298
+ "Installation Information" for a User Product means any methods,
299
+ procedures, authorization keys, or other information required to install
300
+ and execute modified versions of a covered work in that User Product from
301
+ a modified version of its Corresponding Source. The information must
302
+ suffice to ensure that the continued functioning of the modified object
303
+ code is in no case prevented or interfered with solely because
304
+ modification has been made.
305
+
306
+ If you convey an object code work under this section in, or with, or
307
+ specifically for use in, a User Product, and the conveying occurs as
308
+ part of a transaction in which the right of possession and use of the
309
+ User Product is transferred to the recipient in perpetuity or for a
310
+ fixed term (regardless of how the transaction is characterized), the
311
+ Corresponding Source conveyed under this section must be accompanied
312
+ by the Installation Information. But this requirement does not apply
313
+ if neither you nor any third party retains the ability to install
314
+ modified object code on the User Product (for example, the work has
315
+ been installed in ROM).
316
+
317
+ The requirement to provide Installation Information does not include a
318
+ requirement to continue to provide support service, warranty, or updates
319
+ for a work that has been modified or installed by the recipient, or for
320
+ the User Product in which it has been modified or installed. Access to a
321
+ network may be denied when the modification itself materially and
322
+ adversely affects the operation of the network or violates the rules and
323
+ protocols for communication across the network.
324
+
325
+ Corresponding Source conveyed, and Installation Information provided,
326
+ in accord with this section must be in a format that is publicly
327
+ documented (and with an implementation available to the public in
328
+ source code form), and must require no special password or key for
329
+ unpacking, reading or copying.
330
+
331
+ 7. Additional Terms.
332
+
333
+ "Additional permissions" are terms that supplement the terms of this
334
+ License by making exceptions from one or more of its conditions.
335
+ Additional permissions that are applicable to the entire Program shall
336
+ be treated as though they were included in this License, to the extent
337
+ that they are valid under applicable law. If additional permissions
338
+ apply only to part of the Program, that part may be used separately
339
+ under those permissions, but the entire Program remains governed by
340
+ this License without regard to the additional permissions.
341
+
342
+ When you convey a copy of a covered work, you may at your option
343
+ remove any additional permissions from that copy, or from any part of
344
+ it. (Additional permissions may be written to require their own
345
+ removal in certain cases when you modify the work.) You may place
346
+ additional permissions on material, added by you to a covered work,
347
+ for which you have or can give appropriate copyright permission.
348
+
349
+ Notwithstanding any other provision of this License, for material you
350
+ add to a covered work, you may (if authorized by the copyright holders of
351
+ that material) supplement the terms of this License with terms:
352
+
353
+ a) Disclaiming warranty or limiting liability differently from the
354
+ terms of sections 15 and 16 of this License; or
355
+
356
+ b) Requiring preservation of specified reasonable legal notices or
357
+ author attributions in that material or in the Appropriate Legal
358
+ Notices displayed by works containing it; or
359
+
360
+ c) Prohibiting misrepresentation of the origin of that material, or
361
+ requiring that modified versions of such material be marked in
362
+ reasonable ways as different from the original version; or
363
+
364
+ d) Limiting the use for publicity purposes of names of licensors or
365
+ authors of the material; or
366
+
367
+ e) Declining to grant rights under trademark law for use of some
368
+ trade names, trademarks, or service marks; or
369
+
370
+ f) Requiring indemnification of licensors and authors of that
371
+ material by anyone who conveys the material (or modified versions of
372
+ it) with contractual assumptions of liability to the recipient, for
373
+ any liability that these contractual assumptions directly impose on
374
+ those licensors and authors.
375
+
376
+ All other non-permissive additional terms are considered "further
377
+ restrictions" within the meaning of section 10. If the Program as you
378
+ received it, or any part of it, contains a notice stating that it is
379
+ governed by this License along with a term that is a further
380
+ restriction, you may remove that term. If a license document contains
381
+ a further restriction but permits relicensing or conveying under this
382
+ License, you may add to a covered work material governed by the terms
383
+ of that license document, provided that the further restriction does
384
+ not survive such relicensing or conveying.
385
+
386
+ If you add terms to a covered work in accord with this section, you
387
+ must place, in the relevant source files, a statement of the
388
+ additional terms that apply to those files, or a notice indicating
389
+ where to find the applicable terms.
390
+
391
+ Additional terms, permissive or non-permissive, may be stated in the
392
+ form of a separately written license, or stated as exceptions;
393
+ the above requirements apply either way.
394
+
395
+ 8. Termination.
396
+
397
+ You may not propagate or modify a covered work except as expressly
398
+ provided under this License. Any attempt otherwise to propagate or
399
+ modify it is void, and will automatically terminate your rights under
400
+ this License (including any patent licenses granted under the third
401
+ paragraph of section 11).
402
+
403
+ However, if you cease all violation of this License, then your
404
+ license from a particular copyright holder is reinstated (a)
405
+ provisionally, unless and until the copyright holder explicitly and
406
+ finally terminates your license, and (b) permanently, if the copyright
407
+ holder fails to notify you of the violation by some reasonable means
408
+ prior to 60 days after the cessation.
409
+
410
+ Moreover, your license from a particular copyright holder is
411
+ reinstated permanently if the copyright holder notifies you of the
412
+ violation by some reasonable means, this is the first time you have
413
+ received notice of violation of this License (for any work) from that
414
+ copyright holder, and you cure the violation prior to 30 days after
415
+ your receipt of the notice.
416
+
417
+ Termination of your rights under this section does not terminate the
418
+ licenses of parties who have received copies or rights from you under
419
+ this License. If your rights have been terminated and not permanently
420
+ reinstated, you do not qualify to receive new licenses for the same
421
+ material under section 10.
422
+
423
+ 9. Acceptance Not Required for Having Copies.
424
+
425
+ You are not required to accept this License in order to receive or
426
+ run a copy of the Program. Ancillary propagation of a covered work
427
+ occurring solely as a consequence of using peer-to-peer transmission
428
+ to receive a copy likewise does not require acceptance. However,
429
+ nothing other than this License grants you permission to propagate or
430
+ modify any covered work. These actions infringe copyright if you do
431
+ not accept this License. Therefore, by modifying or propagating a
432
+ covered work, you indicate your acceptance of this License to do so.
433
+
434
+ 10. Automatic Licensing of Downstream Recipients.
435
+
436
+ Each time you convey a covered work, the recipient automatically
437
+ receives a license from the original licensors, to run, modify and
438
+ propagate that work, subject to this License. You are not responsible
439
+ for enforcing compliance by third parties with this License.
440
+
441
+ An "entity transaction" is a transaction transferring control of an
442
+ organization, or substantially all assets of one, or subdividing an
443
+ organization, or merging organizations. If propagation of a covered
444
+ work results from an entity transaction, each party to that
445
+ transaction who receives a copy of the work also receives whatever
446
+ licenses to the work the party's predecessor in interest had or could
447
+ give under the previous paragraph, plus a right to possession of the
448
+ Corresponding Source of the work from the predecessor in interest, if
449
+ the predecessor has it or can get it with reasonable efforts.
450
+
451
+ You may not impose any further restrictions on the exercise of the
452
+ rights granted or affirmed under this License. For example, you may
453
+ not impose a license fee, royalty, or other charge for exercise of
454
+ rights granted under this License, and you may not initiate litigation
455
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
456
+ any patent claim is infringed by making, using, selling, offering for
457
+ sale, or importing the Program or any portion of it.
458
+
459
+ 11. Patents.
460
+
461
+ A "contributor" is a copyright holder who authorizes use under this
462
+ License of the Program or a work on which the Program is based. The
463
+ work thus licensed is called the contributor's "contributor version".
464
+
465
+ A contributor's "essential patent claims" are all patent claims
466
+ owned or controlled by the contributor, whether already acquired or
467
+ hereafter acquired, that would be infringed by some manner, permitted
468
+ by this License, of making, using, or selling its contributor version,
469
+ but do not include claims that would be infringed only as a
470
+ consequence of further modification of the contributor version. For
471
+ purposes of this definition, "control" includes the right to grant
472
+ patent sublicenses in a manner consistent with the requirements of
473
+ this License.
474
+
475
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
476
+ patent license under the contributor's essential patent claims, to
477
+ make, use, sell, offer for sale, import and otherwise run, modify and
478
+ propagate the contents of its contributor version.
479
+
480
+ In the following three paragraphs, a "patent license" is any express
481
+ agreement or commitment, however denominated, not to enforce a patent
482
+ (such as an express permission to practice a patent or covenant not to
483
+ sue for patent infringement). To "grant" such a patent license to a
484
+ party means to make such an agreement or commitment not to enforce a
485
+ patent against the party.
486
+
487
+ If you convey a covered work, knowingly relying on a patent license,
488
+ and the Corresponding Source of the work is not available for anyone
489
+ to copy, free of charge and under the terms of this License, through a
490
+ publicly available network server or other readily accessible means,
491
+ then you must either (1) cause the Corresponding Source to be so
492
+ available, or (2) arrange to deprive yourself of the benefit of the
493
+ patent license for this particular work, or (3) arrange, in a manner
494
+ consistent with the requirements of this License, to extend the patent
495
+ license to downstream recipients. "Knowingly relying" means you have
496
+ actual knowledge that, but for the patent license, your conveying the
497
+ covered work in a country, or your recipient's use of the covered work
498
+ in a country, would infringe one or more identifiable patents in that
499
+ country that you have reason to believe are valid.
500
+
501
+ If, pursuant to or in connection with a single transaction or
502
+ arrangement, you convey, or propagate by procuring conveyance of, a
503
+ covered work, and grant a patent license to some of the parties
504
+ receiving the covered work authorizing them to use, propagate, modify
505
+ or convey a specific copy of the covered work, then the patent license
506
+ you grant is automatically extended to all recipients of the covered
507
+ work and works based on it.
508
+
509
+ A patent license is "discriminatory" if it does not include within
510
+ the scope of its coverage, prohibits the exercise of, or is
511
+ conditioned on the non-exercise of one or more of the rights that are
512
+ specifically granted under this License. You may not convey a covered
513
+ work if you are a party to an arrangement with a third party that is
514
+ in the business of distributing software, under which you make payment
515
+ to the third party based on the extent of your activity of conveying
516
+ the work, and under which the third party grants, to any of the
517
+ parties who would receive the covered work from you, a discriminatory
518
+ patent license (a) in connection with copies of the covered work
519
+ conveyed by you (or copies made from those copies), or (b) primarily
520
+ for and in connection with specific products or compilations that
521
+ contain the covered work, unless you entered into that arrangement,
522
+ or that patent license was granted, prior to 28 March 2007.
523
+
524
+ Nothing in this License shall be construed as excluding or limiting
525
+ any implied license or other defenses to infringement that may
526
+ otherwise be available to you under applicable patent law.
527
+
528
+ 12. No Surrender of Others' Freedom.
529
+
530
+ If conditions are imposed on you (whether by court order, agreement or
531
+ otherwise) that contradict the conditions of this License, they do not
532
+ excuse you from the conditions of this License. If you cannot convey a
533
+ covered work so as to satisfy simultaneously your obligations under this
534
+ License and any other pertinent obligations, then as a consequence you may
535
+ not convey it at all. For example, if you agree to terms that obligate you
536
+ to collect a royalty for further conveying from those to whom you convey
537
+ the Program, the only way you could satisfy both those terms and this
538
+ License would be to refrain entirely from conveying the Program.
539
+
540
+ 13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
552
+
553
+ Notwithstanding any other provision of this License, you have
554
+ permission to link or combine any covered work with a work licensed
555
+ under version 3 of the GNU General Public License into a single
556
+ combined work, and to convey the resulting work. The terms of this
557
+ License will continue to apply to the part which is the covered work,
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
560
+
561
+ 14. Revised Versions of this License.
562
+
563
+ The Free Software Foundation may publish revised and/or new versions of
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
566
+ address new problems or concerns.
567
+
568
+ Each version is given a distinguishing version number. If the
569
+ Program specifies that a certain numbered version of the GNU Affero General
570
+ Public License "or any later version" applies to it, you have the
571
+ option of following the terms and conditions either of that numbered
572
+ version or of any later version published by the Free Software
573
+ Foundation. If the Program does not specify a version number of the
574
+ GNU Affero General Public License, you may choose any version ever published
575
+ by the Free Software Foundation.
576
+
577
+ If the Program specifies that a proxy can decide which future
578
+ versions of the GNU Affero General Public License can be used, that proxy's
579
+ public statement of acceptance of a version permanently authorizes you
580
+ to choose that version for the Program.
581
+
582
+ Later license versions may give you additional or different
583
+ permissions. However, no additional obligations are imposed on any
584
+ author or copyright holder as a result of your choosing to follow a
585
+ later version.
586
+
587
+ 15. Disclaimer of Warranty.
588
+
589
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597
+
598
+ 16. Limitation of Liability.
599
+
600
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608
+ SUCH DAMAGES.
609
+
610
+ 17. Interpretation of Sections 15 and 16.
611
+
612
+ If the disclaimer of warranty and limitation of liability provided
613
+ above cannot be given local legal effect according to their terms,
614
+ reviewing courts shall apply local law that most closely approximates
615
+ an absolute waiver of all civil liability in connection with the
616
+ Program, unless a warranty or assumption of liability accompanies a
617
+ copy of the Program in return for a fee.
618
+
619
+ END OF TERMS AND CONDITIONS
620
+
621
+ How to Apply These Terms to Your New Programs
622
+
623
+ If you develop a new program, and you want it to be of the greatest
624
+ possible use to the public, the best way to achieve this is to make it
625
+ free software which everyone can redistribute and change under these terms.
626
+
627
+ To do so, attach the following notices to the program. It is safest
628
+ to attach them to the start of each source file to most effectively
629
+ state the exclusion of warranty; and each file should have at least
630
+ the "copyright" line and a pointer to where the full notice is found.
631
+
632
+ <one line to give the program's name and a brief idea of what it does.>
633
+ Copyright (C) <year> <name of author>
634
+
635
+ This program is free software: you can redistribute it and/or modify
636
+ it under the terms of the GNU Affero General Public License as published by
637
+ the Free Software Foundation, either version 3 of the License, or
638
+ (at your option) any later version.
639
+
640
+ This program is distributed in the hope that it will be useful,
641
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
642
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643
+ GNU Affero General Public License for more details.
644
+
645
+ You should have received a copy of the GNU Affero General Public License
646
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
647
+
648
+ Also add information on how to contact you by electronic and paper mail.
649
+
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
657
+
658
+ You should also get your employer (if you work as a programmer) or school,
659
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
661
+ <https://www.gnu.org/licenses/>.
README.md CHANGED
@@ -1,12 +1,477 @@
1
- ---
2
- title: LS
3
- emoji: 🌖
4
- colorFrom: pink
5
- colorTo: yellow
6
- sdk: gradio
7
- sdk_version: 4.28.3
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div align="center">
2
+ <p>
3
+ <a href="https://yolovision.ultralytics.com/" target="_blank">
4
+ <img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-yolo-vision-2023.png"></a>
5
+ <!--
6
+ <a align="center" href="https://ultralytics.com/yolov5" target="_blank">
7
+ <img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov5/v70/splash.png"></a>
8
+ -->
9
+ </p>
10
+
11
+ [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [हिन्दी](https://docs.ultralytics.com/hi/) | [العربية](https://docs.ultralytics.com/ar/)
12
+
13
+ <div>
14
+ <a href="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml"><img src="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml/badge.svg" alt="YOLOv5 CI"></a>
15
+ <a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="YOLOv5 Citation"></a>
16
+ <a href="https://hub.docker.com/r/ultralytics/yolov5"><img src="https://img.shields.io/docker/pulls/ultralytics/yolov5?logo=docker" alt="Docker Pulls"></a>
17
+ <br>
18
+ <a href="https://bit.ly/yolov5-paperspace-notebook"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a>
19
+ <a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
20
+ <a href="https://www.kaggle.com/ultralytics/yolov5"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
21
+ </div>
22
+ <br>
23
+
24
+ YOLOv5 🚀 is the world's most loved vision AI, representing <a href="https://ultralytics.com">Ultralytics</a> open-source research into future vision AI methods, incorporating lessons learned and best practices evolved over thousands of hours of research and development.
25
+
26
+ We hope that the resources here will help you get the most out of YOLOv5. Please browse the YOLOv5 <a href="https://docs.ultralytics.com/yolov5">Docs</a> for details, raise an issue on <a href="https://github.com/ultralytics/yolov5/issues/new/choose">GitHub</a> for support, and join our <a href="https://ultralytics.com/discord">Discord</a> community for questions and discussions!
27
+
28
+ To request an Enterprise License please complete the form at [Ultralytics Licensing](https://ultralytics.com/license).
29
+
30
+ <div align="center">
31
+ <a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
32
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
33
+ <a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="2%" alt="Ultralytics LinkedIn"></a>
34
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
35
+ <a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="2%" alt="Ultralytics Twitter"></a>
36
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
37
+ <a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="2%" alt="Ultralytics YouTube"></a>
38
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
39
+ <a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="2%" alt="Ultralytics TikTok"></a>
40
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
41
+ <a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="2%" alt="Ultralytics Instagram"></a>
42
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
43
+ <a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="2%" alt="Ultralytics Discord"></a>
44
+ </div>
45
+
46
+ </div>
47
+ <br>
48
+
49
+ ## <div align="center">YOLOv8 🚀 NEW</div>
50
+
51
+ We are thrilled to announce the launch of Ultralytics YOLOv8 🚀, our NEW cutting-edge, state-of-the-art (SOTA) model released at **[https://github.com/ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)**. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection, image segmentation and image classification tasks.
52
+
53
+ See the [YOLOv8 Docs](https://docs.ultralytics.com) for details and get started with:
54
+
55
+ [![PyPI version](https://badge.fury.io/py/ultralytics.svg)](https://badge.fury.io/py/ultralytics) [![Downloads](https://static.pepy.tech/badge/ultralytics)](https://pepy.tech/project/ultralytics)
56
+
57
+ ```bash
58
+ pip install ultralytics
59
+ ```
60
+
61
+ <div align="center">
62
+ <a href="https://ultralytics.com/yolov8" target="_blank">
63
+ <img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/yolo-comparison-plots.png"></a>
64
+ </div>
65
+
66
+ ## <div align="center">Documentation</div>
67
+
68
+ See the [YOLOv5 Docs](https://docs.ultralytics.com/yolov5) for full documentation on training, testing and deployment. See below for quickstart examples.
69
+
70
+ <details open>
71
+ <summary>Install</summary>
72
+
73
+ Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a
74
+ [**Python>=3.8.0**](https://www.python.org/) environment, including
75
+ [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
76
+
77
+ ```bash
78
+ git clone https://github.com/ultralytics/yolov5 # clone
79
+ cd yolov5
80
+ pip install -r requirements.txt # install
81
+ ```
82
+
83
+ </details>
84
+
85
+ <details>
86
+ <summary>Inference</summary>
87
+
88
+ YOLOv5 [PyTorch Hub](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading) inference. [Models](https://github.com/ultralytics/yolov5/tree/master/models) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
89
+
90
+ ```python
91
+ import torch
92
+
93
+ # Model
94
+ model = torch.hub.load("ultralytics/yolov5", "yolov5s") # or yolov5n - yolov5x6, custom
95
+
96
+ # Images
97
+ img = "https://ultralytics.com/images/zidane.jpg" # or file, Path, PIL, OpenCV, numpy, list
98
+
99
+ # Inference
100
+ results = model(img)
101
+
102
+ # Results
103
+ results.print() # or .show(), .save(), .crop(), .pandas(), etc.
104
+ ```
105
+
106
+ </details>
107
+
108
+ <details>
109
+ <summary>Inference with detect.py</summary>
110
+
111
+ `detect.py` runs inference on a variety of sources, downloading [models](https://github.com/ultralytics/yolov5/tree/master/models) automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) and saving results to `runs/detect`.
112
+
113
+ ```bash
114
+ python detect.py --weights yolov5s.pt --source 0 # webcam
115
+ img.jpg # image
116
+ vid.mp4 # video
117
+ screen # screenshot
118
+ path/ # directory
119
+ list.txt # list of images
120
+ list.streams # list of streams
121
+ 'path/*.jpg' # glob
122
+ 'https://youtu.be/LNwODJXcvt4' # YouTube
123
+ 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
124
+ ```
125
+
126
+ </details>
127
+
128
+ <details>
129
+ <summary>Training</summary>
130
+
131
+ The commands below reproduce YOLOv5 [COCO](https://github.com/ultralytics/yolov5/blob/master/data/scripts/get_coco.sh)
132
+ results. [Models](https://github.com/ultralytics/yolov5/tree/master/models)
133
+ and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases). Training times for YOLOv5n/s/m/l/x are 1/2/4/6/8 days on a V100 GPU ([Multi-GPU](https://docs.ultralytics.com/yolov5/tutorials/multi_gpu_training) times faster). Use the largest `--batch-size` possible, or pass `--batch-size -1` for YOLOv5 [AutoBatch](https://github.com/ultralytics/yolov5/pull/5092). Batch sizes shown for V100-16GB.
134
+
135
+ ```bash
136
+ python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5n.yaml --batch-size 128
137
+ yolov5s 64
138
+ yolov5m 40
139
+ yolov5l 24
140
+ yolov5x 16
141
+ ```
142
+
143
+ <img width="800" src="https://user-images.githubusercontent.com/26833433/90222759-949d8800-ddc1-11ea-9fa1-1c97eed2b963.png">
144
+
145
+ </details>
146
+
147
+ <details open>
148
+ <summary>Tutorials</summary>
149
+
150
+ - [Train Custom Data](https://docs.ultralytics.com/yolov5/tutorials/train_custom_data) 🚀 RECOMMENDED
151
+ - [Tips for Best Training Results](https://docs.ultralytics.com/yolov5/tutorials/tips_for_best_training_results) ☘️
152
+ - [Multi-GPU Training](https://docs.ultralytics.com/yolov5/tutorials/multi_gpu_training)
153
+ - [PyTorch Hub](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading) 🌟 NEW
154
+ - [TFLite, ONNX, CoreML, TensorRT Export](https://docs.ultralytics.com/yolov5/tutorials/model_export) 🚀
155
+ - [NVIDIA Jetson platform Deployment](https://docs.ultralytics.com/yolov5/tutorials/running_on_jetson_nano) 🌟 NEW
156
+ - [Test-Time Augmentation (TTA)](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation)
157
+ - [Model Ensembling](https://docs.ultralytics.com/yolov5/tutorials/model_ensembling)
158
+ - [Model Pruning/Sparsity](https://docs.ultralytics.com/yolov5/tutorials/model_pruning_and_sparsity)
159
+ - [Hyperparameter Evolution](https://docs.ultralytics.com/yolov5/tutorials/hyperparameter_evolution)
160
+ - [Transfer Learning with Frozen Layers](https://docs.ultralytics.com/yolov5/tutorials/transfer_learning_with_frozen_layers)
161
+ - [Architecture Summary](https://docs.ultralytics.com/yolov5/tutorials/architecture_description) 🌟 NEW
162
+ - [Roboflow for Datasets, Labeling, and Active Learning](https://docs.ultralytics.com/yolov5/tutorials/roboflow_datasets_integration)
163
+ - [ClearML Logging](https://docs.ultralytics.com/yolov5/tutorials/clearml_logging_integration) 🌟 NEW
164
+ - [YOLOv5 with Neural Magic's Deepsparse](https://docs.ultralytics.com/yolov5/tutorials/neural_magic_pruning_quantization) 🌟 NEW
165
+ - [Comet Logging](https://docs.ultralytics.com/yolov5/tutorials/comet_logging_integration) 🌟 NEW
166
+
167
+ </details>
168
+
169
+ ## <div align="center">Integrations</div>
170
+
171
+ <br>
172
+ <a align="center" href="https://bit.ly/ultralytics_hub" target="_blank">
173
+ <img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/integrations-loop.png"></a>
174
+ <br>
175
+ <br>
176
+
177
+ <div align="center">
178
+ <a href="https://roboflow.com/?ref=ultralytics">
179
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-roboflow.png" width="10%" /></a>
180
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="" />
181
+ <a href="https://cutt.ly/yolov5-readme-clearml">
182
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-clearml.png" width="10%" /></a>
183
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="" />
184
+ <a href="https://bit.ly/yolov5-readme-comet2">
185
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-comet.png" width="10%" /></a>
186
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="" />
187
+ <a href="https://bit.ly/yolov5-neuralmagic">
188
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-neuralmagic.png" width="10%" /></a>
189
+ </div>
190
+
191
+ | Roboflow | ClearML ⭐ NEW | Comet ⭐ NEW | Neural Magic ⭐ NEW |
192
+ | :--------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------: |
193
+ | Label and export your custom datasets directly to YOLOv5 for training with [Roboflow](https://roboflow.com/?ref=ultralytics) | Automatically track, visualize and even remotely train YOLOv5 using [ClearML](https://cutt.ly/yolov5-readme-clearml) (open-source!) | Free forever, [Comet](https://bit.ly/yolov5-readme-comet2) lets you save YOLOv5 models, resume training, and interactively visualise and debug predictions | Run YOLOv5 inference up to 6x faster with [Neural Magic DeepSparse](https://bit.ly/yolov5-neuralmagic) |
194
+
195
+ ## <div align="center">Ultralytics HUB</div>
196
+
197
+ Experience seamless AI with [Ultralytics HUB](https://bit.ly/ultralytics_hub) ⭐, the all-in-one solution for data visualization, YOLOv5 and YOLOv8 🚀 model training and deployment, without any coding. Transform images into actionable insights and bring your AI visions to life with ease using our cutting-edge platform and user-friendly [Ultralytics App](https://ultralytics.com/app_install). Start your journey for **Free** now!
198
+
199
+ <a align="center" href="https://bit.ly/ultralytics_hub" target="_blank">
200
+ <img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/ultralytics-hub.png"></a>
201
+
202
+ ## <div align="center">Why YOLOv5</div>
203
+
204
+ YOLOv5 has been designed to be super easy to get started and simple to learn. We prioritize real-world results.
205
+
206
+ <p align="left"><img width="800" src="https://user-images.githubusercontent.com/26833433/155040763-93c22a27-347c-4e3c-847a-8094621d3f4e.png"></p>
207
+ <details>
208
+ <summary>YOLOv5-P5 640 Figure</summary>
209
+
210
+ <p align="left"><img width="800" src="https://user-images.githubusercontent.com/26833433/155040757-ce0934a3-06a6-43dc-a979-2edbbd69ea0e.png"></p>
211
+ </details>
212
+ <details>
213
+ <summary>Figure Notes</summary>
214
+
215
+ - **COCO AP val** denotes mAP@0.5:0.95 metric measured on the 5000-image [COCO val2017](http://cocodataset.org) dataset over various inference sizes from 256 to 1536.
216
+ - **GPU Speed** measures average inference time per image on [COCO val2017](http://cocodataset.org) dataset using a [AWS p3.2xlarge](https://aws.amazon.com/ec2/instance-types/p3/) V100 instance at batch-size 32.
217
+ - **EfficientDet** data from [google/automl](https://github.com/google/automl) at batch size 8.
218
+ - **Reproduce** by `python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n6.pt yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.pt`
219
+
220
+ </details>
221
+
222
+ ### Pretrained Checkpoints
223
+
224
+ | Model | size<br><sup>(pixels) | mAP<sup>val<br>50-95 | mAP<sup>val<br>50 | Speed<br><sup>CPU b1<br>(ms) | Speed<br><sup>V100 b1<br>(ms) | Speed<br><sup>V100 b32<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>@640 (B) |
225
+ | ----------------------------------------------------------------------------------------------- | --------------------- | -------------------- | ----------------- | ---------------------------- | ----------------------------- | ------------------------------ | ------------------ | ---------------------- |
226
+ | [YOLOv5n](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n.pt) | 640 | 28.0 | 45.7 | **45** | **6.3** | **0.6** | **1.9** | **4.5** |
227
+ | [YOLOv5s](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s.pt) | 640 | 37.4 | 56.8 | 98 | 6.4 | 0.9 | 7.2 | 16.5 |
228
+ | [YOLOv5m](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m.pt) | 640 | 45.4 | 64.1 | 224 | 8.2 | 1.7 | 21.2 | 49.0 |
229
+ | [YOLOv5l](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l.pt) | 640 | 49.0 | 67.3 | 430 | 10.1 | 2.7 | 46.5 | 109.1 |
230
+ | [YOLOv5x](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x.pt) | 640 | 50.7 | 68.9 | 766 | 12.1 | 4.8 | 86.7 | 205.7 |
231
+ | | | | | | | | | |
232
+ | [YOLOv5n6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n6.pt) | 1280 | 36.0 | 54.4 | 153 | 8.1 | 2.1 | 3.2 | 4.6 |
233
+ | [YOLOv5s6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s6.pt) | 1280 | 44.8 | 63.7 | 385 | 8.2 | 3.6 | 12.6 | 16.8 |
234
+ | [YOLOv5m6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m6.pt) | 1280 | 51.3 | 69.3 | 887 | 11.1 | 6.8 | 35.7 | 50.0 |
235
+ | [YOLOv5l6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l6.pt) | 1280 | 53.7 | 71.3 | 1784 | 15.8 | 10.5 | 76.8 | 111.4 |
236
+ | [YOLOv5x6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x6.pt)<br>+ [TTA] | 1280<br>1536 | 55.0<br>**55.8** | 72.7<br>**72.7** | 3136<br>- | 26.2<br>- | 19.4<br>- | 140.7<br>- | 209.8<br>- |
237
+
238
+ <details>
239
+ <summary>Table Notes</summary>
240
+
241
+ - All checkpoints are trained to 300 epochs with default settings. Nano and Small models use [hyp.scratch-low.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-low.yaml) hyps, all others use [hyp.scratch-high.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-high.yaml).
242
+ - **mAP<sup>val</sup>** values are for single-model single-scale on [COCO val2017](http://cocodataset.org) dataset.<br>Reproduce by `python val.py --data coco.yaml --img 640 --conf 0.001 --iou 0.65`
243
+ - **Speed** averaged over COCO val images using a [AWS p3.2xlarge](https://aws.amazon.com/ec2/instance-types/p3/) instance. NMS times (~1 ms/img) not included.<br>Reproduce by `python val.py --data coco.yaml --img 640 --task speed --batch 1`
244
+ - **TTA** [Test Time Augmentation](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation) includes reflection and scale augmentations.<br>Reproduce by `python val.py --data coco.yaml --img 1536 --iou 0.7 --augment`
245
+
246
+ </details>
247
+
248
+ ## <div align="center">Segmentation</div>
249
+
250
+ Our new YOLOv5 [release v7.0](https://github.com/ultralytics/yolov5/releases/v7.0) instance segmentation models are the fastest and most accurate in the world, beating all current [SOTA benchmarks](https://paperswithcode.com/sota/real-time-instance-segmentation-on-mscoco). We've made them super simple to train, validate and deploy. See full details in our [Release Notes](https://github.com/ultralytics/yolov5/releases/v7.0) and visit our [YOLOv5 Segmentation Colab Notebook](https://github.com/ultralytics/yolov5/blob/master/segment/tutorial.ipynb) for quickstart tutorials.
251
+
252
+ <details>
253
+ <summary>Segmentation Checkpoints</summary>
254
+
255
+ <div align="center">
256
+ <a align="center" href="https://ultralytics.com/yolov5" target="_blank">
257
+ <img width="800" src="https://user-images.githubusercontent.com/61612323/204180385-84f3aca9-a5e9-43d8-a617-dda7ca12e54a.png"></a>
258
+ </div>
259
+
260
+ We trained YOLOv5 segmentations models on COCO for 300 epochs at image size 640 using A100 GPUs. We exported all models to ONNX FP32 for CPU speed tests and to TensorRT FP16 for GPU speed tests. We ran all speed tests on Google [Colab Pro](https://colab.research.google.com/signup) notebooks for easy reproducibility.
261
+
262
+ | Model | size<br><sup>(pixels) | mAP<sup>box<br>50-95 | mAP<sup>mask<br>50-95 | Train time<br><sup>300 epochs<br>A100 (hours) | Speed<br><sup>ONNX CPU<br>(ms) | Speed<br><sup>TRT A100<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>@640 (B) |
263
+ | ------------------------------------------------------------------------------------------ | --------------------- | -------------------- | --------------------- | --------------------------------------------- | ------------------------------ | ------------------------------ | ------------------ | ---------------------- |
264
+ | [YOLOv5n-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n-seg.pt) | 640 | 27.6 | 23.4 | 80:17 | **62.7** | **1.2** | **2.0** | **7.1** |
265
+ | [YOLOv5s-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s-seg.pt) | 640 | 37.6 | 31.7 | 88:16 | 173.3 | 1.4 | 7.6 | 26.4 |
266
+ | [YOLOv5m-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m-seg.pt) | 640 | 45.0 | 37.1 | 108:36 | 427.0 | 2.2 | 22.0 | 70.8 |
267
+ | [YOLOv5l-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l-seg.pt) | 640 | 49.0 | 39.9 | 66:43 (2x) | 857.4 | 2.9 | 47.9 | 147.7 |
268
+ | [YOLOv5x-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x-seg.pt) | 640 | **50.7** | **41.4** | 62:56 (3x) | 1579.2 | 4.5 | 88.8 | 265.7 |
269
+
270
+ - All checkpoints are trained to 300 epochs with SGD optimizer with `lr0=0.01` and `weight_decay=5e-5` at image size 640 and all default settings.<br>Runs logged to https://wandb.ai/glenn-jocher/YOLOv5_v70_official
271
+ - **Accuracy** values are for single-model single-scale on COCO dataset.<br>Reproduce by `python segment/val.py --data coco.yaml --weights yolov5s-seg.pt`
272
+ - **Speed** averaged over 100 inference images using a [Colab Pro](https://colab.research.google.com/signup) A100 High-RAM instance. Values indicate inference speed only (NMS adds about 1ms per image). <br>Reproduce by `python segment/val.py --data coco.yaml --weights yolov5s-seg.pt --batch 1`
273
+ - **Export** to ONNX at FP32 and TensorRT at FP16 done with `export.py`. <br>Reproduce by `python export.py --weights yolov5s-seg.pt --include engine --device 0 --half`
274
+
275
+ </details>
276
+
277
+ <details>
278
+ <summary>Segmentation Usage Examples &nbsp;<a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/segment/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></summary>
279
+
280
+ ### Train
281
+
282
+ YOLOv5 segmentation training supports auto-download COCO128-seg segmentation dataset with `--data coco128-seg.yaml` argument and manual download of COCO-segments dataset with `bash data/scripts/get_coco.sh --train --val --segments` and then `python train.py --data coco.yaml`.
283
+
284
+ ```bash
285
+ # Single-GPU
286
+ python segment/train.py --data coco128-seg.yaml --weights yolov5s-seg.pt --img 640
287
+
288
+ # Multi-GPU DDP
289
+ python -m torch.distributed.run --nproc_per_node 4 --master_port 1 segment/train.py --data coco128-seg.yaml --weights yolov5s-seg.pt --img 640 --device 0,1,2,3
290
+ ```
291
+
292
+ ### Val
293
+
294
+ Validate YOLOv5s-seg mask mAP on COCO dataset:
295
+
296
+ ```bash
297
+ bash data/scripts/get_coco.sh --val --segments # download COCO val segments split (780MB, 5000 images)
298
+ python segment/val.py --weights yolov5s-seg.pt --data coco.yaml --img 640 # validate
299
+ ```
300
+
301
+ ### Predict
302
+
303
+ Use pretrained YOLOv5m-seg.pt to predict bus.jpg:
304
+
305
+ ```bash
306
+ python segment/predict.py --weights yolov5m-seg.pt --source data/images/bus.jpg
307
+ ```
308
+
309
+ ```python
310
+ model = torch.hub.load(
311
+ "ultralytics/yolov5", "custom", "yolov5m-seg.pt"
312
+ ) # load from PyTorch Hub (WARNING: inference not yet supported)
313
+ ```
314
+
315
+ | ![zidane](https://user-images.githubusercontent.com/26833433/203113421-decef4c4-183d-4a0a-a6c2-6435b33bc5d3.jpg) | ![bus](https://user-images.githubusercontent.com/26833433/203113416-11fe0025-69f7-4874-a0a6-65d0bfe2999a.jpg) |
316
+ | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
317
+
318
+ ### Export
319
+
320
+ Export YOLOv5s-seg model to ONNX and TensorRT:
321
+
322
+ ```bash
323
+ python export.py --weights yolov5s-seg.pt --include onnx engine --img 640 --device 0
324
+ ```
325
+
326
+ </details>
327
+
328
+ ## <div align="center">Classification</div>
329
+
330
+ YOLOv5 [release v6.2](https://github.com/ultralytics/yolov5/releases) brings support for classification model training, validation and deployment! See full details in our [Release Notes](https://github.com/ultralytics/yolov5/releases/v6.2) and visit our [YOLOv5 Classification Colab Notebook](https://github.com/ultralytics/yolov5/blob/master/classify/tutorial.ipynb) for quickstart tutorials.
331
+
332
+ <details>
333
+ <summary>Classification Checkpoints</summary>
334
+
335
+ <br>
336
+
337
+ We trained YOLOv5-cls classification models on ImageNet for 90 epochs using a 4xA100 instance, and we trained ResNet and EfficientNet models alongside with the same default training settings to compare. We exported all models to ONNX FP32 for CPU speed tests and to TensorRT FP16 for GPU speed tests. We ran all speed tests on Google [Colab Pro](https://colab.research.google.com/signup) for easy reproducibility.
338
+
339
+ | Model | size<br><sup>(pixels) | acc<br><sup>top1 | acc<br><sup>top5 | Training<br><sup>90 epochs<br>4xA100 (hours) | Speed<br><sup>ONNX CPU<br>(ms) | Speed<br><sup>TensorRT V100<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>@224 (B) |
340
+ | -------------------------------------------------------------------------------------------------- | --------------------- | ---------------- | ---------------- | -------------------------------------------- | ------------------------------ | ----------------------------------- | ------------------ | ---------------------- |
341
+ | [YOLOv5n-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n-cls.pt) | 224 | 64.6 | 85.4 | 7:59 | **3.3** | **0.5** | **2.5** | **0.5** |
342
+ | [YOLOv5s-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s-cls.pt) | 224 | 71.5 | 90.2 | 8:09 | 6.6 | 0.6 | 5.4 | 1.4 |
343
+ | [YOLOv5m-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m-cls.pt) | 224 | 75.9 | 92.9 | 10:06 | 15.5 | 0.9 | 12.9 | 3.9 |
344
+ | [YOLOv5l-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l-cls.pt) | 224 | 78.0 | 94.0 | 11:56 | 26.9 | 1.4 | 26.5 | 8.5 |
345
+ | [YOLOv5x-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x-cls.pt) | 224 | **79.0** | **94.4** | 15:04 | 54.3 | 1.8 | 48.1 | 15.9 |
346
+ | | | | | | | | | |
347
+ | [ResNet18](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet18.pt) | 224 | 70.3 | 89.5 | **6:47** | 11.2 | 0.5 | 11.7 | 3.7 |
348
+ | [ResNet34](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet34.pt) | 224 | 73.9 | 91.8 | 8:33 | 20.6 | 0.9 | 21.8 | 7.4 |
349
+ | [ResNet50](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet50.pt) | 224 | 76.8 | 93.4 | 11:10 | 23.4 | 1.0 | 25.6 | 8.5 |
350
+ | [ResNet101](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet101.pt) | 224 | 78.5 | 94.3 | 17:10 | 42.1 | 1.9 | 44.5 | 15.9 |
351
+ | | | | | | | | | |
352
+ | [EfficientNet_b0](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b0.pt) | 224 | 75.1 | 92.4 | 13:03 | 12.5 | 1.3 | 5.3 | 1.0 |
353
+ | [EfficientNet_b1](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b1.pt) | 224 | 76.4 | 93.2 | 17:04 | 14.9 | 1.6 | 7.8 | 1.5 |
354
+ | [EfficientNet_b2](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b2.pt) | 224 | 76.6 | 93.4 | 17:10 | 15.9 | 1.6 | 9.1 | 1.7 |
355
+ | [EfficientNet_b3](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b3.pt) | 224 | 77.7 | 94.0 | 19:19 | 18.9 | 1.9 | 12.2 | 2.4 |
356
+
357
+ <details>
358
+ <summary>Table Notes (click to expand)</summary>
359
+
360
+ - All checkpoints are trained to 90 epochs with SGD optimizer with `lr0=0.001` and `weight_decay=5e-5` at image size 224 and all default settings.<br>Runs logged to https://wandb.ai/glenn-jocher/YOLOv5-Classifier-v6-2
361
+ - **Accuracy** values are for single-model single-scale on [ImageNet-1k](https://www.image-net.org/index.php) dataset.<br>Reproduce by `python classify/val.py --data ../datasets/imagenet --img 224`
362
+ - **Speed** averaged over 100 inference images using a Google [Colab Pro](https://colab.research.google.com/signup) V100 High-RAM instance.<br>Reproduce by `python classify/val.py --data ../datasets/imagenet --img 224 --batch 1`
363
+ - **Export** to ONNX at FP32 and TensorRT at FP16 done with `export.py`. <br>Reproduce by `python export.py --weights yolov5s-cls.pt --include engine onnx --imgsz 224`
364
+
365
+ </details>
366
+ </details>
367
+
368
+ <details>
369
+ <summary>Classification Usage Examples &nbsp;<a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/classify/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></summary>
370
+
371
+ ### Train
372
+
373
+ YOLOv5 classification training supports auto-download of MNIST, Fashion-MNIST, CIFAR10, CIFAR100, Imagenette, Imagewoof, and ImageNet datasets with the `--data` argument. To start training on MNIST for example use `--data mnist`.
374
+
375
+ ```bash
376
+ # Single-GPU
377
+ python classify/train.py --model yolov5s-cls.pt --data cifar100 --epochs 5 --img 224 --batch 128
378
+
379
+ # Multi-GPU DDP
380
+ python -m torch.distributed.run --nproc_per_node 4 --master_port 1 classify/train.py --model yolov5s-cls.pt --data imagenet --epochs 5 --img 224 --device 0,1,2,3
381
+ ```
382
+
383
+ ### Val
384
+
385
+ Validate YOLOv5m-cls accuracy on ImageNet-1k dataset:
386
+
387
+ ```bash
388
+ bash data/scripts/get_imagenet.sh --val # download ImageNet val split (6.3G, 50000 images)
389
+ python classify/val.py --weights yolov5m-cls.pt --data ../datasets/imagenet --img 224 # validate
390
+ ```
391
+
392
+ ### Predict
393
+
394
+ Use pretrained YOLOv5s-cls.pt to predict bus.jpg:
395
+
396
+ ```bash
397
+ python classify/predict.py --weights yolov5s-cls.pt --source data/images/bus.jpg
398
+ ```
399
+
400
+ ```python
401
+ model = torch.hub.load(
402
+ "ultralytics/yolov5", "custom", "yolov5s-cls.pt"
403
+ ) # load from PyTorch Hub
404
+ ```
405
+
406
+ ### Export
407
+
408
+ Export a group of trained YOLOv5s-cls, ResNet and EfficientNet models to ONNX and TensorRT:
409
+
410
+ ```bash
411
+ python export.py --weights yolov5s-cls.pt resnet50.pt efficientnet_b0.pt --include onnx engine --img 224
412
+ ```
413
+
414
+ </details>
415
+
416
+ ## <div align="center">Environments</div>
417
+
418
+ Get started in seconds with our verified environments. Click each icon below for details.
419
+
420
+ <div align="center">
421
+ <a href="https://bit.ly/yolov5-paperspace-notebook">
422
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-gradient.png" width="10%" /></a>
423
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
424
+ <a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb">
425
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-colab-small.png" width="10%" /></a>
426
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
427
+ <a href="https://www.kaggle.com/ultralytics/yolov5">
428
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-kaggle-small.png" width="10%" /></a>
429
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
430
+ <a href="https://hub.docker.com/r/ultralytics/yolov5">
431
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-docker-small.png" width="10%" /></a>
432
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
433
+ <a href="https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/">
434
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-aws-small.png" width="10%" /></a>
435
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
436
+ <a href="https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/">
437
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-gcp-small.png" width="10%" /></a>
438
+ </div>
439
+
440
+ ## <div align="center">Contribute</div>
441
+
442
+ We love your input! We want to make contributing to YOLOv5 as easy and transparent as possible. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) to get started, and fill out the [YOLOv5 Survey](https://ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) to send us feedback on your experiences. Thank you to all our contributors!
443
+
444
+ <!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=990 -->
445
+
446
+ <a href="https://github.com/ultralytics/yolov5/graphs/contributors">
447
+ <img src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" /></a>
448
+
449
+ ## <div align="center">License</div>
450
+
451
+ Ultralytics offers two licensing options to accommodate diverse use cases:
452
+
453
+ - **AGPL-3.0 License**: This [OSI-approved](https://opensource.org/licenses/) open-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/yolov5/blob/master/LICENSE) file for more details.
454
+ - **Enterprise License**: Designed for commercial use, this license permits seamless integration of Ultralytics software and AI models into commercial goods and services, bypassing the open-source requirements of AGPL-3.0. If your scenario involves embedding our solutions into a commercial offering, reach out through [Ultralytics Licensing](https://ultralytics.com/license).
455
+
456
+ ## <div align="center">Contact</div>
457
+
458
+ For YOLOv5 bug reports and feature requests please visit [GitHub Issues](https://github.com/ultralytics/yolov5/issues), and join our [Discord](https://ultralytics.com/discord) community for questions and discussions!
459
+
460
+ <br>
461
+ <div align="center">
462
+ <a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
463
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
464
+ <a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
465
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
466
+ <a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
467
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
468
+ <a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
469
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
470
+ <a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
471
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
472
+ <a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="Ultralytics Instagram"></a>
473
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
474
+ <a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
475
+ </div>
476
+
477
+ [tta]: https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation
README.zh-CN.md ADDED
@@ -0,0 +1,473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div align="center">
2
+ <p>
3
+ <a href="https://yolovision.ultralytics.com/" target="_blank">
4
+ <img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-yolo-vision-2023.png"></a>
5
+ <!--
6
+ <a align="center" href="https://ultralytics.com/yolov5" target="_blank">
7
+ <img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov5/v70/splash.png"></a>
8
+ -->
9
+ </p>
10
+
11
+ [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [हिन्दी](https://docs.ultralytics.com/hi/) | [العربية](https://docs.ultralytics.com/ar/)
12
+
13
+ <div>
14
+ <a href="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml"><img src="https://github.com/ultralytics/yolov5/actions/workflows/ci-testing.yml/badge.svg" alt="YOLOv5 CI"></a>
15
+ <a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="YOLOv5 Citation"></a>
16
+ <a href="https://hub.docker.com/r/ultralytics/yolov5"><img src="https://img.shields.io/docker/pulls/ultralytics/yolov5?logo=docker" alt="Docker Pulls"></a>
17
+ <br>
18
+ <a href="https://bit.ly/yolov5-paperspace-notebook"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a>
19
+ <a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
20
+ <a href="https://www.kaggle.com/ultralytics/yolov5"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
21
+ </div>
22
+ <br>
23
+
24
+ YOLOv5 🚀 是世界上最受欢迎的视觉 AI,代表<a href="https://ultralytics.com"> Ultralytics </a>对未来视觉 AI 方法的开源研究,结合在数千小时的研究和开发中积累的经验教训和最佳实践。
25
+
26
+ 我们希望这里的资源能帮助您充分利用 YOLOv5。请浏览 YOLOv5 <a href="https://docs.ultralytics.com/yolov5/">文档</a> 了解详细信息,在 <a href="https://github.com/ultralytics/yolov5/issues/new/choose">GitHub</a> 上提交问题以获得支持,并加入我们的 <a href="https://ultralytics.com/discord">Discord</a> 社区进行问题和讨论!
27
+
28
+ 如需申请企业许可,请在 [Ultralytics Licensing](https://ultralytics.com/license) 处填写表格
29
+
30
+ <div align="center">
31
+ <a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
32
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
33
+ <a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="2%" alt="Ultralytics LinkedIn"></a>
34
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
35
+ <a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="2%" alt="Ultralytics Twitter"></a>
36
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
37
+ <a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="2%" alt="Ultralytics YouTube"></a>
38
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
39
+ <a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="2%" alt="Ultralytics TikTok"></a>
40
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
41
+ <a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="2%" alt="Ultralytics Instagram"></a>
42
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%">
43
+ <a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="2%" alt="Ultralytics Discord"></a>
44
+ </div>
45
+ </div>
46
+
47
+ ## <div align="center">YOLOv8 🚀 新品</div>
48
+
49
+ 我们很高兴宣布 Ultralytics YOLOv8 🚀 的发布,这是我们新推出的领先水平、最先进的(SOTA)模型,发布于 **[https://github.com/ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)**。 YOLOv8 旨在快速、准确且易于使用,使其成为广泛的物体检测、图像分割和图像分类任务的极佳选择。
50
+
51
+ 请查看 [YOLOv8 文档](https://docs.ultralytics.com)了解详细信息,并开始使���:
52
+
53
+ [![PyPI 版本](https://badge.fury.io/py/ultralytics.svg)](https://badge.fury.io/py/ultralytics) [![下载量](https://static.pepy.tech/badge/ultralytics)](https://pepy.tech/project/ultralytics)
54
+
55
+ ```commandline
56
+ pip install ultralytics
57
+ ```
58
+
59
+ <div align="center">
60
+ <a href="https://ultralytics.com/yolov8" target="_blank">
61
+ <img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/yolo-comparison-plots.png"></a>
62
+ </div>
63
+
64
+ ## <div align="center">文档</div>
65
+
66
+ 有关训练、测试和部署的完整文档见[YOLOv5 文档](https://docs.ultralytics.com/yolov5/)。请参阅下面的快速入门示例。
67
+
68
+ <details open>
69
+ <summary>安装</summary>
70
+
71
+ 克隆 repo,并要求在 [**Python>=3.8.0**](https://www.python.org/) 环境中安装 [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) ,且要求 [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/) 。
72
+
73
+ ```bash
74
+ git clone https://github.com/ultralytics/yolov5 # clone
75
+ cd yolov5
76
+ pip install -r requirements.txt # install
77
+ ```
78
+
79
+ </details>
80
+
81
+ <details>
82
+ <summary>推理</summary>
83
+
84
+ 使用 YOLOv5 [PyTorch Hub](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading) 推理。最新 [模型](https://github.com/ultralytics/yolov5/tree/master/models) 将自动的从 YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) 中下载。
85
+
86
+ ```python
87
+ import torch
88
+
89
+ # Model
90
+ model = torch.hub.load("ultralytics/yolov5", "yolov5s") # or yolov5n - yolov5x6, custom
91
+
92
+ # Images
93
+ img = "https://ultralytics.com/images/zidane.jpg" # or file, Path, PIL, OpenCV, numpy, list
94
+
95
+ # Inference
96
+ results = model(img)
97
+
98
+ # Results
99
+ results.print() # or .show(), .save(), .crop(), .pandas(), etc.
100
+ ```
101
+
102
+ </details>
103
+
104
+ <details>
105
+ <summary>使用 detect.py 推理</summary>
106
+
107
+ `detect.py` 在各种来源上运行推理, [模型](https://github.com/ultralytics/yolov5/tree/master/models) 自动从 最新的YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) 中下载,并将结果保存到 `runs/detect` 。
108
+
109
+ ```bash
110
+ python detect.py --weights yolov5s.pt --source 0 # webcam
111
+ img.jpg # image
112
+ vid.mp4 # video
113
+ screen # screenshot
114
+ path/ # directory
115
+ list.txt # list of images
116
+ list.streams # list of streams
117
+ 'path/*.jpg' # glob
118
+ 'https://youtu.be/LNwODJXcvt4' # YouTube
119
+ 'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
120
+ ```
121
+
122
+ </details>
123
+
124
+ <details>
125
+ <summary>训练</summary>
126
+
127
+ 下面的命令重现 YOLOv5 在 [COCO](https://github.com/ultralytics/yolov5/blob/master/data/scripts/get_coco.sh) 数据集上的结果。 最新的 [模型](https://github.com/ultralytics/yolov5/tree/master/models) 和 [数据集](https://github.com/ultralytics/yolov5/tree/master/data)
128
+ 将自动的从 YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) 中下载。 YOLOv5n/s/m/l/x 在 V100 GPU 的训练时间为 1/2/4/6/8 天( [多GPU](https://docs.ultralytics.com/yolov5/tutorials/multi_gpu_training) 训练速度更快)。 尽可能使用更大的 `--batch-size` ,或通过 `--batch-size -1` 实现 YOLOv5 [自动批处理](https://github.com/ultralytics/yolov5/pull/5092) 。下方显示的 batchsize 适用于 V100-16GB。
129
+
130
+ ```bash
131
+ python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5n.yaml --batch-size 128
132
+ yolov5s 64
133
+ yolov5m 40
134
+ yolov5l 24
135
+ yolov5x 16
136
+ ```
137
+
138
+ <img width="800" src="https://user-images.githubusercontent.com/26833433/90222759-949d8800-ddc1-11ea-9fa1-1c97eed2b963.png">
139
+
140
+ </details>
141
+
142
+ <details open>
143
+ <summary>教程</summary>
144
+
145
+ - [训练自定义数据](https://docs.ultralytics.com/yolov5/tutorials/train_custom_data) 🚀 推荐
146
+ - [获得最佳训练结果的技巧](https://docs.ultralytics.com/yolov5/tutorials/tips_for_best_training_results) ☘️
147
+ - [多GPU训练](https://docs.ultralytics.com/yolov5/tutorials/multi_gpu_training)
148
+ - [PyTorch Hub](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading) 🌟 新
149
+ - [TFLite,ONNX,CoreML,TensorRT导出](https://docs.ultralytics.com/yolov5/tutorials/model_export) 🚀
150
+ - [NVIDIA Jetson平台部署](https://docs.ultralytics.com/yolov5/tutorials/running_on_jetson_nano) 🌟 新
151
+ - [测试时增强 (TTA)](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation)
152
+ - [模型集成](https://docs.ultralytics.com/yolov5/tutorials/model_ensembling)
153
+ - [模型剪枝/稀疏](https://docs.ultralytics.com/yolov5/tutorials/model_pruning_and_sparsity)
154
+ - [超参数进化](https://docs.ultralytics.com/yolov5/tutorials/hyperparameter_evolution)
155
+ - [冻结层的迁移学习](https://docs.ultralytics.com/yolov5/tutorials/transfer_learning_with_frozen_layers)
156
+ - [架构概述](https://docs.ultralytics.com/yolov5/tutorials/architecture_description) 🌟 新
157
+ - [Roboflow用于数据集、标注和主动学习](https://docs.ultralytics.com/yolov5/tutorials/roboflow_datasets_integration)
158
+ - [ClearML日志记录](https://docs.ultralytics.com/yolov5/tutorials/clearml_logging_integration) 🌟 新
159
+ - [使用Neural Magic的Deepsparse的YOLOv5](https://docs.ultralytics.com/yolov5/tutorials/neural_magic_pruning_quantization) 🌟 新
160
+ - [Comet日志记录](https://docs.ultralytics.com/yolov5/tutorials/comet_logging_integration) 🌟 新
161
+
162
+ </details>
163
+
164
+ ## <div align="center">模块集成</div>
165
+
166
+ <br>
167
+ <a align="center" href="https://bit.ly/ultralytics_hub" target="_blank">
168
+ <img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/integrations-loop.png"></a>
169
+ <br>
170
+ <br>
171
+
172
+ <div align="center">
173
+ <a href="https://roboflow.com/?ref=ultralytics">
174
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-roboflow.png" width="10%" /></a>
175
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="" />
176
+ <a href="https://cutt.ly/yolov5-readme-clearml">
177
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-clearml.png" width="10%" /></a>
178
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="" />
179
+ <a href="https://bit.ly/yolov5-readme-comet2">
180
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-comet.png" width="10%" /></a>
181
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="" />
182
+ <a href="https://bit.ly/yolov5-neuralmagic">
183
+ <img src="https://github.com/ultralytics/assets/raw/main/partners/logo-neuralmagic.png" width="10%" /></a>
184
+ </div>
185
+
186
+ | Roboflow | ClearML ⭐ 新 | Comet ⭐ 新 | Neural Magic ⭐ 新 |
187
+ | :--------------------------------------------------------------------------------: | :-------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------: |
188
+ | 将您的自定义数据集进行标注并直接导出到 YOLOv5 以进行训练 [Roboflow](https://roboflow.com/?ref=ultralytics) | 自动跟踪、可视化甚至远程训练 YOLOv5 [ClearML](https://cutt.ly/yolov5-readme-clearml)(开源!) | 永远免费,[Comet](https://bit.ly/yolov5-readme-comet2)可让您保存 YOLOv5 模型、恢复训练以及交互式可视化和调试预测 | 使用 [Neural Magic DeepSparse](https://bit.ly/yolov5-neuralmagic),运行 YOLOv5 推理的速度最高可提高6倍 |
189
+
190
+ ## <div align="center">Ultralytics HUB</div>
191
+
192
+ [Ultralytics HUB](https://bit.ly/ultralytics_hub) 是我们的⭐**新的**用于可视化数据集、训练 YOLOv5 🚀 模型并以无缝体验部署到现实世界的无代码解决方案。现在开始 **免费** 使用他!
193
+
194
+ <a align="center" href="https://bit.ly/ultralytics_hub" target="_blank">
195
+ <img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/ultralytics-hub.png"></a>
196
+
197
+ ## <div align="center">为什么选择 YOLOv5</div>
198
+
199
+ YOLOv5 超级容易上手,简单易学。我们优先考虑现实世界的结果。
200
+
201
+ <p align="left"><img width="800" src="https://user-images.githubusercontent.com/26833433/155040763-93c22a27-347c-4e3c-847a-8094621d3f4e.png"></p>
202
+ <details>
203
+ <summary>YOLOv5-P5 640 图</summary>
204
+
205
+ <p align="left"><img width="800" src="https://user-images.githubusercontent.com/26833433/155040757-ce0934a3-06a6-43dc-a979-2edbbd69ea0e.png"></p>
206
+ </details>
207
+ <details>
208
+ <summary>图表笔记</summary>
209
+
210
+ - **COCO AP val** 表示 mAP@0.5:0.95 指标,在 [COCO val2017](http://cocodataset.org) 数据集的 5000 张图像上测得, 图像包含 256 到 1536 各种推理大小。
211
+ - **显卡推理速度** 为在 [COCO val2017](http://cocodataset.org) 数据集上的平均推理时间,使用 [AWS p3.2xlarge](https://aws.amazon.com/ec2/instance-types/p3/) V100实例,batchsize 为 32 。
212
+ - **EfficientDet** 数据来自 [google/automl](https://github.com/google/automl) , batchsize 为32���
213
+ - **复现命令** 为 `python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n6.pt yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.pt`
214
+
215
+ </details>
216
+
217
+ ### 预训练模型
218
+
219
+ | 模型 | 尺寸<br><sup>(像素) | mAP<sup>val<br>50-95 | mAP<sup>val<br>50 | 推理速度<br><sup>CPU b1<br>(ms) | 推理速度<br><sup>V100 b1<br>(ms) | 速度<br><sup>V100 b32<br>(ms) | 参数量<br><sup>(M) | FLOPs<br><sup>@640 (B) |
220
+ | ---------------------------------------------------------------------------------------------- | --------------- | -------------------- | ----------------- | --------------------------- | ---------------------------- | --------------------------- | --------------- | ---------------------- |
221
+ | [YOLOv5n](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n.pt) | 640 | 28.0 | 45.7 | **45** | **6.3** | **0.6** | **1.9** | **4.5** |
222
+ | [YOLOv5s](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s.pt) | 640 | 37.4 | 56.8 | 98 | 6.4 | 0.9 | 7.2 | 16.5 |
223
+ | [YOLOv5m](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m.pt) | 640 | 45.4 | 64.1 | 224 | 8.2 | 1.7 | 21.2 | 49.0 |
224
+ | [YOLOv5l](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l.pt) | 640 | 49.0 | 67.3 | 430 | 10.1 | 2.7 | 46.5 | 109.1 |
225
+ | [YOLOv5x](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x.pt) | 640 | 50.7 | 68.9 | 766 | 12.1 | 4.8 | 86.7 | 205.7 |
226
+ | | | | | | | | | |
227
+ | [YOLOv5n6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n6.pt) | 1280 | 36.0 | 54.4 | 153 | 8.1 | 2.1 | 3.2 | 4.6 |
228
+ | [YOLOv5s6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s6.pt) | 1280 | 44.8 | 63.7 | 385 | 8.2 | 3.6 | 12.6 | 16.8 |
229
+ | [YOLOv5m6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m6.pt) | 1280 | 51.3 | 69.3 | 887 | 11.1 | 6.8 | 35.7 | 50.0 |
230
+ | [YOLOv5l6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l6.pt) | 1280 | 53.7 | 71.3 | 1784 | 15.8 | 10.5 | 76.8 | 111.4 |
231
+ | [YOLOv5x6](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x6.pt)<br>+[TTA] | 1280<br>1536 | 55.0<br>**55.8** | 72.7<br>**72.7** | 3136<br>- | 26.2<br>- | 19.4<br>- | 140.7<br>- | 209.8<br>- |
232
+
233
+ <details>
234
+ <summary>笔记</summary>
235
+
236
+ - 所有模型都使用默认配置,训练 300 epochs。n和s模型使用 [hyp.scratch-low.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-low.yaml) ,其他模型都使用 [hyp.scratch-high.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-high.yaml) 。
237
+ - \*\*mAP<sup>val</sup>\*\*在单模型单尺度上计算,数据集使用 [COCO val2017](http://cocodataset.org) 。<br>复现命令 `python val.py --data coco.yaml --img 640 --conf 0.001 --iou 0.65`
238
+ - **推理速度**在 COCO val 图像总体时间上进行平均得到,测试环境使用[AWS p3.2xlarge](https://aws.amazon.com/ec2/instance-types/p3/)实例。 NMS 时间 (大约 1 ms/img) 不包括在内。<br>复现命令 `python val.py --data coco.yaml --img 640 --task speed --batch 1`
239
+ - **TTA** [测试时数据增强](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation) 包括反射和尺度变换。<br>复现命令 `python val.py --data coco.yaml --img 1536 --iou 0.7 --augment`
240
+
241
+ </details>
242
+
243
+ ## <div align="center">实例分割模型 ⭐ 新</div>
244
+
245
+ 我们新的 YOLOv5 [release v7.0](https://github.com/ultralytics/yolov5/releases/v7.0) 实例分割模型是世界上最快和最准确的模型,击败所有当前 [SOTA 基准](https://paperswithcode.com/sota/real-time-instance-segmentation-on-mscoco)。我们使它非常易于训练、验证和部署。更多细节请查看 [发行说明](https://github.com/ultralytics/yolov5/releases/v7.0) 或访问我们的 [YOLOv5 分割 Colab 笔记本](https://github.com/ultralytics/yolov5/blob/master/segment/tutorial.ipynb) 以快速入门。
246
+
247
+ <details>
248
+ <summary>实例分割模型列表</summary>
249
+
250
+ <br>
251
+
252
+ <div align="center">
253
+ <a align="center" href="https://ultralytics.com/yolov5" target="_blank">
254
+ <img width="800" src="https://user-images.githubusercontent.com/61612323/204180385-84f3aca9-a5e9-43d8-a617-dda7ca12e54a.png"></a>
255
+ </div>
256
+
257
+ 我们使用 A100 GPU 在 COCO 上以 640 图像大小训练了 300 epochs 得到 YOLOv5 分割模型。我们将所有模型导出到 ONNX FP32 以进行 CPU 速度测试,并导出到 TensorRT FP16 以进行 GPU 速度测试。为了便于再现,我们在 Google [Colab Pro](https://colab.research.google.com/signup) 上进行了所有速度测试。
258
+
259
+ | 模型 | 尺寸<br><sup>(像素) | mAP<sup>box<br>50-95 | mAP<sup>mask<br>50-95 | 训练时长<br><sup>300 epochs<br>A100 GPU(小时) | 推理速度<br><sup>ONNX CPU<br>(ms) | 推理速度<br><sup>TRT A100<br>(ms) | 参数量<br><sup>(M) | FLOPs<br><sup>@640 (B) |
260
+ | ------------------------------------------------------------------------------------------ | --------------- | -------------------- | --------------------- | --------------------------------------- | ----------------------------- | ----------------------------- | --------------- | ---------------------- |
261
+ | [YOLOv5n-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n-seg.pt) | 640 | 27.6 | 23.4 | 80:17 | **62.7** | **1.2** | **2.0** | **7.1** |
262
+ | [YOLOv5s-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s-seg.pt) | 640 | 37.6 | 31.7 | 88:16 | 173.3 | 1.4 | 7.6 | 26.4 |
263
+ | [YOLOv5m-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m-seg.pt) | 640 | 45.0 | 37.1 | 108:36 | 427.0 | 2.2 | 22.0 | 70.8 |
264
+ | [YOLOv5l-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l-seg.pt) | 640 | 49.0 | 39.9 | 66:43 (2x) | 857.4 | 2.9 | 47.9 | 147.7 |
265
+ | [YOLOv5x-seg](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x-seg.pt) | 640 | **50.7** | **41.4** | 62:56 (3x) | 1579.2 | 4.5 | 88.8 | 265.7 |
266
+
267
+ - 所有模型使用 SGD 优化器训练, 都使用 `lr0=0.01` 和 `weight_decay=5e-5` 参数, 图像大小为 640 。<br>训练 log 可以查看 https://wandb.ai/glenn-jocher/YOLOv5_v70_official
268
+ - **准确性**结果都在 COCO 数据集上,使用单模型单尺度测试得到。<br>复现命令 `python segment/val.py --data coco.yaml --weights yolov5s-seg.pt`
269
+ - **推理速度**是使用 100 张图像推理时间进行平均得到,测试环境使用 [Colab Pro](https://colab.research.google.com/signup) 上 A100 高 RAM 实例。结果仅表示推理速度(NMS 每张图像增加约 1 毫秒)。<br>复现命令 `python segment/val.py --data coco.yaml --weights yolov5s-seg.pt --batch 1`
270
+ - **模型转换**到 FP32 的 ONNX 和 FP16 的 TensorRT 脚本为 `export.py`.<br>运行命令 `python export.py --weights yolov5s-seg.pt --include engine --device 0 --half`
271
+
272
+ </details>
273
+
274
+ <details>
275
+ <summary>分割模型使用示例 &nbsp;<a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/segment/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></summary>
276
+
277
+ ### 训练
278
+
279
+ YOLOv5分割训练支持自动下载 COCO128-seg 分割数据集,用户仅需在启动指令中包含 `--data coco128-seg.yaml` 参数。 若要手动下载,使用命令 `bash data/scripts/get_coco.sh --train --val --segments`, 在下载完毕后,使用命令 `python train.py --data coco.yaml` 开启训练。
280
+
281
+ ```bash
282
+ # 单 GPU
283
+ python segment/train.py --data coco128-seg.yaml --weights yolov5s-seg.pt --img 640
284
+
285
+ # 多 GPU, DDP 模式
286
+ python -m torch.distributed.run --nproc_per_node 4 --master_port 1 segment/train.py --data coco128-seg.yaml --weights yolov5s-seg.pt --img 640 --device 0,1,2,3
287
+ ```
288
+
289
+ ### 验证
290
+
291
+ 在 COCO 数据集上验证 YOLOv5s-seg mask mAP:
292
+
293
+ ```bash
294
+ bash data/scripts/get_coco.sh --val --segments # 下载 COCO val segments 数据集 (780MB, 5000 images)
295
+ python segment/val.py --weights yolov5s-seg.pt --data coco.yaml --img 640 # 验证
296
+ ```
297
+
298
+ ### 预测
299
+
300
+ 使用预训练的 YOLOv5m-seg.pt 来预测 bus.jpg:
301
+
302
+ ```bash
303
+ python segment/predict.py --weights yolov5m-seg.pt --source data/images/bus.jpg
304
+ ```
305
+
306
+ ```python
307
+ model = torch.hub.load(
308
+ "ultralytics/yolov5", "custom", "yolov5m-seg.pt"
309
+ ) # 从load from PyTorch Hub 加载模型 (WARNING: 推理暂未支持)
310
+ ```
311
+
312
+ | ![zidane](https://user-images.githubusercontent.com/26833433/203113421-decef4c4-183d-4a0a-a6c2-6435b33bc5d3.jpg) | ![bus](https://user-images.githubusercontent.com/26833433/203113416-11fe0025-69f7-4874-a0a6-65d0bfe2999a.jpg) |
313
+ | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
314
+
315
+ ### 模型导出
316
+
317
+ 将 YOLOv5s-seg 模型导出到 ONNX 和 TensorRT:
318
+
319
+ ```bash
320
+ python export.py --weights yolov5s-seg.pt --include onnx engine --img 640 --device 0
321
+ ```
322
+
323
+ </details>
324
+
325
+ ## <div align="center">分类网络 ⭐ 新</div>
326
+
327
+ YOLOv5 [release v6.2](https://github.com/ultralytics/yolov5/releases) 带来对分类模型训练、验证和部署的支持!详情请查看 [发行说明](https://github.com/ultralytics/yolov5/releases/v6.2) 或访问我们的 [YOLOv5 分类 Colab 笔记本](https://github.com/ultralytics/yolov5/blob/master/classify/tutorial.ipynb) 以快速入门。
328
+
329
+ <details>
330
+ <summary>分类网络模型</summary>
331
+
332
+ <br>
333
+
334
+ 我们使用 4xA100 实例在 ImageNet 上训练了 90 个 epochs 得到 YOLOv5-cls 分类模型,我们训练了 ResNet 和 EfficientNet 模型以及相同的默认训练设置以进行比较。我们将所有模型导出到 ONNX FP32 以进行 CPU 速度测试,并导出到 TensorRT FP16 以进行 GPU 速度测试。为了便于重现,我们在 Google 上进行了所有速度测试 [Colab Pro](https://colab.research.google.com/signup) 。
335
+
336
+ | 模型 | 尺寸<br><sup>(像素) | acc<br><sup>top1 | acc<br><sup>top5 | 训练时长<br><sup>90 epochs<br>4xA100(小时) | 推理速度<br><sup>ONNX CPU<br>(ms) | 推理速度<br><sup>TensorRT V100<br>(ms) | 参数<br><sup>(M) | FLOPs<br><sup>@640 (B) |
337
+ | -------------------------------------------------------------------------------------------------- | --------------- | ---------------- | ---------------- | ------------------------------------ | ----------------------------- | ---------------------------------- | -------------- | ---------------------- |
338
+ | [YOLOv5n-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n-cls.pt) | 224 | 64.6 | 85.4 | 7:59 | **3.3** | **0.5** | **2.5** | **0.5** |
339
+ | [YOLOv5s-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s-cls.pt) | 224 | 71.5 | 90.2 | 8:09 | 6.6 | 0.6 | 5.4 | 1.4 |
340
+ | [YOLOv5m-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5m-cls.pt) | 224 | 75.9 | 92.9 | 10:06 | 15.5 | 0.9 | 12.9 | 3.9 |
341
+ | [YOLOv5l-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5l-cls.pt) | 224 | 78.0 | 94.0 | 11:56 | 26.9 | 1.4 | 26.5 | 8.5 |
342
+ | [YOLOv5x-cls](https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5x-cls.pt) | 224 | **79.0** | **94.4** | 15:04 | 54.3 | 1.8 | 48.1 | 15.9 |
343
+ | | | | | | | | | |
344
+ | [ResNet18](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet18.pt) | 224 | 70.3 | 89.5 | **6:47** | 11.2 | 0.5 | 11.7 | 3.7 |
345
+ | [Resnetzch](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet34.pt) | 224 | 73.9 | 91.8 | 8:33 | 20.6 | 0.9 | 21.8 | 7.4 |
346
+ | [ResNet50](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet50.pt) | 224 | 76.8 | 93.4 | 11:10 | 23.4 | 1.0 | 25.6 | 8.5 |
347
+ | [ResNet101](https://github.com/ultralytics/yolov5/releases/download/v7.0/resnet101.pt) | 224 | 78.5 | 94.3 | 17:10 | 42.1 | 1.9 | 44.5 | 15.9 |
348
+ | | | | | | | | | |
349
+ | [EfficientNet_b0](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b0.pt) | 224 | 75.1 | 92.4 | 13:03 | 12.5 | 1.3 | 5.3 | 1.0 |
350
+ | [EfficientNet_b1](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b1.pt) | 224 | 76.4 | 93.2 | 17:04 | 14.9 | 1.6 | 7.8 | 1.5 |
351
+ | [EfficientNet_b2](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b2.pt) | 224 | 76.6 | 93.4 | 17:10 | 15.9 | 1.6 | 9.1 | 1.7 |
352
+ | [EfficientNet_b3](https://github.com/ultralytics/yolov5/releases/download/v7.0/efficientnet_b3.pt) | 224 | 77.7 | 94.0 | 19:19 | 18.9 | 1.9 | 12.2 | 2.4 |
353
+
354
+ <details>
355
+ <summary>Table Notes (点击以展开)</summary>
356
+
357
+ - 所有模型都使用 SGD 优化器训练 90 个 epochs,都使用 `lr0=0.001` 和 `weight_decay=5e-5` 参数, 图像大小为 224 ,且都使用默认设置。<br>训练 log 可以查看 https://wandb.ai/glenn-jocher/YOLOv5-Classifier-v6-2
358
+ - **准确性**都在单模型单尺度上计算,数据集使用 [ImageNet-1k](https://www.image-net.org/index.php) 。<br>复现命令 `python classify/val.py --data ../datasets/imagenet --img 224`
359
+ - **推理速度**是使用 100 个推理图像进行平均得到,测试环境使用谷歌 [Colab Pro](https://colab.research.google.com/signup) V100 高 RAM 实例。<br>复现命令 `python classify/val.py --data ../datasets/imagenet --img 224 --batch 1`
360
+ - **模型导出**到 FP32 的 ONNX 和 FP16 的 TensorRT 使用 `export.py` 。<br>复现命令 `python export.py --weights yolov5s-cls.pt --include engine onnx --imgsz 224`
361
+ </details>
362
+ </details>
363
+
364
+ <details>
365
+ <summary>分类训练示例 &nbsp;<a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/classify/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></summary>
366
+
367
+ ### 训练
368
+
369
+ YOLOv5 分类训练支持自动下载 MNIST、Fashion-MNIST、CIFAR10、CIFAR100、Imagenette、Imagewoof 和 ImageNet 数据集,命令中使用 `--data` 即可。 MNIST 示例 `--data mnist` 。
370
+
371
+ ```bash
372
+ # 单 GPU
373
+ python classify/train.py --model yolov5s-cls.pt --data cifar100 --epochs 5 --img 224 --batch 128
374
+
375
+ # 多 GPU, DDP 模式
376
+ python -m torch.distributed.run --nproc_per_node 4 --master_port 1 classify/train.py --model yolov5s-cls.pt --data imagenet --epochs 5 --img 224 --device 0,1,2,3
377
+ ```
378
+
379
+ ### 验证
380
+
381
+ 在 ImageNet-1k 数据集上验证 YOLOv5m-cls 的准确性:
382
+
383
+ ```bash
384
+ bash data/scripts/get_imagenet.sh --val # download ImageNet val split (6.3G, 50000 images)
385
+ python classify/val.py --weights yolov5m-cls.pt --data ../datasets/imagenet --img 224 # validate
386
+ ```
387
+
388
+ ### 预测
389
+
390
+ 使用预训练的 YOLOv5s-cls.pt 来预测 bus.jpg:
391
+
392
+ ```bash
393
+ python classify/predict.py --weights yolov5s-cls.pt --source data/images/bus.jpg
394
+ ```
395
+
396
+ ```python
397
+ model = torch.hub.load(
398
+ "ultralytics/yolov5", "custom", "yolov5s-cls.pt"
399
+ ) # load from PyTorch Hub
400
+ ```
401
+
402
+ ### 模型导出
403
+
404
+ 将一组经过训练的 YOLOv5s-cls、ResNet 和 EfficientNet 模型导出到 ONNX 和 TensorRT:
405
+
406
+ ```bash
407
+ python export.py --weights yolov5s-cls.pt resnet50.pt efficientnet_b0.pt --include onnx engine --img 224
408
+ ```
409
+
410
+ </details>
411
+
412
+ ## <div align="center">环境</div>
413
+
414
+ 使用下面我们经过验证的环境,在几秒钟内开始使用 YOLOv5 。单击下面的图标了解详细信息。
415
+
416
+ <div align="center">
417
+ <a href="https://bit.ly/yolov5-paperspace-notebook">
418
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-gradient.png" width="10%" /></a>
419
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
420
+ <a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb">
421
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-colab-small.png" width="10%" /></a>
422
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
423
+ <a href="https://www.kaggle.com/ultralytics/yolov5">
424
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-kaggle-small.png" width="10%" /></a>
425
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
426
+ <a href="https://hub.docker.com/r/ultralytics/yolov5">
427
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-docker-small.png" width="10%" /></a>
428
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
429
+ <a href="https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/">
430
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-aws-small.png" width="10%" /></a>
431
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="5%" alt="" />
432
+ <a href="https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/">
433
+ <img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-gcp-small.png" width="10%" /></a>
434
+ </div>
435
+
436
+ ## <div align="center">贡献</div>
437
+
438
+ 我们喜欢您的意见或建议!我们希望尽可能简单和透明地为 YOLOv5 做出贡献。请看我们的 [投稿指南](https://docs.ultralytics.com/help/contributing/),并填写 [YOLOv5调查](https://ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) 向我们发送您的体验反馈。感谢我们所有的贡献者!
439
+
440
+ <!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=990 -->
441
+
442
+ <a href="https://github.com/ultralytics/yolov5/graphs/contributors">
443
+ <img src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" /></a>
444
+
445
+ ## <div align="center">许可证</div>
446
+
447
+ Ultralytics 提供两种许可证选项以适应各种使用场景:
448
+
449
+ - **AGPL-3.0 许可证**:这个[OSI 批准](https://opensource.org/licenses/)的开源许可证非常适合学生和爱好者,可以推动开放的协作和知识分享。请查看[LICENSE](https://github.com/ultralytics/yolov5/blob/master/LICENSE) 文件以了解更多细节。
450
+ - **企业许可证**:专为商业用途设计,该许可证允许将 Ultralytics 的软件和 AI 模型无缝集成到商业产品和服务中,从而绕过 AGPL-3.0 的开源要求。如果您的场景涉及将我们的解决方案嵌入到商业产品中,请通过 [Ultralytics Licensing](https://ultralytics.com/license)与我们联系。
451
+
452
+ ## <div align="center">联系方式</div>
453
+
454
+ 对于 Ultralytics 的错误报告和功能请求,请访问 [GitHub Issues](https://github.com/ultralytics/yolov5/issues),并加入我们的 [Discord](https://ultralytics.com/discord) 社区进行问题和讨论!
455
+
456
+ <br>
457
+ <div align="center">
458
+ <a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
459
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
460
+ <a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
461
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
462
+ <a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
463
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
464
+ <a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
465
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
466
+ <a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
467
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
468
+ <a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="Ultralytics Instagram"></a>
469
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%">
470
+ <a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
471
+ </div>
472
+
473
+ [tta]: https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation
__pycache__/export.cpython-38.pyc ADDED
Binary file (31 kB). View file
 
__pycache__/hubconf.cpython-38.pyc ADDED
Binary file (5.59 kB). View file
 
__pycache__/val.cpython-38.pyc ADDED
Binary file (14.1 kB). View file
 
benchmarks.py ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ """
3
+ Run YOLOv5 benchmarks on all supported export formats
4
+
5
+ Format | `export.py --include` | Model
6
+ --- | --- | ---
7
+ PyTorch | - | yolov5s.pt
8
+ TorchScript | `torchscript` | yolov5s.torchscript
9
+ ONNX | `onnx` | yolov5s.onnx
10
+ OpenVINO | `openvino` | yolov5s_openvino_model/
11
+ TensorRT | `engine` | yolov5s.engine
12
+ CoreML | `coreml` | yolov5s.mlmodel
13
+ TensorFlow SavedModel | `saved_model` | yolov5s_saved_model/
14
+ TensorFlow GraphDef | `pb` | yolov5s.pb
15
+ TensorFlow Lite | `tflite` | yolov5s.tflite
16
+ TensorFlow Edge TPU | `edgetpu` | yolov5s_edgetpu.tflite
17
+ TensorFlow.js | `tfjs` | yolov5s_web_model/
18
+
19
+ Requirements:
20
+ $ pip install -r requirements.txt coremltools onnx onnx-simplifier onnxruntime openvino-dev tensorflow-cpu # CPU
21
+ $ pip install -r requirements.txt coremltools onnx onnx-simplifier onnxruntime-gpu openvino-dev tensorflow # GPU
22
+ $ pip install -U nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com # TensorRT
23
+
24
+ Usage:
25
+ $ python benchmarks.py --weights yolov5s.pt --img 640
26
+ """
27
+
28
+ import argparse
29
+ import platform
30
+ import sys
31
+ import time
32
+ from pathlib import Path
33
+
34
+ import pandas as pd
35
+
36
+ FILE = Path(__file__).resolve()
37
+ ROOT = FILE.parents[0] # YOLOv5 root directory
38
+ if str(ROOT) not in sys.path:
39
+ sys.path.append(str(ROOT)) # add ROOT to PATH
40
+ # ROOT = ROOT.relative_to(Path.cwd()) # relative
41
+
42
+ import export
43
+ from models.experimental import attempt_load
44
+ from models.yolo import SegmentationModel
45
+ from segment.val import run as val_seg
46
+ from utils import notebook_init
47
+ from utils.general import LOGGER, check_yaml, file_size, print_args
48
+ from utils.torch_utils import select_device
49
+ from val import run as val_det
50
+
51
+
52
+ def run(
53
+ weights=ROOT / 'yolov5s.pt', # weights path
54
+ imgsz=640, # inference size (pixels)
55
+ batch_size=1, # batch size
56
+ data=ROOT / 'data/coco128.yaml', # dataset.yaml path
57
+ device='', # cuda device, i.e. 0 or 0,1,2,3 or cpu
58
+ half=False, # use FP16 half-precision inference
59
+ test=False, # test exports only
60
+ pt_only=False, # test PyTorch only
61
+ hard_fail=False, # throw error on benchmark failure
62
+ ):
63
+ y, t = [], time.time()
64
+ device = select_device(device)
65
+ model_type = type(attempt_load(weights, fuse=False)) # DetectionModel, SegmentationModel, etc.
66
+ for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
67
+ try:
68
+ assert i not in (9, 10), 'inference not supported' # Edge TPU and TF.js are unsupported
69
+ assert i != 5 or platform.system() == 'Darwin', 'inference only supported on macOS>=10.13' # CoreML
70
+ if 'cpu' in device.type:
71
+ assert cpu, 'inference not supported on CPU'
72
+ if 'cuda' in device.type:
73
+ assert gpu, 'inference not supported on GPU'
74
+
75
+ # Export
76
+ if f == '-':
77
+ w = weights # PyTorch format
78
+ else:
79
+ w = export.run(weights=weights,
80
+ imgsz=[imgsz],
81
+ include=[f],
82
+ batch_size=batch_size,
83
+ device=device,
84
+ half=half)[-1] # all others
85
+ assert suffix in str(w), 'export failed'
86
+
87
+ # Validate
88
+ if model_type == SegmentationModel:
89
+ result = val_seg(data, w, batch_size, imgsz, plots=False, device=device, task='speed', half=half)
90
+ metric = result[0][7] # (box(p, r, map50, map), mask(p, r, map50, map), *loss(box, obj, cls))
91
+ else: # DetectionModel:
92
+ result = val_det(data, w, batch_size, imgsz, plots=False, device=device, task='speed', half=half)
93
+ metric = result[0][3] # (p, r, map50, map, *loss(box, obj, cls))
94
+ speed = result[2][1] # times (preprocess, inference, postprocess)
95
+ y.append([name, round(file_size(w), 1), round(metric, 4), round(speed, 2)]) # MB, mAP, t_inference
96
+ except Exception as e:
97
+ if hard_fail:
98
+ assert type(e) is AssertionError, f'Benchmark --hard-fail for {name}: {e}'
99
+ LOGGER.warning(f'WARNING ⚠️ Benchmark failure for {name}: {e}')
100
+ y.append([name, None, None, None]) # mAP, t_inference
101
+ if pt_only and i == 0:
102
+ break # break after PyTorch
103
+
104
+ # Print results
105
+ LOGGER.info('\n')
106
+ parse_opt()
107
+ notebook_init() # print system info
108
+ c = ['Format', 'Size (MB)', 'mAP50-95', 'Inference time (ms)'] if map else ['Format', 'Export', '', '']
109
+ py = pd.DataFrame(y, columns=c)
110
+ LOGGER.info(f'\nBenchmarks complete ({time.time() - t:.2f}s)')
111
+ LOGGER.info(str(py if map else py.iloc[:, :2]))
112
+ if hard_fail and isinstance(hard_fail, str):
113
+ metrics = py['mAP50-95'].array # values to compare to floor
114
+ floor = eval(hard_fail) # minimum metric floor to pass, i.e. = 0.29 mAP for YOLOv5n
115
+ assert all(x > floor for x in metrics if pd.notna(x)), f'HARD FAIL: mAP50-95 < floor {floor}'
116
+ return py
117
+
118
+
119
+ def test(
120
+ weights=ROOT / 'yolov5s.pt', # weights path
121
+ imgsz=640, # inference size (pixels)
122
+ batch_size=1, # batch size
123
+ data=ROOT / 'data/coco128.yaml', # dataset.yaml path
124
+ device='', # cuda device, i.e. 0 or 0,1,2,3 or cpu
125
+ half=False, # use FP16 half-precision inference
126
+ test=False, # test exports only
127
+ pt_only=False, # test PyTorch only
128
+ hard_fail=False, # throw error on benchmark failure
129
+ ):
130
+ y, t = [], time.time()
131
+ device = select_device(device)
132
+ for i, (name, f, suffix, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, gpu-capable)
133
+ try:
134
+ w = weights if f == '-' else \
135
+ export.run(weights=weights, imgsz=[imgsz], include=[f], device=device, half=half)[-1] # weights
136
+ assert suffix in str(w), 'export failed'
137
+ y.append([name, True])
138
+ except Exception:
139
+ y.append([name, False]) # mAP, t_inference
140
+
141
+ # Print results
142
+ LOGGER.info('\n')
143
+ parse_opt()
144
+ notebook_init() # print system info
145
+ py = pd.DataFrame(y, columns=['Format', 'Export'])
146
+ LOGGER.info(f'\nExports complete ({time.time() - t:.2f}s)')
147
+ LOGGER.info(str(py))
148
+ return py
149
+
150
+
151
+ def parse_opt():
152
+ parser = argparse.ArgumentParser()
153
+ parser.add_argument('--weights', type=str, default=ROOT / 'yolov5s.pt', help='weights path')
154
+ parser.add_argument('--imgsz', '--img', '--img-size', type=int, default=640, help='inference size (pixels)')
155
+ parser.add_argument('--batch-size', type=int, default=1, help='batch size')
156
+ parser.add_argument('--data', type=str, default=ROOT / 'data/coco128.yaml', help='dataset.yaml path')
157
+ parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
158
+ parser.add_argument('--half', action='store_true', help='use FP16 half-precision inference')
159
+ parser.add_argument('--test', action='store_true', help='test exports only')
160
+ parser.add_argument('--pt-only', action='store_true', help='test PyTorch only')
161
+ parser.add_argument('--hard-fail', nargs='?', const=True, default=False, help='Exception on error or < min metric')
162
+ opt = parser.parse_args()
163
+ opt.data = check_yaml(opt.data) # check YAML
164
+ print_args(vars(opt))
165
+ return opt
166
+
167
+
168
+ def main(opt):
169
+ test(**vars(opt)) if opt.test else run(**vars(opt))
170
+
171
+
172
+ if __name__ == '__main__':
173
+ opt = parse_opt()
174
+ main(opt)
data/Argoverse.yaml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # Argoverse-HD dataset (ring-front-center camera) http://www.cs.cmu.edu/~mengtial/proj/streaming/ by Argo AI
3
+ # Example usage: python train.py --data Argoverse.yaml
4
+ # parent
5
+ # ├── yolov5
6
+ # └── datasets
7
+ # └── Argoverse ← downloads here (31.3 GB)
8
+
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/Argoverse # dataset root dir
12
+ train: Argoverse-1.1/images/train/ # train images (relative to 'path') 39384 images
13
+ val: Argoverse-1.1/images/val/ # val images (relative to 'path') 15062 images
14
+ test: Argoverse-1.1/images/test/ # test images (optional) https://eval.ai/web/challenges/challenge-page/800/overview
15
+
16
+ # Classes
17
+ names:
18
+ 0: person
19
+ 1: bicycle
20
+ 2: car
21
+ 3: motorcycle
22
+ 4: bus
23
+ 5: truck
24
+ 6: traffic_light
25
+ 7: stop_sign
26
+
27
+
28
+ # Download script/URL (optional) ---------------------------------------------------------------------------------------
29
+ download: |
30
+ import json
31
+
32
+ from tqdm import tqdm
33
+ from utils.general import download, Path
34
+
35
+
36
+ def argoverse2yolo(set):
37
+ labels = {}
38
+ a = json.load(open(set, "rb"))
39
+ for annot in tqdm(a['annotations'], desc=f"Converting {set} to YOLOv5 format..."):
40
+ img_id = annot['image_id']
41
+ img_name = a['images'][img_id]['name']
42
+ img_label_name = f'{img_name[:-3]}txt'
43
+
44
+ cls = annot['category_id'] # instance class id
45
+ x_center, y_center, width, height = annot['bbox']
46
+ x_center = (x_center + width / 2) / 1920.0 # offset and scale
47
+ y_center = (y_center + height / 2) / 1200.0 # offset and scale
48
+ width /= 1920.0 # scale
49
+ height /= 1200.0 # scale
50
+
51
+ img_dir = set.parents[2] / 'Argoverse-1.1' / 'labels' / a['seq_dirs'][a['images'][annot['image_id']]['sid']]
52
+ if not img_dir.exists():
53
+ img_dir.mkdir(parents=True, exist_ok=True)
54
+
55
+ k = str(img_dir / img_label_name)
56
+ if k not in labels:
57
+ labels[k] = []
58
+ labels[k].append(f"{cls} {x_center} {y_center} {width} {height}\n")
59
+
60
+ for k in labels:
61
+ with open(k, "w") as f:
62
+ f.writelines(labels[k])
63
+
64
+
65
+ # Download
66
+ dir = Path(yaml['path']) # dataset root dir
67
+ urls = ['https://argoverse-hd.s3.us-east-2.amazonaws.com/Argoverse-HD-Full.zip']
68
+ download(urls, dir=dir, delete=False)
69
+
70
+ # Convert
71
+ annotations_dir = 'Argoverse-HD/annotations/'
72
+ (dir / 'Argoverse-1.1' / 'tracking').rename(dir / 'Argoverse-1.1' / 'images') # rename 'tracking' to 'images'
73
+ for d in "train.json", "val.json":
74
+ argoverse2yolo(dir / annotations_dir / d) # convert VisDrone annotations to YOLO labels
data/GlobalWheat2020.yaml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # Global Wheat 2020 dataset http://www.global-wheat.com/ by University of Saskatchewan
3
+ # Example usage: python train.py --data GlobalWheat2020.yaml
4
+ # parent
5
+ # ├── yolov5
6
+ # └── datasets
7
+ # └── GlobalWheat2020 ← downloads here (7.0 GB)
8
+
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/GlobalWheat2020 # dataset root dir
12
+ train: # train images (relative to 'path') 3422 images
13
+ - images/arvalis_1
14
+ - images/arvalis_2
15
+ - images/arvalis_3
16
+ - images/ethz_1
17
+ - images/rres_1
18
+ - images/inrae_1
19
+ - images/usask_1
20
+ val: # val images (relative to 'path') 748 images (WARNING: train set contains ethz_1)
21
+ - images/ethz_1
22
+ test: # test images (optional) 1276 images
23
+ - images/utokyo_1
24
+ - images/utokyo_2
25
+ - images/nau_1
26
+ - images/uq_1
27
+
28
+ # Classes
29
+ names:
30
+ 0: wheat_head
31
+
32
+
33
+ # Download script/URL (optional) ---------------------------------------------------------------------------------------
34
+ download: |
35
+ from utils.general import download, Path
36
+
37
+
38
+ # Download
39
+ dir = Path(yaml['path']) # dataset root dir
40
+ urls = ['https://zenodo.org/record/4298502/files/global-wheat-codalab-official.zip',
41
+ 'https://github.com/ultralytics/yolov5/releases/download/v1.0/GlobalWheat2020_labels.zip']
42
+ download(urls, dir=dir)
43
+
44
+ # Make Directories
45
+ for p in 'annotations', 'images', 'labels':
46
+ (dir / p).mkdir(parents=True, exist_ok=True)
47
+
48
+ # Move
49
+ for p in 'arvalis_1', 'arvalis_2', 'arvalis_3', 'ethz_1', 'rres_1', 'inrae_1', 'usask_1', \
50
+ 'utokyo_1', 'utokyo_2', 'nau_1', 'uq_1':
51
+ (dir / p).rename(dir / 'images' / p) # move to /images
52
+ f = (dir / p).with_suffix('.json') # json file
53
+ if f.exists():
54
+ f.rename((dir / 'annotations' / p).with_suffix('.json')) # move to /annotations
data/ImageNet.yaml ADDED
@@ -0,0 +1,1022 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # ImageNet-1k dataset https://www.image-net.org/index.php by Stanford University
3
+ # Simplified class names from https://github.com/anishathalye/imagenet-simple-labels
4
+ # Example usage: python classify/train.py --data imagenet
5
+ # parent
6
+ # ├── yolov5
7
+ # └── datasets
8
+ # └── imagenet ← downloads here (144 GB)
9
+
10
+
11
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
12
+ path: ../datasets/imagenet # dataset root dir
13
+ train: train # train images (relative to 'path') 1281167 images
14
+ val: val # val images (relative to 'path') 50000 images
15
+ test: # test images (optional)
16
+
17
+ # Classes
18
+ names:
19
+ 0: tench
20
+ 1: goldfish
21
+ 2: great white shark
22
+ 3: tiger shark
23
+ 4: hammerhead shark
24
+ 5: electric ray
25
+ 6: stingray
26
+ 7: cock
27
+ 8: hen
28
+ 9: ostrich
29
+ 10: brambling
30
+ 11: goldfinch
31
+ 12: house finch
32
+ 13: junco
33
+ 14: indigo bunting
34
+ 15: American robin
35
+ 16: bulbul
36
+ 17: jay
37
+ 18: magpie
38
+ 19: chickadee
39
+ 20: American dipper
40
+ 21: kite
41
+ 22: bald eagle
42
+ 23: vulture
43
+ 24: great grey owl
44
+ 25: fire salamander
45
+ 26: smooth newt
46
+ 27: newt
47
+ 28: spotted salamander
48
+ 29: axolotl
49
+ 30: American bullfrog
50
+ 31: tree frog
51
+ 32: tailed frog
52
+ 33: loggerhead sea turtle
53
+ 34: leatherback sea turtle
54
+ 35: mud turtle
55
+ 36: terrapin
56
+ 37: box turtle
57
+ 38: banded gecko
58
+ 39: green iguana
59
+ 40: Carolina anole
60
+ 41: desert grassland whiptail lizard
61
+ 42: agama
62
+ 43: frilled-necked lizard
63
+ 44: alligator lizard
64
+ 45: Gila monster
65
+ 46: European green lizard
66
+ 47: chameleon
67
+ 48: Komodo dragon
68
+ 49: Nile crocodile
69
+ 50: American alligator
70
+ 51: triceratops
71
+ 52: worm snake
72
+ 53: ring-necked snake
73
+ 54: eastern hog-nosed snake
74
+ 55: smooth green snake
75
+ 56: kingsnake
76
+ 57: garter snake
77
+ 58: water snake
78
+ 59: vine snake
79
+ 60: night snake
80
+ 61: boa constrictor
81
+ 62: African rock python
82
+ 63: Indian cobra
83
+ 64: green mamba
84
+ 65: sea snake
85
+ 66: Saharan horned viper
86
+ 67: eastern diamondback rattlesnake
87
+ 68: sidewinder
88
+ 69: trilobite
89
+ 70: harvestman
90
+ 71: scorpion
91
+ 72: yellow garden spider
92
+ 73: barn spider
93
+ 74: European garden spider
94
+ 75: southern black widow
95
+ 76: tarantula
96
+ 77: wolf spider
97
+ 78: tick
98
+ 79: centipede
99
+ 80: black grouse
100
+ 81: ptarmigan
101
+ 82: ruffed grouse
102
+ 83: prairie grouse
103
+ 84: peacock
104
+ 85: quail
105
+ 86: partridge
106
+ 87: grey parrot
107
+ 88: macaw
108
+ 89: sulphur-crested cockatoo
109
+ 90: lorikeet
110
+ 91: coucal
111
+ 92: bee eater
112
+ 93: hornbill
113
+ 94: hummingbird
114
+ 95: jacamar
115
+ 96: toucan
116
+ 97: duck
117
+ 98: red-breasted merganser
118
+ 99: goose
119
+ 100: black swan
120
+ 101: tusker
121
+ 102: echidna
122
+ 103: platypus
123
+ 104: wallaby
124
+ 105: koala
125
+ 106: wombat
126
+ 107: jellyfish
127
+ 108: sea anemone
128
+ 109: brain coral
129
+ 110: flatworm
130
+ 111: nematode
131
+ 112: conch
132
+ 113: snail
133
+ 114: slug
134
+ 115: sea slug
135
+ 116: chiton
136
+ 117: chambered nautilus
137
+ 118: Dungeness crab
138
+ 119: rock crab
139
+ 120: fiddler crab
140
+ 121: red king crab
141
+ 122: American lobster
142
+ 123: spiny lobster
143
+ 124: crayfish
144
+ 125: hermit crab
145
+ 126: isopod
146
+ 127: white stork
147
+ 128: black stork
148
+ 129: spoonbill
149
+ 130: flamingo
150
+ 131: little blue heron
151
+ 132: great egret
152
+ 133: bittern
153
+ 134: crane (bird)
154
+ 135: limpkin
155
+ 136: common gallinule
156
+ 137: American coot
157
+ 138: bustard
158
+ 139: ruddy turnstone
159
+ 140: dunlin
160
+ 141: common redshank
161
+ 142: dowitcher
162
+ 143: oystercatcher
163
+ 144: pelican
164
+ 145: king penguin
165
+ 146: albatross
166
+ 147: grey whale
167
+ 148: killer whale
168
+ 149: dugong
169
+ 150: sea lion
170
+ 151: Chihuahua
171
+ 152: Japanese Chin
172
+ 153: Maltese
173
+ 154: Pekingese
174
+ 155: Shih Tzu
175
+ 156: King Charles Spaniel
176
+ 157: Papillon
177
+ 158: toy terrier
178
+ 159: Rhodesian Ridgeback
179
+ 160: Afghan Hound
180
+ 161: Basset Hound
181
+ 162: Beagle
182
+ 163: Bloodhound
183
+ 164: Bluetick Coonhound
184
+ 165: Black and Tan Coonhound
185
+ 166: Treeing Walker Coonhound
186
+ 167: English foxhound
187
+ 168: Redbone Coonhound
188
+ 169: borzoi
189
+ 170: Irish Wolfhound
190
+ 171: Italian Greyhound
191
+ 172: Whippet
192
+ 173: Ibizan Hound
193
+ 174: Norwegian Elkhound
194
+ 175: Otterhound
195
+ 176: Saluki
196
+ 177: Scottish Deerhound
197
+ 178: Weimaraner
198
+ 179: Staffordshire Bull Terrier
199
+ 180: American Staffordshire Terrier
200
+ 181: Bedlington Terrier
201
+ 182: Border Terrier
202
+ 183: Kerry Blue Terrier
203
+ 184: Irish Terrier
204
+ 185: Norfolk Terrier
205
+ 186: Norwich Terrier
206
+ 187: Yorkshire Terrier
207
+ 188: Wire Fox Terrier
208
+ 189: Lakeland Terrier
209
+ 190: Sealyham Terrier
210
+ 191: Airedale Terrier
211
+ 192: Cairn Terrier
212
+ 193: Australian Terrier
213
+ 194: Dandie Dinmont Terrier
214
+ 195: Boston Terrier
215
+ 196: Miniature Schnauzer
216
+ 197: Giant Schnauzer
217
+ 198: Standard Schnauzer
218
+ 199: Scottish Terrier
219
+ 200: Tibetan Terrier
220
+ 201: Australian Silky Terrier
221
+ 202: Soft-coated Wheaten Terrier
222
+ 203: West Highland White Terrier
223
+ 204: Lhasa Apso
224
+ 205: Flat-Coated Retriever
225
+ 206: Curly-coated Retriever
226
+ 207: Golden Retriever
227
+ 208: Labrador Retriever
228
+ 209: Chesapeake Bay Retriever
229
+ 210: German Shorthaired Pointer
230
+ 211: Vizsla
231
+ 212: English Setter
232
+ 213: Irish Setter
233
+ 214: Gordon Setter
234
+ 215: Brittany
235
+ 216: Clumber Spaniel
236
+ 217: English Springer Spaniel
237
+ 218: Welsh Springer Spaniel
238
+ 219: Cocker Spaniels
239
+ 220: Sussex Spaniel
240
+ 221: Irish Water Spaniel
241
+ 222: Kuvasz
242
+ 223: Schipperke
243
+ 224: Groenendael
244
+ 225: Malinois
245
+ 226: Briard
246
+ 227: Australian Kelpie
247
+ 228: Komondor
248
+ 229: Old English Sheepdog
249
+ 230: Shetland Sheepdog
250
+ 231: collie
251
+ 232: Border Collie
252
+ 233: Bouvier des Flandres
253
+ 234: Rottweiler
254
+ 235: German Shepherd Dog
255
+ 236: Dobermann
256
+ 237: Miniature Pinscher
257
+ 238: Greater Swiss Mountain Dog
258
+ 239: Bernese Mountain Dog
259
+ 240: Appenzeller Sennenhund
260
+ 241: Entlebucher Sennenhund
261
+ 242: Boxer
262
+ 243: Bullmastiff
263
+ 244: Tibetan Mastiff
264
+ 245: French Bulldog
265
+ 246: Great Dane
266
+ 247: St. Bernard
267
+ 248: husky
268
+ 249: Alaskan Malamute
269
+ 250: Siberian Husky
270
+ 251: Dalmatian
271
+ 252: Affenpinscher
272
+ 253: Basenji
273
+ 254: pug
274
+ 255: Leonberger
275
+ 256: Newfoundland
276
+ 257: Pyrenean Mountain Dog
277
+ 258: Samoyed
278
+ 259: Pomeranian
279
+ 260: Chow Chow
280
+ 261: Keeshond
281
+ 262: Griffon Bruxellois
282
+ 263: Pembroke Welsh Corgi
283
+ 264: Cardigan Welsh Corgi
284
+ 265: Toy Poodle
285
+ 266: Miniature Poodle
286
+ 267: Standard Poodle
287
+ 268: Mexican hairless dog
288
+ 269: grey wolf
289
+ 270: Alaskan tundra wolf
290
+ 271: red wolf
291
+ 272: coyote
292
+ 273: dingo
293
+ 274: dhole
294
+ 275: African wild dog
295
+ 276: hyena
296
+ 277: red fox
297
+ 278: kit fox
298
+ 279: Arctic fox
299
+ 280: grey fox
300
+ 281: tabby cat
301
+ 282: tiger cat
302
+ 283: Persian cat
303
+ 284: Siamese cat
304
+ 285: Egyptian Mau
305
+ 286: cougar
306
+ 287: lynx
307
+ 288: leopard
308
+ 289: snow leopard
309
+ 290: jaguar
310
+ 291: lion
311
+ 292: tiger
312
+ 293: cheetah
313
+ 294: brown bear
314
+ 295: American black bear
315
+ 296: polar bear
316
+ 297: sloth bear
317
+ 298: mongoose
318
+ 299: meerkat
319
+ 300: tiger beetle
320
+ 301: ladybug
321
+ 302: ground beetle
322
+ 303: longhorn beetle
323
+ 304: leaf beetle
324
+ 305: dung beetle
325
+ 306: rhinoceros beetle
326
+ 307: weevil
327
+ 308: fly
328
+ 309: bee
329
+ 310: ant
330
+ 311: grasshopper
331
+ 312: cricket
332
+ 313: stick insect
333
+ 314: cockroach
334
+ 315: mantis
335
+ 316: cicada
336
+ 317: leafhopper
337
+ 318: lacewing
338
+ 319: dragonfly
339
+ 320: damselfly
340
+ 321: red admiral
341
+ 322: ringlet
342
+ 323: monarch butterfly
343
+ 324: small white
344
+ 325: sulphur butterfly
345
+ 326: gossamer-winged butterfly
346
+ 327: starfish
347
+ 328: sea urchin
348
+ 329: sea cucumber
349
+ 330: cottontail rabbit
350
+ 331: hare
351
+ 332: Angora rabbit
352
+ 333: hamster
353
+ 334: porcupine
354
+ 335: fox squirrel
355
+ 336: marmot
356
+ 337: beaver
357
+ 338: guinea pig
358
+ 339: common sorrel
359
+ 340: zebra
360
+ 341: pig
361
+ 342: wild boar
362
+ 343: warthog
363
+ 344: hippopotamus
364
+ 345: ox
365
+ 346: water buffalo
366
+ 347: bison
367
+ 348: ram
368
+ 349: bighorn sheep
369
+ 350: Alpine ibex
370
+ 351: hartebeest
371
+ 352: impala
372
+ 353: gazelle
373
+ 354: dromedary
374
+ 355: llama
375
+ 356: weasel
376
+ 357: mink
377
+ 358: European polecat
378
+ 359: black-footed ferret
379
+ 360: otter
380
+ 361: skunk
381
+ 362: badger
382
+ 363: armadillo
383
+ 364: three-toed sloth
384
+ 365: orangutan
385
+ 366: gorilla
386
+ 367: chimpanzee
387
+ 368: gibbon
388
+ 369: siamang
389
+ 370: guenon
390
+ 371: patas monkey
391
+ 372: baboon
392
+ 373: macaque
393
+ 374: langur
394
+ 375: black-and-white colobus
395
+ 376: proboscis monkey
396
+ 377: marmoset
397
+ 378: white-headed capuchin
398
+ 379: howler monkey
399
+ 380: titi
400
+ 381: Geoffroy's spider monkey
401
+ 382: common squirrel monkey
402
+ 383: ring-tailed lemur
403
+ 384: indri
404
+ 385: Asian elephant
405
+ 386: African bush elephant
406
+ 387: red panda
407
+ 388: giant panda
408
+ 389: snoek
409
+ 390: eel
410
+ 391: coho salmon
411
+ 392: rock beauty
412
+ 393: clownfish
413
+ 394: sturgeon
414
+ 395: garfish
415
+ 396: lionfish
416
+ 397: pufferfish
417
+ 398: abacus
418
+ 399: abaya
419
+ 400: academic gown
420
+ 401: accordion
421
+ 402: acoustic guitar
422
+ 403: aircraft carrier
423
+ 404: airliner
424
+ 405: airship
425
+ 406: altar
426
+ 407: ambulance
427
+ 408: amphibious vehicle
428
+ 409: analog clock
429
+ 410: apiary
430
+ 411: apron
431
+ 412: waste container
432
+ 413: assault rifle
433
+ 414: backpack
434
+ 415: bakery
435
+ 416: balance beam
436
+ 417: balloon
437
+ 418: ballpoint pen
438
+ 419: Band-Aid
439
+ 420: banjo
440
+ 421: baluster
441
+ 422: barbell
442
+ 423: barber chair
443
+ 424: barbershop
444
+ 425: barn
445
+ 426: barometer
446
+ 427: barrel
447
+ 428: wheelbarrow
448
+ 429: baseball
449
+ 430: basketball
450
+ 431: bassinet
451
+ 432: bassoon
452
+ 433: swimming cap
453
+ 434: bath towel
454
+ 435: bathtub
455
+ 436: station wagon
456
+ 437: lighthouse
457
+ 438: beaker
458
+ 439: military cap
459
+ 440: beer bottle
460
+ 441: beer glass
461
+ 442: bell-cot
462
+ 443: bib
463
+ 444: tandem bicycle
464
+ 445: bikini
465
+ 446: ring binder
466
+ 447: binoculars
467
+ 448: birdhouse
468
+ 449: boathouse
469
+ 450: bobsleigh
470
+ 451: bolo tie
471
+ 452: poke bonnet
472
+ 453: bookcase
473
+ 454: bookstore
474
+ 455: bottle cap
475
+ 456: bow
476
+ 457: bow tie
477
+ 458: brass
478
+ 459: bra
479
+ 460: breakwater
480
+ 461: breastplate
481
+ 462: broom
482
+ 463: bucket
483
+ 464: buckle
484
+ 465: bulletproof vest
485
+ 466: high-speed train
486
+ 467: butcher shop
487
+ 468: taxicab
488
+ 469: cauldron
489
+ 470: candle
490
+ 471: cannon
491
+ 472: canoe
492
+ 473: can opener
493
+ 474: cardigan
494
+ 475: car mirror
495
+ 476: carousel
496
+ 477: tool kit
497
+ 478: carton
498
+ 479: car wheel
499
+ 480: automated teller machine
500
+ 481: cassette
501
+ 482: cassette player
502
+ 483: castle
503
+ 484: catamaran
504
+ 485: CD player
505
+ 486: cello
506
+ 487: mobile phone
507
+ 488: chain
508
+ 489: chain-link fence
509
+ 490: chain mail
510
+ 491: chainsaw
511
+ 492: chest
512
+ 493: chiffonier
513
+ 494: chime
514
+ 495: china cabinet
515
+ 496: Christmas stocking
516
+ 497: church
517
+ 498: movie theater
518
+ 499: cleaver
519
+ 500: cliff dwelling
520
+ 501: cloak
521
+ 502: clogs
522
+ 503: cocktail shaker
523
+ 504: coffee mug
524
+ 505: coffeemaker
525
+ 506: coil
526
+ 507: combination lock
527
+ 508: computer keyboard
528
+ 509: confectionery store
529
+ 510: container ship
530
+ 511: convertible
531
+ 512: corkscrew
532
+ 513: cornet
533
+ 514: cowboy boot
534
+ 515: cowboy hat
535
+ 516: cradle
536
+ 517: crane (machine)
537
+ 518: crash helmet
538
+ 519: crate
539
+ 520: infant bed
540
+ 521: Crock Pot
541
+ 522: croquet ball
542
+ 523: crutch
543
+ 524: cuirass
544
+ 525: dam
545
+ 526: desk
546
+ 527: desktop computer
547
+ 528: rotary dial telephone
548
+ 529: diaper
549
+ 530: digital clock
550
+ 531: digital watch
551
+ 532: dining table
552
+ 533: dishcloth
553
+ 534: dishwasher
554
+ 535: disc brake
555
+ 536: dock
556
+ 537: dog sled
557
+ 538: dome
558
+ 539: doormat
559
+ 540: drilling rig
560
+ 541: drum
561
+ 542: drumstick
562
+ 543: dumbbell
563
+ 544: Dutch oven
564
+ 545: electric fan
565
+ 546: electric guitar
566
+ 547: electric locomotive
567
+ 548: entertainment center
568
+ 549: envelope
569
+ 550: espresso machine
570
+ 551: face powder
571
+ 552: feather boa
572
+ 553: filing cabinet
573
+ 554: fireboat
574
+ 555: fire engine
575
+ 556: fire screen sheet
576
+ 557: flagpole
577
+ 558: flute
578
+ 559: folding chair
579
+ 560: football helmet
580
+ 561: forklift
581
+ 562: fountain
582
+ 563: fountain pen
583
+ 564: four-poster bed
584
+ 565: freight car
585
+ 566: French horn
586
+ 567: frying pan
587
+ 568: fur coat
588
+ 569: garbage truck
589
+ 570: gas mask
590
+ 571: gas pump
591
+ 572: goblet
592
+ 573: go-kart
593
+ 574: golf ball
594
+ 575: golf cart
595
+ 576: gondola
596
+ 577: gong
597
+ 578: gown
598
+ 579: grand piano
599
+ 580: greenhouse
600
+ 581: grille
601
+ 582: grocery store
602
+ 583: guillotine
603
+ 584: barrette
604
+ 585: hair spray
605
+ 586: half-track
606
+ 587: hammer
607
+ 588: hamper
608
+ 589: hair dryer
609
+ 590: hand-held computer
610
+ 591: handkerchief
611
+ 592: hard disk drive
612
+ 593: harmonica
613
+ 594: harp
614
+ 595: harvester
615
+ 596: hatchet
616
+ 597: holster
617
+ 598: home theater
618
+ 599: honeycomb
619
+ 600: hook
620
+ 601: hoop skirt
621
+ 602: horizontal bar
622
+ 603: horse-drawn vehicle
623
+ 604: hourglass
624
+ 605: iPod
625
+ 606: clothes iron
626
+ 607: jack-o'-lantern
627
+ 608: jeans
628
+ 609: jeep
629
+ 610: T-shirt
630
+ 611: jigsaw puzzle
631
+ 612: pulled rickshaw
632
+ 613: joystick
633
+ 614: kimono
634
+ 615: knee pad
635
+ 616: knot
636
+ 617: lab coat
637
+ 618: ladle
638
+ 619: lampshade
639
+ 620: laptop computer
640
+ 621: lawn mower
641
+ 622: lens cap
642
+ 623: paper knife
643
+ 624: library
644
+ 625: lifeboat
645
+ 626: lighter
646
+ 627: limousine
647
+ 628: ocean liner
648
+ 629: lipstick
649
+ 630: slip-on shoe
650
+ 631: lotion
651
+ 632: speaker
652
+ 633: loupe
653
+ 634: sawmill
654
+ 635: magnetic compass
655
+ 636: mail bag
656
+ 637: mailbox
657
+ 638: tights
658
+ 639: tank suit
659
+ 640: manhole cover
660
+ 641: maraca
661
+ 642: marimba
662
+ 643: mask
663
+ 644: match
664
+ 645: maypole
665
+ 646: maze
666
+ 647: measuring cup
667
+ 648: medicine chest
668
+ 649: megalith
669
+ 650: microphone
670
+ 651: microwave oven
671
+ 652: military uniform
672
+ 653: milk can
673
+ 654: minibus
674
+ 655: miniskirt
675
+ 656: minivan
676
+ 657: missile
677
+ 658: mitten
678
+ 659: mixing bowl
679
+ 660: mobile home
680
+ 661: Model T
681
+ 662: modem
682
+ 663: monastery
683
+ 664: monitor
684
+ 665: moped
685
+ 666: mortar
686
+ 667: square academic cap
687
+ 668: mosque
688
+ 669: mosquito net
689
+ 670: scooter
690
+ 671: mountain bike
691
+ 672: tent
692
+ 673: computer mouse
693
+ 674: mousetrap
694
+ 675: moving van
695
+ 676: muzzle
696
+ 677: nail
697
+ 678: neck brace
698
+ 679: necklace
699
+ 680: nipple
700
+ 681: notebook computer
701
+ 682: obelisk
702
+ 683: oboe
703
+ 684: ocarina
704
+ 685: odometer
705
+ 686: oil filter
706
+ 687: organ
707
+ 688: oscilloscope
708
+ 689: overskirt
709
+ 690: bullock cart
710
+ 691: oxygen mask
711
+ 692: packet
712
+ 693: paddle
713
+ 694: paddle wheel
714
+ 695: padlock
715
+ 696: paintbrush
716
+ 697: pajamas
717
+ 698: palace
718
+ 699: pan flute
719
+ 700: paper towel
720
+ 701: parachute
721
+ 702: parallel bars
722
+ 703: park bench
723
+ 704: parking meter
724
+ 705: passenger car
725
+ 706: patio
726
+ 707: payphone
727
+ 708: pedestal
728
+ 709: pencil case
729
+ 710: pencil sharpener
730
+ 711: perfume
731
+ 712: Petri dish
732
+ 713: photocopier
733
+ 714: plectrum
734
+ 715: Pickelhaube
735
+ 716: picket fence
736
+ 717: pickup truck
737
+ 718: pier
738
+ 719: piggy bank
739
+ 720: pill bottle
740
+ 721: pillow
741
+ 722: ping-pong ball
742
+ 723: pinwheel
743
+ 724: pirate ship
744
+ 725: pitcher
745
+ 726: hand plane
746
+ 727: planetarium
747
+ 728: plastic bag
748
+ 729: plate rack
749
+ 730: plow
750
+ 731: plunger
751
+ 732: Polaroid camera
752
+ 733: pole
753
+ 734: police van
754
+ 735: poncho
755
+ 736: billiard table
756
+ 737: soda bottle
757
+ 738: pot
758
+ 739: potter's wheel
759
+ 740: power drill
760
+ 741: prayer rug
761
+ 742: printer
762
+ 743: prison
763
+ 744: projectile
764
+ 745: projector
765
+ 746: hockey puck
766
+ 747: punching bag
767
+ 748: purse
768
+ 749: quill
769
+ 750: quilt
770
+ 751: race car
771
+ 752: racket
772
+ 753: radiator
773
+ 754: radio
774
+ 755: radio telescope
775
+ 756: rain barrel
776
+ 757: recreational vehicle
777
+ 758: reel
778
+ 759: reflex camera
779
+ 760: refrigerator
780
+ 761: remote control
781
+ 762: restaurant
782
+ 763: revolver
783
+ 764: rifle
784
+ 765: rocking chair
785
+ 766: rotisserie
786
+ 767: eraser
787
+ 768: rugby ball
788
+ 769: ruler
789
+ 770: running shoe
790
+ 771: safe
791
+ 772: safety pin
792
+ 773: salt shaker
793
+ 774: sandal
794
+ 775: sarong
795
+ 776: saxophone
796
+ 777: scabbard
797
+ 778: weighing scale
798
+ 779: school bus
799
+ 780: schooner
800
+ 781: scoreboard
801
+ 782: CRT screen
802
+ 783: screw
803
+ 784: screwdriver
804
+ 785: seat belt
805
+ 786: sewing machine
806
+ 787: shield
807
+ 788: shoe store
808
+ 789: shoji
809
+ 790: shopping basket
810
+ 791: shopping cart
811
+ 792: shovel
812
+ 793: shower cap
813
+ 794: shower curtain
814
+ 795: ski
815
+ 796: ski mask
816
+ 797: sleeping bag
817
+ 798: slide rule
818
+ 799: sliding door
819
+ 800: slot machine
820
+ 801: snorkel
821
+ 802: snowmobile
822
+ 803: snowplow
823
+ 804: soap dispenser
824
+ 805: soccer ball
825
+ 806: sock
826
+ 807: solar thermal collector
827
+ 808: sombrero
828
+ 809: soup bowl
829
+ 810: space bar
830
+ 811: space heater
831
+ 812: space shuttle
832
+ 813: spatula
833
+ 814: motorboat
834
+ 815: spider web
835
+ 816: spindle
836
+ 817: sports car
837
+ 818: spotlight
838
+ 819: stage
839
+ 820: steam locomotive
840
+ 821: through arch bridge
841
+ 822: steel drum
842
+ 823: stethoscope
843
+ 824: scarf
844
+ 825: stone wall
845
+ 826: stopwatch
846
+ 827: stove
847
+ 828: strainer
848
+ 829: tram
849
+ 830: stretcher
850
+ 831: couch
851
+ 832: stupa
852
+ 833: submarine
853
+ 834: suit
854
+ 835: sundial
855
+ 836: sunglass
856
+ 837: sunglasses
857
+ 838: sunscreen
858
+ 839: suspension bridge
859
+ 840: mop
860
+ 841: sweatshirt
861
+ 842: swimsuit
862
+ 843: swing
863
+ 844: switch
864
+ 845: syringe
865
+ 846: table lamp
866
+ 847: tank
867
+ 848: tape player
868
+ 849: teapot
869
+ 850: teddy bear
870
+ 851: television
871
+ 852: tennis ball
872
+ 853: thatched roof
873
+ 854: front curtain
874
+ 855: thimble
875
+ 856: threshing machine
876
+ 857: throne
877
+ 858: tile roof
878
+ 859: toaster
879
+ 860: tobacco shop
880
+ 861: toilet seat
881
+ 862: torch
882
+ 863: totem pole
883
+ 864: tow truck
884
+ 865: toy store
885
+ 866: tractor
886
+ 867: semi-trailer truck
887
+ 868: tray
888
+ 869: trench coat
889
+ 870: tricycle
890
+ 871: trimaran
891
+ 872: tripod
892
+ 873: triumphal arch
893
+ 874: trolleybus
894
+ 875: trombone
895
+ 876: tub
896
+ 877: turnstile
897
+ 878: typewriter keyboard
898
+ 879: umbrella
899
+ 880: unicycle
900
+ 881: upright piano
901
+ 882: vacuum cleaner
902
+ 883: vase
903
+ 884: vault
904
+ 885: velvet
905
+ 886: vending machine
906
+ 887: vestment
907
+ 888: viaduct
908
+ 889: violin
909
+ 890: volleyball
910
+ 891: waffle iron
911
+ 892: wall clock
912
+ 893: wallet
913
+ 894: wardrobe
914
+ 895: military aircraft
915
+ 896: sink
916
+ 897: washing machine
917
+ 898: water bottle
918
+ 899: water jug
919
+ 900: water tower
920
+ 901: whiskey jug
921
+ 902: whistle
922
+ 903: wig
923
+ 904: window screen
924
+ 905: window shade
925
+ 906: Windsor tie
926
+ 907: wine bottle
927
+ 908: wing
928
+ 909: wok
929
+ 910: wooden spoon
930
+ 911: wool
931
+ 912: split-rail fence
932
+ 913: shipwreck
933
+ 914: yawl
934
+ 915: yurt
935
+ 916: website
936
+ 917: comic book
937
+ 918: crossword
938
+ 919: traffic sign
939
+ 920: traffic light
940
+ 921: dust jacket
941
+ 922: menu
942
+ 923: plate
943
+ 924: guacamole
944
+ 925: consomme
945
+ 926: hot pot
946
+ 927: trifle
947
+ 928: ice cream
948
+ 929: ice pop
949
+ 930: baguette
950
+ 931: bagel
951
+ 932: pretzel
952
+ 933: cheeseburger
953
+ 934: hot dog
954
+ 935: mashed potato
955
+ 936: cabbage
956
+ 937: broccoli
957
+ 938: cauliflower
958
+ 939: zucchini
959
+ 940: spaghetti squash
960
+ 941: acorn squash
961
+ 942: butternut squash
962
+ 943: cucumber
963
+ 944: artichoke
964
+ 945: bell pepper
965
+ 946: cardoon
966
+ 947: mushroom
967
+ 948: Granny Smith
968
+ 949: strawberry
969
+ 950: orange
970
+ 951: lemon
971
+ 952: fig
972
+ 953: pineapple
973
+ 954: banana
974
+ 955: jackfruit
975
+ 956: custard apple
976
+ 957: pomegranate
977
+ 958: hay
978
+ 959: carbonara
979
+ 960: chocolate syrup
980
+ 961: dough
981
+ 962: meatloaf
982
+ 963: pizza
983
+ 964: pot pie
984
+ 965: burrito
985
+ 966: red wine
986
+ 967: espresso
987
+ 968: cup
988
+ 969: eggnog
989
+ 970: alp
990
+ 971: bubble
991
+ 972: cliff
992
+ 973: coral reef
993
+ 974: geyser
994
+ 975: lakeshore
995
+ 976: promontory
996
+ 977: shoal
997
+ 978: seashore
998
+ 979: valley
999
+ 980: volcano
1000
+ 981: baseball player
1001
+ 982: bridegroom
1002
+ 983: scuba diver
1003
+ 984: rapeseed
1004
+ 985: daisy
1005
+ 986: yellow lady's slipper
1006
+ 987: corn
1007
+ 988: acorn
1008
+ 989: rose hip
1009
+ 990: horse chestnut seed
1010
+ 991: coral fungus
1011
+ 992: agaric
1012
+ 993: gyromitra
1013
+ 994: stinkhorn mushroom
1014
+ 995: earth star
1015
+ 996: hen-of-the-woods
1016
+ 997: bolete
1017
+ 998: ear
1018
+ 999: toilet paper
1019
+
1020
+
1021
+ # Download script/URL (optional)
1022
+ download: data/scripts/get_imagenet.sh
data/Objects365.yaml ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # Objects365 dataset https://www.objects365.org/ by Megvii
3
+ # Example usage: python train.py --data Objects365.yaml
4
+ # parent
5
+ # ├── yolov5
6
+ # └── datasets
7
+ # └── Objects365 ← downloads here (712 GB = 367G data + 345G zips)
8
+
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/Objects365 # dataset root dir
12
+ train: images/train # train images (relative to 'path') 1742289 images
13
+ val: images/val # val images (relative to 'path') 80000 images
14
+ test: # test images (optional)
15
+
16
+ # Classes
17
+ names:
18
+ 0: Person
19
+ 1: Sneakers
20
+ 2: Chair
21
+ 3: Other Shoes
22
+ 4: Hat
23
+ 5: Car
24
+ 6: Lamp
25
+ 7: Glasses
26
+ 8: Bottle
27
+ 9: Desk
28
+ 10: Cup
29
+ 11: Street Lights
30
+ 12: Cabinet/shelf
31
+ 13: Handbag/Satchel
32
+ 14: Bracelet
33
+ 15: Plate
34
+ 16: Picture/Frame
35
+ 17: Helmet
36
+ 18: Book
37
+ 19: Gloves
38
+ 20: Storage box
39
+ 21: Boat
40
+ 22: Leather Shoes
41
+ 23: Flower
42
+ 24: Bench
43
+ 25: Potted Plant
44
+ 26: Bowl/Basin
45
+ 27: Flag
46
+ 28: Pillow
47
+ 29: Boots
48
+ 30: Vase
49
+ 31: Microphone
50
+ 32: Necklace
51
+ 33: Ring
52
+ 34: SUV
53
+ 35: Wine Glass
54
+ 36: Belt
55
+ 37: Monitor/TV
56
+ 38: Backpack
57
+ 39: Umbrella
58
+ 40: Traffic Light
59
+ 41: Speaker
60
+ 42: Watch
61
+ 43: Tie
62
+ 44: Trash bin Can
63
+ 45: Slippers
64
+ 46: Bicycle
65
+ 47: Stool
66
+ 48: Barrel/bucket
67
+ 49: Van
68
+ 50: Couch
69
+ 51: Sandals
70
+ 52: Basket
71
+ 53: Drum
72
+ 54: Pen/Pencil
73
+ 55: Bus
74
+ 56: Wild Bird
75
+ 57: High Heels
76
+ 58: Motorcycle
77
+ 59: Guitar
78
+ 60: Carpet
79
+ 61: Cell Phone
80
+ 62: Bread
81
+ 63: Camera
82
+ 64: Canned
83
+ 65: Truck
84
+ 66: Traffic cone
85
+ 67: Cymbal
86
+ 68: Lifesaver
87
+ 69: Towel
88
+ 70: Stuffed Toy
89
+ 71: Candle
90
+ 72: Sailboat
91
+ 73: Laptop
92
+ 74: Awning
93
+ 75: Bed
94
+ 76: Faucet
95
+ 77: Tent
96
+ 78: Horse
97
+ 79: Mirror
98
+ 80: Power outlet
99
+ 81: Sink
100
+ 82: Apple
101
+ 83: Air Conditioner
102
+ 84: Knife
103
+ 85: Hockey Stick
104
+ 86: Paddle
105
+ 87: Pickup Truck
106
+ 88: Fork
107
+ 89: Traffic Sign
108
+ 90: Balloon
109
+ 91: Tripod
110
+ 92: Dog
111
+ 93: Spoon
112
+ 94: Clock
113
+ 95: Pot
114
+ 96: Cow
115
+ 97: Cake
116
+ 98: Dinning Table
117
+ 99: Sheep
118
+ 100: Hanger
119
+ 101: Blackboard/Whiteboard
120
+ 102: Napkin
121
+ 103: Other Fish
122
+ 104: Orange/Tangerine
123
+ 105: Toiletry
124
+ 106: Keyboard
125
+ 107: Tomato
126
+ 108: Lantern
127
+ 109: Machinery Vehicle
128
+ 110: Fan
129
+ 111: Green Vegetables
130
+ 112: Banana
131
+ 113: Baseball Glove
132
+ 114: Airplane
133
+ 115: Mouse
134
+ 116: Train
135
+ 117: Pumpkin
136
+ 118: Soccer
137
+ 119: Skiboard
138
+ 120: Luggage
139
+ 121: Nightstand
140
+ 122: Tea pot
141
+ 123: Telephone
142
+ 124: Trolley
143
+ 125: Head Phone
144
+ 126: Sports Car
145
+ 127: Stop Sign
146
+ 128: Dessert
147
+ 129: Scooter
148
+ 130: Stroller
149
+ 131: Crane
150
+ 132: Remote
151
+ 133: Refrigerator
152
+ 134: Oven
153
+ 135: Lemon
154
+ 136: Duck
155
+ 137: Baseball Bat
156
+ 138: Surveillance Camera
157
+ 139: Cat
158
+ 140: Jug
159
+ 141: Broccoli
160
+ 142: Piano
161
+ 143: Pizza
162
+ 144: Elephant
163
+ 145: Skateboard
164
+ 146: Surfboard
165
+ 147: Gun
166
+ 148: Skating and Skiing shoes
167
+ 149: Gas stove
168
+ 150: Donut
169
+ 151: Bow Tie
170
+ 152: Carrot
171
+ 153: Toilet
172
+ 154: Kite
173
+ 155: Strawberry
174
+ 156: Other Balls
175
+ 157: Shovel
176
+ 158: Pepper
177
+ 159: Computer Box
178
+ 160: Toilet Paper
179
+ 161: Cleaning Products
180
+ 162: Chopsticks
181
+ 163: Microwave
182
+ 164: Pigeon
183
+ 165: Baseball
184
+ 166: Cutting/chopping Board
185
+ 167: Coffee Table
186
+ 168: Side Table
187
+ 169: Scissors
188
+ 170: Marker
189
+ 171: Pie
190
+ 172: Ladder
191
+ 173: Snowboard
192
+ 174: Cookies
193
+ 175: Radiator
194
+ 176: Fire Hydrant
195
+ 177: Basketball
196
+ 178: Zebra
197
+ 179: Grape
198
+ 180: Giraffe
199
+ 181: Potato
200
+ 182: Sausage
201
+ 183: Tricycle
202
+ 184: Violin
203
+ 185: Egg
204
+ 186: Fire Extinguisher
205
+ 187: Candy
206
+ 188: Fire Truck
207
+ 189: Billiards
208
+ 190: Converter
209
+ 191: Bathtub
210
+ 192: Wheelchair
211
+ 193: Golf Club
212
+ 194: Briefcase
213
+ 195: Cucumber
214
+ 196: Cigar/Cigarette
215
+ 197: Paint Brush
216
+ 198: Pear
217
+ 199: Heavy Truck
218
+ 200: Hamburger
219
+ 201: Extractor
220
+ 202: Extension Cord
221
+ 203: Tong
222
+ 204: Tennis Racket
223
+ 205: Folder
224
+ 206: American Football
225
+ 207: earphone
226
+ 208: Mask
227
+ 209: Kettle
228
+ 210: Tennis
229
+ 211: Ship
230
+ 212: Swing
231
+ 213: Coffee Machine
232
+ 214: Slide
233
+ 215: Carriage
234
+ 216: Onion
235
+ 217: Green beans
236
+ 218: Projector
237
+ 219: Frisbee
238
+ 220: Washing Machine/Drying Machine
239
+ 221: Chicken
240
+ 222: Printer
241
+ 223: Watermelon
242
+ 224: Saxophone
243
+ 225: Tissue
244
+ 226: Toothbrush
245
+ 227: Ice cream
246
+ 228: Hot-air balloon
247
+ 229: Cello
248
+ 230: French Fries
249
+ 231: Scale
250
+ 232: Trophy
251
+ 233: Cabbage
252
+ 234: Hot dog
253
+ 235: Blender
254
+ 236: Peach
255
+ 237: Rice
256
+ 238: Wallet/Purse
257
+ 239: Volleyball
258
+ 240: Deer
259
+ 241: Goose
260
+ 242: Tape
261
+ 243: Tablet
262
+ 244: Cosmetics
263
+ 245: Trumpet
264
+ 246: Pineapple
265
+ 247: Golf Ball
266
+ 248: Ambulance
267
+ 249: Parking meter
268
+ 250: Mango
269
+ 251: Key
270
+ 252: Hurdle
271
+ 253: Fishing Rod
272
+ 254: Medal
273
+ 255: Flute
274
+ 256: Brush
275
+ 257: Penguin
276
+ 258: Megaphone
277
+ 259: Corn
278
+ 260: Lettuce
279
+ 261: Garlic
280
+ 262: Swan
281
+ 263: Helicopter
282
+ 264: Green Onion
283
+ 265: Sandwich
284
+ 266: Nuts
285
+ 267: Speed Limit Sign
286
+ 268: Induction Cooker
287
+ 269: Broom
288
+ 270: Trombone
289
+ 271: Plum
290
+ 272: Rickshaw
291
+ 273: Goldfish
292
+ 274: Kiwi fruit
293
+ 275: Router/modem
294
+ 276: Poker Card
295
+ 277: Toaster
296
+ 278: Shrimp
297
+ 279: Sushi
298
+ 280: Cheese
299
+ 281: Notepaper
300
+ 282: Cherry
301
+ 283: Pliers
302
+ 284: CD
303
+ 285: Pasta
304
+ 286: Hammer
305
+ 287: Cue
306
+ 288: Avocado
307
+ 289: Hamimelon
308
+ 290: Flask
309
+ 291: Mushroom
310
+ 292: Screwdriver
311
+ 293: Soap
312
+ 294: Recorder
313
+ 295: Bear
314
+ 296: Eggplant
315
+ 297: Board Eraser
316
+ 298: Coconut
317
+ 299: Tape Measure/Ruler
318
+ 300: Pig
319
+ 301: Showerhead
320
+ 302: Globe
321
+ 303: Chips
322
+ 304: Steak
323
+ 305: Crosswalk Sign
324
+ 306: Stapler
325
+ 307: Camel
326
+ 308: Formula 1
327
+ 309: Pomegranate
328
+ 310: Dishwasher
329
+ 311: Crab
330
+ 312: Hoverboard
331
+ 313: Meat ball
332
+ 314: Rice Cooker
333
+ 315: Tuba
334
+ 316: Calculator
335
+ 317: Papaya
336
+ 318: Antelope
337
+ 319: Parrot
338
+ 320: Seal
339
+ 321: Butterfly
340
+ 322: Dumbbell
341
+ 323: Donkey
342
+ 324: Lion
343
+ 325: Urinal
344
+ 326: Dolphin
345
+ 327: Electric Drill
346
+ 328: Hair Dryer
347
+ 329: Egg tart
348
+ 330: Jellyfish
349
+ 331: Treadmill
350
+ 332: Lighter
351
+ 333: Grapefruit
352
+ 334: Game board
353
+ 335: Mop
354
+ 336: Radish
355
+ 337: Baozi
356
+ 338: Target
357
+ 339: French
358
+ 340: Spring Rolls
359
+ 341: Monkey
360
+ 342: Rabbit
361
+ 343: Pencil Case
362
+ 344: Yak
363
+ 345: Red Cabbage
364
+ 346: Binoculars
365
+ 347: Asparagus
366
+ 348: Barbell
367
+ 349: Scallop
368
+ 350: Noddles
369
+ 351: Comb
370
+ 352: Dumpling
371
+ 353: Oyster
372
+ 354: Table Tennis paddle
373
+ 355: Cosmetics Brush/Eyeliner Pencil
374
+ 356: Chainsaw
375
+ 357: Eraser
376
+ 358: Lobster
377
+ 359: Durian
378
+ 360: Okra
379
+ 361: Lipstick
380
+ 362: Cosmetics Mirror
381
+ 363: Curling
382
+ 364: Table Tennis
383
+
384
+
385
+ # Download script/URL (optional) ---------------------------------------------------------------------------------------
386
+ download: |
387
+ from tqdm import tqdm
388
+
389
+ from utils.general import Path, check_requirements, download, np, xyxy2xywhn
390
+
391
+ check_requirements('pycocotools>=2.0')
392
+ from pycocotools.coco import COCO
393
+
394
+ # Make Directories
395
+ dir = Path(yaml['path']) # dataset root dir
396
+ for p in 'images', 'labels':
397
+ (dir / p).mkdir(parents=True, exist_ok=True)
398
+ for q in 'train', 'val':
399
+ (dir / p / q).mkdir(parents=True, exist_ok=True)
400
+
401
+ # Train, Val Splits
402
+ for split, patches in [('train', 50 + 1), ('val', 43 + 1)]:
403
+ print(f"Processing {split} in {patches} patches ...")
404
+ images, labels = dir / 'images' / split, dir / 'labels' / split
405
+
406
+ # Download
407
+ url = f"https://dorc.ks3-cn-beijing.ksyun.com/data-set/2020Objects365%E6%95%B0%E6%8D%AE%E9%9B%86/{split}/"
408
+ if split == 'train':
409
+ download([f'{url}zhiyuan_objv2_{split}.tar.gz'], dir=dir, delete=False) # annotations json
410
+ download([f'{url}patch{i}.tar.gz' for i in range(patches)], dir=images, curl=True, delete=False, threads=8)
411
+ elif split == 'val':
412
+ download([f'{url}zhiyuan_objv2_{split}.json'], dir=dir, delete=False) # annotations json
413
+ download([f'{url}images/v1/patch{i}.tar.gz' for i in range(15 + 1)], dir=images, curl=True, delete=False, threads=8)
414
+ download([f'{url}images/v2/patch{i}.tar.gz' for i in range(16, patches)], dir=images, curl=True, delete=False, threads=8)
415
+
416
+ # Move
417
+ for f in tqdm(images.rglob('*.jpg'), desc=f'Moving {split} images'):
418
+ f.rename(images / f.name) # move to /images/{split}
419
+
420
+ # Labels
421
+ coco = COCO(dir / f'zhiyuan_objv2_{split}.json')
422
+ names = [x["name"] for x in coco.loadCats(coco.getCatIds())]
423
+ for cid, cat in enumerate(names):
424
+ catIds = coco.getCatIds(catNms=[cat])
425
+ imgIds = coco.getImgIds(catIds=catIds)
426
+ for im in tqdm(coco.loadImgs(imgIds), desc=f'Class {cid + 1}/{len(names)} {cat}'):
427
+ width, height = im["width"], im["height"]
428
+ path = Path(im["file_name"]) # image filename
429
+ try:
430
+ with open(labels / path.with_suffix('.txt').name, 'a') as file:
431
+ annIds = coco.getAnnIds(imgIds=im["id"], catIds=catIds, iscrowd=False)
432
+ for a in coco.loadAnns(annIds):
433
+ x, y, w, h = a['bbox'] # bounding box in xywh (xy top-left corner)
434
+ xyxy = np.array([x, y, x + w, y + h])[None] # pixels(1,4)
435
+ x, y, w, h = xyxy2xywhn(xyxy, w=width, h=height, clip=True)[0] # normalized and clipped
436
+ file.write(f"{cid} {x:.5f} {y:.5f} {w:.5f} {h:.5f}\n")
437
+ except Exception as e:
438
+ print(e)
data/SKU-110K.yaml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # SKU-110K retail items dataset https://github.com/eg4000/SKU110K_CVPR19 by Trax Retail
3
+ # Example usage: python train.py --data SKU-110K.yaml
4
+ # parent
5
+ # ├── yolov5
6
+ # └── datasets
7
+ # └── SKU-110K ← downloads here (13.6 GB)
8
+
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/SKU-110K # dataset root dir
12
+ train: train.txt # train images (relative to 'path') 8219 images
13
+ val: val.txt # val images (relative to 'path') 588 images
14
+ test: test.txt # test images (optional) 2936 images
15
+
16
+ # Classes
17
+ names:
18
+ 0: object
19
+
20
+
21
+ # Download script/URL (optional) ---------------------------------------------------------------------------------------
22
+ download: |
23
+ import shutil
24
+ from tqdm import tqdm
25
+ from utils.general import np, pd, Path, download, xyxy2xywh
26
+
27
+
28
+ # Download
29
+ dir = Path(yaml['path']) # dataset root dir
30
+ parent = Path(dir.parent) # download dir
31
+ urls = ['http://trax-geometry.s3.amazonaws.com/cvpr_challenge/SKU110K_fixed.tar.gz']
32
+ download(urls, dir=parent, delete=False)
33
+
34
+ # Rename directories
35
+ if dir.exists():
36
+ shutil.rmtree(dir)
37
+ (parent / 'SKU110K_fixed').rename(dir) # rename dir
38
+ (dir / 'labels').mkdir(parents=True, exist_ok=True) # create labels dir
39
+
40
+ # Convert labels
41
+ names = 'image', 'x1', 'y1', 'x2', 'y2', 'class', 'image_width', 'image_height' # column names
42
+ for d in 'annotations_train.csv', 'annotations_val.csv', 'annotations_test.csv':
43
+ x = pd.read_csv(dir / 'annotations' / d, names=names).values # annotations
44
+ images, unique_images = x[:, 0], np.unique(x[:, 0])
45
+ with open((dir / d).with_suffix('.txt').__str__().replace('annotations_', ''), 'w') as f:
46
+ f.writelines(f'./images/{s}\n' for s in unique_images)
47
+ for im in tqdm(unique_images, desc=f'Converting {dir / d}'):
48
+ cls = 0 # single-class dataset
49
+ with open((dir / 'labels' / im).with_suffix('.txt'), 'a') as f:
50
+ for r in x[images == im]:
51
+ w, h = r[6], r[7] # image width, height
52
+ xywh = xyxy2xywh(np.array([[r[1] / w, r[2] / h, r[3] / w, r[4] / h]]))[0] # instance
53
+ f.write(f"{cls} {xywh[0]:.5f} {xywh[1]:.5f} {xywh[2]:.5f} {xywh[3]:.5f}\n") # write label
data/VOC.yaml ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # PASCAL VOC dataset http://host.robots.ox.ac.uk/pascal/VOC by University of Oxford
3
+ # Example usage: python train.py --data VOC.yaml
4
+ # parent
5
+ # ├── yolov5
6
+ # └── datasets
7
+ # └── VOC ← downloads here (2.8 GB)
8
+
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/VOC
12
+ train: # train images (relative to 'path') 16551 images
13
+ - images/train2012
14
+ - images/train2007
15
+ - images/val2012
16
+ - images/val2007
17
+ val: # val images (relative to 'path') 4952 images
18
+ - images/test2007
19
+ test: # test images (optional)
20
+ - images/test2007
21
+
22
+ # Classes
23
+ names:
24
+ 0: aeroplane
25
+ 1: bicycle
26
+ 2: bird
27
+ 3: boat
28
+ 4: bottle
29
+ 5: bus
30
+ 6: car
31
+ 7: cat
32
+ 8: chair
33
+ 9: cow
34
+ 10: diningtable
35
+ 11: dog
36
+ 12: horse
37
+ 13: motorbike
38
+ 14: person
39
+ 15: pottedplant
40
+ 16: sheep
41
+ 17: sofa
42
+ 18: train
43
+ 19: tvmonitor
44
+
45
+
46
+ # Download script/URL (optional) ---------------------------------------------------------------------------------------
47
+ download: |
48
+ import xml.etree.ElementTree as ET
49
+
50
+ from tqdm import tqdm
51
+ from utils.general import download, Path
52
+
53
+
54
+ def convert_label(path, lb_path, year, image_id):
55
+ def convert_box(size, box):
56
+ dw, dh = 1. / size[0], 1. / size[1]
57
+ x, y, w, h = (box[0] + box[1]) / 2.0 - 1, (box[2] + box[3]) / 2.0 - 1, box[1] - box[0], box[3] - box[2]
58
+ return x * dw, y * dh, w * dw, h * dh
59
+
60
+ in_file = open(path / f'VOC{year}/Annotations/{image_id}.xml')
61
+ out_file = open(lb_path, 'w')
62
+ tree = ET.parse(in_file)
63
+ root = tree.getroot()
64
+ size = root.find('size')
65
+ w = int(size.find('width').text)
66
+ h = int(size.find('height').text)
67
+
68
+ names = list(yaml['names'].values()) # names list
69
+ for obj in root.iter('object'):
70
+ cls = obj.find('name').text
71
+ if cls in names and int(obj.find('difficult').text) != 1:
72
+ xmlbox = obj.find('bndbox')
73
+ bb = convert_box((w, h), [float(xmlbox.find(x).text) for x in ('xmin', 'xmax', 'ymin', 'ymax')])
74
+ cls_id = names.index(cls) # class id
75
+ out_file.write(" ".join([str(a) for a in (cls_id, *bb)]) + '\n')
76
+
77
+
78
+ # Download
79
+ dir = Path(yaml['path']) # dataset root dir
80
+ url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
81
+ urls = [f'{url}VOCtrainval_06-Nov-2007.zip', # 446MB, 5012 images
82
+ f'{url}VOCtest_06-Nov-2007.zip', # 438MB, 4953 images
83
+ f'{url}VOCtrainval_11-May-2012.zip'] # 1.95GB, 17126 images
84
+ download(urls, dir=dir / 'images', delete=False, curl=True, threads=3)
85
+
86
+ # Convert
87
+ path = dir / 'images/VOCdevkit'
88
+ for year, image_set in ('2012', 'train'), ('2012', 'val'), ('2007', 'train'), ('2007', 'val'), ('2007', 'test'):
89
+ imgs_path = dir / 'images' / f'{image_set}{year}'
90
+ lbs_path = dir / 'labels' / f'{image_set}{year}'
91
+ imgs_path.mkdir(exist_ok=True, parents=True)
92
+ lbs_path.mkdir(exist_ok=True, parents=True)
93
+
94
+ with open(path / f'VOC{year}/ImageSets/Main/{image_set}.txt') as f:
95
+ image_ids = f.read().strip().split()
96
+ for id in tqdm(image_ids, desc=f'{image_set}{year}'):
97
+ f = path / f'VOC{year}/JPEGImages/{id}.jpg' # old img path
98
+ lb_path = (lbs_path / f.name).with_suffix('.txt') # new label path
99
+ f.rename(imgs_path / f.name) # move image
100
+ convert_label(path, lb_path, year, id) # convert labels to YOLO format
data/VisDrone.yaml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # VisDrone2019-DET dataset https://github.com/VisDrone/VisDrone-Dataset by Tianjin University
3
+ # Example usage: python train.py --data VisDrone.yaml
4
+ # parent
5
+ # ├── yolov5
6
+ # └── datasets
7
+ # └── VisDrone ← downloads here (2.3 GB)
8
+
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/VisDrone # dataset root dir
12
+ train: VisDrone2019-DET-train/images # train images (relative to 'path') 6471 images
13
+ val: VisDrone2019-DET-val/images # val images (relative to 'path') 548 images
14
+ test: VisDrone2019-DET-test-dev/images # test images (optional) 1610 images
15
+
16
+ # Classes
17
+ names:
18
+ 0: pedestrian
19
+ 1: people
20
+ 2: bicycle
21
+ 3: car
22
+ 4: van
23
+ 5: truck
24
+ 6: tricycle
25
+ 7: awning-tricycle
26
+ 8: bus
27
+ 9: motor
28
+
29
+
30
+ # Download script/URL (optional) ---------------------------------------------------------------------------------------
31
+ download: |
32
+ from utils.general import download, os, Path
33
+
34
+ def visdrone2yolo(dir):
35
+ from PIL import Image
36
+ from tqdm import tqdm
37
+
38
+ def convert_box(size, box):
39
+ # Convert VisDrone box to YOLO xywh box
40
+ dw = 1. / size[0]
41
+ dh = 1. / size[1]
42
+ return (box[0] + box[2] / 2) * dw, (box[1] + box[3] / 2) * dh, box[2] * dw, box[3] * dh
43
+
44
+ (dir / 'labels').mkdir(parents=True, exist_ok=True) # make labels directory
45
+ pbar = tqdm((dir / 'annotations').glob('*.txt'), desc=f'Converting {dir}')
46
+ for f in pbar:
47
+ img_size = Image.open((dir / 'images' / f.name).with_suffix('.jpg')).size
48
+ lines = []
49
+ with open(f, 'r') as file: # read annotation.txt
50
+ for row in [x.split(',') for x in file.read().strip().splitlines()]:
51
+ if row[4] == '0': # VisDrone 'ignored regions' class 0
52
+ continue
53
+ cls = int(row[5]) - 1
54
+ box = convert_box(img_size, tuple(map(int, row[:4])))
55
+ lines.append(f"{cls} {' '.join(f'{x:.6f}' for x in box)}\n")
56
+ with open(str(f).replace(os.sep + 'annotations' + os.sep, os.sep + 'labels' + os.sep), 'w') as fl:
57
+ fl.writelines(lines) # write label.txt
58
+
59
+
60
+ # Download
61
+ dir = Path(yaml['path']) # dataset root dir
62
+ urls = ['https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-train.zip',
63
+ 'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-val.zip',
64
+ 'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-test-dev.zip',
65
+ 'https://github.com/ultralytics/yolov5/releases/download/v1.0/VisDrone2019-DET-test-challenge.zip']
66
+ download(urls, dir=dir, curl=True, threads=4)
67
+
68
+ # Convert
69
+ for d in 'VisDrone2019-DET-train', 'VisDrone2019-DET-val', 'VisDrone2019-DET-test-dev':
70
+ visdrone2yolo(dir / d) # convert VisDrone annotations to YOLO labels
data/coco.yaml ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
2
+ # COCO 2017 dataset http://cocodataset.org by Microsoft
3
+ # Example usage: python train.py --data coco.yaml
4
+ # parent
5
+ # ├── yolov5
6
+ # └── datasets
7
+ # └── coco ← downloads here (20.1 GB)
8
+
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/coco # dataset root dir
12
+ train: train2017.txt # train images (relative to 'path') 118287 images
13
+ val: val2017.txt # val images (relative to 'path') 5000 images
14
+ test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794
15
+
16
+ # Classes
17
+ names:
18
+ 0: person
19
+ 1: bicycle
20
+ 2: car
21
+ 3: motorcycle
22
+ 4: airplane
23
+ 5: bus
24
+ 6: train
25
+ 7: truck
26
+ 8: boat
27
+ 9: traffic light
28
+ 10: fire hydrant
29
+ 11: stop sign
30
+ 12: parking meter
31
+ 13: bench
32
+ 14: bird
33
+ 15: cat
34
+ 16: dog
35
+ 17: horse
36
+ 18: sheep
37
+ 19: cow
38
+ 20: elephant
39
+ 21: bear
40
+ 22: zebra
41
+ 23: giraffe
42
+ 24: backpack
43
+ 25: umbrella
44
+ 26: handbag
45
+ 27: tie
46
+ 28: suitcase
47
+ 29: frisbee
48
+ 30: skis
49
+ 31: snowboard
50
+ 32: sports ball
51
+ 33: kite
52
+ 34: baseball bat
53
+ 35: baseball glove
54
+ 36: skateboard
55
+ 37: surfboard
56
+ 38: tennis racket
57
+ 39: bottle
58
+ 40: wine glass
59
+ 41: cup
60
+ 42: fork
61
+ 43: knife
62
+ 44: spoon
63
+ 45: bowl
64
+ 46: banana
65
+ 47: apple
66
+ 48: sandwich
67
+ 49: orange
68
+ 50: broccoli
69
+ 51: carrot
70
+ 52: hot dog
71
+ 53: pizza
72
+ 54: donut
73
+ 55: cake
74
+ 56: chair
75
+ 57: couch
76
+ 58: potted plant
77
+ 59: bed
78
+ 60: dining table
79
+ 61: toilet
80
+ 62: tv
81
+ 63: laptop
82
+ 64: mouse
83
+ 65: remote
84
+ 66: keyboard
85
+ 67: cell phone
86
+ 68: microwave
87
+ 69: oven
88
+ 70: toaster
89
+ 71: sink
90
+ 72: refrigerator
91
+ 73: book
92
+ 74: clock
93
+ 75: vase
94
+ 76: scissors
95
+ 77: teddy bear
96
+ 78: hair drier
97
+ 79: toothbrush
98
+
99
+
100
+ # Download script/URL (optional)
101
+ download: |
102
+ from utils.general import download, Path
103
+
104
+
105
+ # Download labels
106
+ segments = False # segment or box labels
107
+ dir = Path(yaml['path']) # dataset root dir
108
+ url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
109
+ urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')] # labels
110
+ download(urls, dir=dir.parent)
111
+
112
+ # Download data
113
+ urls = ['http://images.cocodataset.org/zips/train2017.zip', # 19G, 118k images
114
+ 'http://images.cocodataset.org/zips/val2017.zip', # 1G, 5k images
115
+ 'http://images.cocodataset.org/zips/test2017.zip'] # 7G, 41k images (optional)
116
+ download(urls, dir=dir / 'images', threads=3)