lvrgb777 commited on
Commit
da58077
1 Parent(s): fe9a897

Upload 310 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. .gitattributes +1 -0
  2. STPoseNet/.github/ISSUE_TEMPLATE/bug-report.yml +85 -0
  3. STPoseNet/.github/ISSUE_TEMPLATE/config.yml +11 -0
  4. STPoseNet/.github/ISSUE_TEMPLATE/feature-request.yml +50 -0
  5. STPoseNet/.github/ISSUE_TEMPLATE/question.yml +33 -0
  6. STPoseNet/.github/dependabot.yml +28 -0
  7. STPoseNet/.github/translate-readme.yml +26 -0
  8. STPoseNet/.github/workflows/ci.yaml +247 -0
  9. STPoseNet/.github/workflows/cla.yml +37 -0
  10. STPoseNet/.github/workflows/codeql.yaml +41 -0
  11. STPoseNet/.github/workflows/docker.yaml +133 -0
  12. STPoseNet/.github/workflows/greetings.yml +58 -0
  13. STPoseNet/.github/workflows/links.yml +40 -0
  14. STPoseNet/.github/workflows/publish.yml +110 -0
  15. STPoseNet/.github/workflows/stale.yml +47 -0
  16. STPoseNet/.gitignore +165 -0
  17. STPoseNet/.idea/.gitignore +3 -0
  18. STPoseNet/.idea/inspectionProfiles/Project_Default.xml +24 -0
  19. STPoseNet/.idea/inspectionProfiles/profiles_settings.xml +6 -0
  20. STPoseNet/.idea/misc.xml +4 -0
  21. STPoseNet/.idea/modules.xml +8 -0
  22. STPoseNet/.idea/ultralytics-main.iml +15 -0
  23. STPoseNet/.idea/workspace.xml +198 -0
  24. STPoseNet/.pre-commit-config.yaml +73 -0
  25. STPoseNet/CITATION.cff +20 -0
  26. STPoseNet/CONTRIBUTING.md +115 -0
  27. STPoseNet/MANIFEST.in +8 -0
  28. STPoseNet/README.md +55 -0
  29. STPoseNet/docker/Dockerfile +83 -0
  30. STPoseNet/docker/Dockerfile-arm64 +39 -0
  31. STPoseNet/docker/Dockerfile-cpu +49 -0
  32. STPoseNet/docker/Dockerfile-jetson +46 -0
  33. STPoseNet/docker/Dockerfile-python +49 -0
  34. STPoseNet/docker/Dockerfile-runner +37 -0
  35. STPoseNet/min_data_enhance.py +3 -0
  36. STPoseNet/mkdocs.yml +507 -0
  37. STPoseNet/mouse-pre.py +15 -0
  38. STPoseNet/mouse-train.py +19 -0
  39. STPoseNet/requirements.txt +45 -0
  40. STPoseNet/tmpni7swzfb +3 -0
  41. STPoseNet/tool/__pycache__/min_img_label.cpython-38.pyc +0 -0
  42. STPoseNet/tool/min_img_label.py +99 -0
  43. STPoseNet/trained_weight/weight_download.txt +2 -0
  44. STPoseNet/ultralytics/__init__.py +12 -0
  45. STPoseNet/ultralytics/__pycache__/__init__.cpython-38.pyc +0 -0
  46. STPoseNet/ultralytics/assets/bus.jpg +0 -0
  47. STPoseNet/ultralytics/assets/zidane.jpg +0 -0
  48. STPoseNet/ultralytics/cfg/__init__.py +460 -0
  49. STPoseNet/ultralytics/cfg/__pycache__/__init__.cpython-38.pyc +0 -0
  50. STPoseNet/ultralytics/cfg/datasets/Argoverse.yaml +73 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
 
 
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
36
+ STPoseNet/tmpni7swzfb filter=lfs diff=lfs merge=lfs -text
STPoseNet/.github/ISSUE_TEMPLATE/bug-report.yml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: 🐛 Bug Report
2
+ # title: " "
3
+ description: Problems with YOLOv8
4
+ labels: [bug, triage]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you for submitting a YOLOv8 🐛 Bug Report!
10
+
11
+ - type: checkboxes
12
+ attributes:
13
+ label: Search before asking
14
+ description: >
15
+ Please search the [issues](https://github.com/ultralytics/ultralytics/issues) to see if a similar bug report already exists.
16
+ options:
17
+ - label: >
18
+ I have searched the YOLOv8 [issues](https://github.com/ultralytics/ultralytics/issues) and found no similar bug report.
19
+ required: true
20
+
21
+ - type: dropdown
22
+ attributes:
23
+ label: YOLOv8 Component
24
+ description: |
25
+ Please select the part of YOLOv8 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: Ultralytics YOLOv8.0.21 🚀 Python-3.8.10 torch-1.13.1+cu117 CUDA:0 (A100-SXM-80GB, 81251MiB)
55
+ - OS: Ubuntu 20.04
56
+ - Python: 3.8.10
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/ultralytics/pulls) (PR) to help improve YOLOv8 for everyone, especially if you have a good understanding of how to implement a fix or feature.
83
+ See the YOLOv8 [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!
STPoseNet/.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/
5
+ about: Full Ultralytics YOLOv8 Documentation
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
STPoseNet/.github/ISSUE_TEMPLATE/feature-request.yml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: 🚀 Feature Request
2
+ description: Suggest a YOLOv8 idea
3
+ # title: " "
4
+ labels: [enhancement]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you for submitting a YOLOv8 🚀 Feature Request!
10
+
11
+ - type: checkboxes
12
+ attributes:
13
+ label: Search before asking
14
+ description: >
15
+ Please search the [issues](https://github.com/ultralytics/ultralytics/issues) to see if a similar feature request already exists.
16
+ options:
17
+ - label: >
18
+ I have searched the YOLOv8 [issues](https://github.com/ultralytics/ultralytics/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 YOLOv8?
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/ultralytics/pulls) (PR) to help improve YOLOv8 for everyone, especially if you have a good understanding of how to implement a fix or feature.
48
+ See the YOLOv8 [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!
STPoseNet/.github/ISSUE_TEMPLATE/question.yml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ❓ Question
2
+ description: Ask a YOLOv8 question
3
+ # title: " "
4
+ labels: [question]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you for asking a YOLOv8 ❓ Question!
10
+
11
+ - type: checkboxes
12
+ attributes:
13
+ label: Search before asking
14
+ description: >
15
+ Please search the [issues](https://github.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/discussions) to see if a similar question already exists.
16
+ options:
17
+ - label: >
18
+ I have searched the YOLOv8 [issues](https://github.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/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?
STPoseNet/.github/dependabot.yml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: pip
9
+ directory: "/"
10
+ schedule:
11
+ interval: weekly
12
+ time: "04:00"
13
+ open-pull-requests-limit: 10
14
+ reviewers:
15
+ - glenn-jocher
16
+ labels:
17
+ - dependencies
18
+
19
+ - package-ecosystem: github-actions
20
+ directory: "/"
21
+ schedule:
22
+ interval: weekly
23
+ time: "04:00"
24
+ open-pull-requests-limit: 5
25
+ reviewers:
26
+ - glenn-jocher
27
+ labels:
28
+ - dependencies
STPoseNet/.github/translate-readme.yml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # README translation action to translate README.md to Chinese as README.zh-CN.md on any change to README.md
3
+
4
+ name: Translate README
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - translate_readme # replace with 'main' to enable action
10
+ paths:
11
+ - README.md
12
+
13
+ jobs:
14
+ Translate:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - name: Setup Node.js
19
+ uses: actions/setup-node@v3
20
+ with:
21
+ node-version: 16
22
+ # ISO Language Codes: https://cloud.google.com/translate/docs/languages
23
+ - name: Adding README - Chinese Simplified
24
+ uses: dephraiim/translate-readme@main
25
+ with:
26
+ LANG: zh-CN
STPoseNet/.github/workflows/ci.yaml ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # YOLO Continuous Integration (CI) GitHub Actions tests
3
+
4
+ name: Ultralytics CI
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ branches: [main]
11
+ schedule:
12
+ - cron: '0 0 * * *' # runs at 00:00 UTC every day
13
+ workflow_dispatch:
14
+ inputs:
15
+ hub:
16
+ description: 'Run HUB'
17
+ default: false
18
+ type: boolean
19
+ tests:
20
+ description: 'Run Tests'
21
+ default: false
22
+ type: boolean
23
+ benchmarks:
24
+ description: 'Run Benchmarks'
25
+ default: false
26
+ type: boolean
27
+ gpu:
28
+ description: 'Run GPU'
29
+ default: false
30
+ type: boolean
31
+
32
+ jobs:
33
+ HUB:
34
+ if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.hub == 'true'))
35
+ runs-on: ${{ matrix.os }}
36
+ strategy:
37
+ fail-fast: false
38
+ matrix:
39
+ os: [ubuntu-latest]
40
+ python-version: ['3.11']
41
+ steps:
42
+ - uses: actions/checkout@v3
43
+ - uses: actions/setup-python@v4
44
+ with:
45
+ python-version: ${{ matrix.python-version }}
46
+ cache: 'pip' # caching pip dependencies
47
+ - name: Install requirements
48
+ shell: bash # for Windows compatibility
49
+ run: |
50
+ python -m pip install --upgrade pip wheel
51
+ pip install -e . --extra-index-url https://download.pytorch.org/whl/cpu
52
+ - name: Check environment
53
+ run: |
54
+ yolo checks
55
+ echo "RUNNER_OS is ${{ runner.os }}"
56
+ echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
57
+ echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
58
+ echo "GITHUB_ACTOR is ${{ github.actor }}"
59
+ echo "GITHUB_REPOSITORY is ${{ github.repository }}"
60
+ echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
61
+ python --version
62
+ pip --version
63
+ pip list
64
+ - name: Test HUB training
65
+ shell: python
66
+ env:
67
+ API_KEY: ${{ secrets.ULTRALYTICS_HUB_API_KEY }}
68
+ MODEL_ID: ${{ secrets.ULTRALYTICS_HUB_MODEL_ID }}
69
+ run: |
70
+ import os
71
+ from ultralytics import YOLO, hub
72
+ api_key, model_id = os.environ['API_KEY'], os.environ['MODEL_ID']
73
+ hub.login(api_key)
74
+ hub.reset_model(model_id)
75
+ model = YOLO('https://hub.ultralytics.com/models/' + model_id)
76
+ model.train()
77
+ - name: Test HUB inference API
78
+ shell: python
79
+ env:
80
+ API_KEY: ${{ secrets.ULTRALYTICS_HUB_API_KEY }}
81
+ MODEL_ID: ${{ secrets.ULTRALYTICS_HUB_MODEL_ID }}
82
+ run: |
83
+ import os
84
+ import requests
85
+ import json
86
+ api_key, model_id = os.environ['API_KEY'], os.environ['MODEL_ID']
87
+ url = f"https://api.ultralytics.com/v1/predict/{model_id}"
88
+ headers = {"x-api-key": api_key}
89
+ data = {"size": 320, "confidence": 0.25, "iou": 0.45}
90
+ with open("ultralytics/assets/zidane.jpg", "rb") as f:
91
+ response = requests.post(url, headers=headers, data=data, files={"image": f})
92
+ assert response.status_code == 200, f'Status code {response.status_code}, Reason {response.reason}'
93
+ print(json.dumps(response.json(), indent=2))
94
+
95
+ Benchmarks:
96
+ if: github.event_name != 'workflow_dispatch' || github.event.inputs.benchmarks == 'true'
97
+ runs-on: ${{ matrix.os }}
98
+ strategy:
99
+ fail-fast: false
100
+ matrix:
101
+ os: [ubuntu-latest]
102
+ python-version: ['3.10']
103
+ model: [yolov8n]
104
+ steps:
105
+ - uses: actions/checkout@v3
106
+ - uses: actions/setup-python@v4
107
+ with:
108
+ python-version: ${{ matrix.python-version }}
109
+ cache: 'pip' # caching pip dependencies
110
+ - name: Install requirements
111
+ shell: bash # for Windows compatibility
112
+ run: |
113
+ python -m pip install --upgrade pip wheel
114
+ pip install -e ".[export]" coverage --extra-index-url https://download.pytorch.org/whl/cpu
115
+ yolo export format=tflite imgsz=32 || true
116
+ - name: Check environment
117
+ run: |
118
+ yolo checks
119
+ echo "RUNNER_OS is ${{ runner.os }}"
120
+ echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
121
+ echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
122
+ echo "GITHUB_ACTOR is ${{ github.actor }}"
123
+ echo "GITHUB_REPOSITORY is ${{ github.repository }}"
124
+ echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
125
+ python --version
126
+ pip --version
127
+ pip list
128
+ - name: Benchmark DetectionModel
129
+ shell: bash
130
+ run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}.pt' imgsz=160 verbose=0.26
131
+ - name: Benchmark SegmentationModel
132
+ shell: bash
133
+ run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-seg.pt' imgsz=160 verbose=0.30
134
+ - name: Benchmark ClassificationModel
135
+ shell: bash
136
+ run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-cls.pt' imgsz=160 verbose=0.36
137
+ - name: Benchmark PoseModel
138
+ shell: bash
139
+ run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-pose.pt' imgsz=160 verbose=0.17
140
+ - name: Merge Coverage Reports
141
+ run: |
142
+ coverage xml -o coverage-benchmarks.xml
143
+ - name: Upload Coverage Reports to CodeCov
144
+ uses: codecov/codecov-action@v3
145
+ with:
146
+ flags: Benchmarks
147
+ env:
148
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
149
+ - name: Benchmark Summary
150
+ run: |
151
+ cat benchmarks.log
152
+ echo "$(cat benchmarks.log)" >> $GITHUB_STEP_SUMMARY
153
+
154
+ Tests:
155
+ if: github.event_name != 'workflow_dispatch' || github.event.inputs.tests == 'true'
156
+ timeout-minutes: 60
157
+ runs-on: ${{ matrix.os }}
158
+ strategy:
159
+ fail-fast: false
160
+ matrix:
161
+ os: [ubuntu-latest]
162
+ python-version: ['3.11']
163
+ torch: [latest]
164
+ include:
165
+ - os: ubuntu-latest
166
+ python-version: '3.8' # torch 1.8.0 requires python >=3.6, <=3.8
167
+ torch: '1.8.0' # min torch version CI https://pypi.org/project/torchvision/
168
+ steps:
169
+ - uses: actions/checkout@v3
170
+ - uses: actions/setup-python@v4
171
+ with:
172
+ python-version: ${{ matrix.python-version }}
173
+ cache: 'pip' # caching pip dependencies
174
+ - name: Install requirements
175
+ shell: bash # for Windows compatibility
176
+ run: | # CoreML must be installed before export due to protobuf error from AutoInstall
177
+ python -m pip install --upgrade pip wheel
178
+ if [ "${{ matrix.torch }}" == "1.8.0" ]; then
179
+ pip install -e . torch==1.8.0 torchvision==0.9.0 pytest-cov "coremltools>=7.0.b1" --extra-index-url https://download.pytorch.org/whl/cpu
180
+ else
181
+ pip install -e . pytest-cov "coremltools>=7.0.b1" --extra-index-url https://download.pytorch.org/whl/cpu
182
+ fi
183
+ - name: Check environment
184
+ run: |
185
+ yolo checks
186
+ echo "RUNNER_OS is ${{ runner.os }}"
187
+ echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
188
+ echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
189
+ echo "GITHUB_ACTOR is ${{ github.actor }}"
190
+ echo "GITHUB_REPOSITORY is ${{ github.repository }}"
191
+ echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
192
+ python --version
193
+ pip --version
194
+ pip list
195
+ - name: Pytest tests
196
+ shell: bash # for Windows compatibility
197
+ run: pytest --cov=ultralytics/ --cov-report xml tests/
198
+ - name: Upload Coverage Reports to CodeCov
199
+ if: github.repository == 'ultralytics/ultralytics' # && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
200
+ uses: codecov/codecov-action@v3
201
+ with:
202
+ flags: Tests
203
+ env:
204
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
205
+
206
+ GPU:
207
+ if: github.repository == 'ultralytics/ultralytics' && (github.event_name != 'workflow_dispatch' || github.event.inputs.gpu == 'true')
208
+ timeout-minutes: 60
209
+ runs-on: gpu-latest
210
+ steps:
211
+ - uses: actions/checkout@v3
212
+ - name: Install requirements
213
+ run: pip install -e .
214
+ - name: Check environment
215
+ run: |
216
+ yolo checks
217
+ echo "RUNNER_OS is ${{ runner.os }}"
218
+ echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
219
+ echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
220
+ echo "GITHUB_ACTOR is ${{ github.actor }}"
221
+ echo "GITHUB_REPOSITORY is ${{ github.repository }}"
222
+ echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
223
+ python --version
224
+ pip --version
225
+ pip list
226
+ - name: Pytest tests
227
+ run: pytest --cov=ultralytics/ --cov-report xml tests/test_cuda.py
228
+ - name: Upload Coverage Reports to CodeCov
229
+ uses: codecov/codecov-action@v3
230
+ with:
231
+ flags: GPU
232
+ env:
233
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
234
+
235
+ Summary:
236
+ runs-on: ubuntu-latest
237
+ needs: [HUB, Benchmarks, Tests, GPU] # Add job names that you want to check for failure
238
+ if: always() # This ensures the job runs even if previous jobs fail
239
+ steps:
240
+ - name: Check for failure and notify
241
+ if: (needs.HUB.result == 'failure' || needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' || needs.GPU.result == 'failure') && github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push')
242
+ uses: slackapi/slack-github-action@v1.24.0
243
+ with:
244
+ payload: |
245
+ {"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"}
246
+ env:
247
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
STPoseNet/.github/workflows/cla.yml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+
3
+ name: CLA Assistant
4
+ on:
5
+ issue_comment:
6
+ types:
7
+ - created
8
+ pull_request_target:
9
+ types:
10
+ - reopened
11
+ - opened
12
+ - synchronize
13
+
14
+ jobs:
15
+ CLA:
16
+ if: github.repository == 'ultralytics/ultralytics'
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: CLA Assistant
20
+ if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I sign the CLA') || github.event_name == 'pull_request_target'
21
+ uses: contributor-assistant/github-action@v2.3.0
22
+ env:
23
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
+ # must be repository secret token
25
+ PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
26
+ with:
27
+ path-to-signatures: 'signatures/version1/cla.json'
28
+ path-to-document: 'https://docs.ultralytics.com/help/CLA' # CLA document
29
+ # branch should not be protected
30
+ branch: 'main'
31
+ allowlist: dependabot[bot],github-actions,[pre-commit*,pre-commit*,bot*
32
+
33
+ remote-organization-name: ultralytics
34
+ remote-repository-name: cla
35
+ custom-pr-sign-comment: 'I have read the CLA Document and I sign the CLA'
36
+ custom-allsigned-prcomment: All Contributors have signed the CLA. ✅
37
+ #custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
STPoseNet/.github/workflows/codeql.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+
3
+ name: "CodeQL"
4
+
5
+ on:
6
+ schedule:
7
+ - cron: '0 0 1 * *'
8
+
9
+ jobs:
10
+ analyze:
11
+ name: Analyze
12
+ runs-on: ${{ 'ubuntu-latest' }}
13
+ permissions:
14
+ actions: read
15
+ contents: read
16
+ security-events: write
17
+
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ language: [ 'python' ]
22
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
23
+
24
+ steps:
25
+ - name: Checkout repository
26
+ uses: actions/checkout@v3
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: security-extended,security-and-quality
37
+
38
+ - name: Perform CodeQL Analysis
39
+ uses: github/codeql-action/analyze@v2
40
+ with:
41
+ category: "/language:${{matrix.language}}"
STPoseNet/.github/workflows/docker.yaml ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Builds ultralytics/ultralytics:latest images on DockerHub https://hub.docker.com/r/ultralytics
3
+
4
+ name: Publish Docker Images
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ workflow_dispatch:
10
+ inputs:
11
+ dockerfile:
12
+ type: choice
13
+ description: Select Dockerfile
14
+ options:
15
+ - Dockerfile-arm64
16
+ - Dockerfile-jetson
17
+ - Dockerfile-python
18
+ - Dockerfile-cpu
19
+ - Dockerfile
20
+ push:
21
+ type: boolean
22
+ description: Push image to Docker Hub
23
+ default: true
24
+
25
+ jobs:
26
+ docker:
27
+ if: github.repository == 'ultralytics/ultralytics'
28
+ name: Push
29
+ runs-on: ubuntu-latest
30
+ strategy:
31
+ fail-fast: false
32
+ max-parallel: 5
33
+ matrix:
34
+ include:
35
+ - dockerfile: "Dockerfile-arm64"
36
+ tags: "latest-arm64"
37
+ platforms: "linux/arm64"
38
+ - dockerfile: "Dockerfile-jetson"
39
+ tags: "latest-jetson"
40
+ platforms: "linux/arm64"
41
+ - dockerfile: "Dockerfile-python"
42
+ tags: "latest-python"
43
+ platforms: "linux/amd64"
44
+ - dockerfile: "Dockerfile-cpu"
45
+ tags: "latest-cpu"
46
+ platforms: "linux/amd64"
47
+ - dockerfile: "Dockerfile"
48
+ tags: "latest"
49
+ platforms: "linux/amd64"
50
+ steps:
51
+ - name: Checkout repo
52
+ uses: actions/checkout@v3
53
+
54
+ - name: Set up QEMU
55
+ uses: docker/setup-qemu-action@v2
56
+
57
+ - name: Set up Docker Buildx
58
+ uses: docker/setup-buildx-action@v2
59
+
60
+ - name: Login to Docker Hub
61
+ uses: docker/login-action@v2
62
+ with:
63
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
64
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
65
+
66
+ - name: Retrieve Ultralytics version
67
+ id: get_version
68
+ run: |
69
+ VERSION=$(grep "^__version__ =" ultralytics/__init__.py | awk -F"'" '{print $2}')
70
+ echo "Retrieved Ultralytics version: $VERSION"
71
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
72
+
73
+ VERSION_TAG=$(echo "${{ matrix.tags }}" | sed "s/latest/${VERSION}/")
74
+ echo "Intended version tag: $VERSION_TAG"
75
+ echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
76
+
77
+ - name: Check if version tag exists on DockerHub
78
+ id: check_tag
79
+ run: |
80
+ RESPONSE=$(curl -s https://hub.docker.com/v2/repositories/ultralytics/ultralytics/tags/$VERSION_TAG)
81
+ MESSAGE=$(echo $RESPONSE | jq -r '.message')
82
+ if [[ "$MESSAGE" == "null" ]]; then
83
+ echo "Tag $VERSION_TAG already exists on DockerHub."
84
+ echo "exists=true" >> $GITHUB_OUTPUT
85
+ elif [[ "$MESSAGE" == *"404"* ]]; then
86
+ echo "Tag $VERSION_TAG does not exist on DockerHub."
87
+ echo "exists=false" >> $GITHUB_OUTPUT
88
+ else
89
+ echo "Unexpected response from DockerHub. Please check manually."
90
+ echo "exists=false" >> $GITHUB_OUTPUT
91
+ fi
92
+ env:
93
+ VERSION_TAG: ${{ steps.get_version.outputs.version_tag }}
94
+
95
+ - name: Build Image
96
+ if: github.event_name == 'push' || github.event.inputs.dockerfile == matrix.dockerfile
97
+ run: |
98
+ docker build --platform ${{ matrix.platforms }} -f docker/${{ matrix.dockerfile }} \
99
+ -t ultralytics/ultralytics:${{ matrix.tags }} \
100
+ -t ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }} .
101
+
102
+ - name: Run Tests
103
+ if: (github.event_name == 'push' || github.event.inputs.dockerfile == matrix.dockerfile) && matrix.platforms == 'linux/amd64' # arm64 images not supported on GitHub CI runners
104
+ run: docker run ultralytics/ultralytics:${{ matrix.tags }} /bin/bash -c "pip install pytest && pytest tests"
105
+
106
+ - name: Run Benchmarks
107
+ # WARNING: Dockerfile (GPU) error on TF.js export 'module 'numpy' has no attribute 'object'.
108
+ if: (github.event_name == 'push' || github.event.inputs.dockerfile == matrix.dockerfile) && matrix.platforms == 'linux/amd64' && matrix.dockerfile != 'Dockerfile' # arm64 images not supported on GitHub CI runners
109
+ run: docker run ultralytics/ultralytics:${{ matrix.tags }} yolo benchmark model=yolov8n.pt imgsz=160 verbose=0.26
110
+
111
+ - name: Push Docker Image with Ultralytics version tag
112
+ if: (github.event_name == 'push' || (github.event.inputs.dockerfile == matrix.dockerfile && github.event.inputs.push == 'true')) && steps.check_tag.outputs.exists == 'false'
113
+ run: |
114
+ docker push ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }}
115
+
116
+ - name: Push Docker Image with latest tag
117
+ if: github.event_name == 'push' || (github.event.inputs.dockerfile == matrix.dockerfile && github.event.inputs.push == 'true')
118
+ run: |
119
+ docker push ultralytics/ultralytics:${{ matrix.tags }}
120
+ if [[ "${{ matrix.tags }}" == "latest" ]]; then
121
+ t=ultralytics/ultralytics:latest-runner
122
+ docker build -f docker/Dockerfile-runner -t $t .
123
+ docker push $t
124
+ fi
125
+
126
+ - name: Notify on failure
127
+ if: github.event_name == 'push' && failure() # do not notify on cancelled() as cancelling is performed by hand
128
+ uses: slackapi/slack-github-action@v1.24.0
129
+ with:
130
+ payload: |
131
+ {"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"}
132
+ env:
133
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
STPoseNet/.github/workflows/greetings.yml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, 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 YOLOv8 🚀 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/ultralytics` `main` 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 main` locally.
22
+ - ✅ Verify all YOLOv8 Continuous Integration (CI) **checks are passing**.
23
+ - ✅ Update YOLOv8 [Docs](https://docs.ultralytics.com) for any new or updated features.
24
+ - ✅ 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
25
+
26
+ See our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for details and let us know if you have any questions!
27
+
28
+ issue-message: |
29
+ 👋 Hello @${{ github.actor }}, thank you for your interest in YOLOv8 🚀! We recommend a visit to the [YOLOv8 Docs](https://docs.ultralytics.com) for new users where you can find many [Python](https://docs.ultralytics.com/usage/python/) and [CLI](https://docs.ultralytics.com/usage/cli/) usage examples and where many of the most common questions may already be answered.
30
+
31
+ If this is a 🐛 Bug Report, please provide a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us debug it.
32
+
33
+ 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/).
34
+
35
+ Join the vibrant [Ultralytics Discord](https://ultralytics.com/discord) 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.
36
+
37
+ ## Install
38
+
39
+ Pip install the `ultralytics` package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/requirements.txt) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
40
+
41
+ ```bash
42
+ pip install ultralytics
43
+ ```
44
+
45
+ ## Environments
46
+
47
+ YOLOv8 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):
48
+
49
+ - **Notebooks** with free GPU: <a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"/></a> <a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/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/yolov8"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
50
+ - **Google Cloud** Deep Learning VM. See [GCP Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/)
51
+ - **Amazon** Deep Learning AMI. See [AWS Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/)
52
+ - **Docker Image**. See [Docker Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/docker_image_quickstart_tutorial/) <a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Docker Pulls"></a>
53
+
54
+ ## Status
55
+
56
+ <a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
57
+
58
+ If this badge is green, all [Ultralytics CI](https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule) tests are currently passing. CI tests verify correct operation of all YOLOv8 [Modes](https://docs.ultralytics.com/modes/) and [Tasks](https://docs.ultralytics.com/tasks/) on macOS, Windows, and Ubuntu every 24 hours and on every commit.
STPoseNet/.github/workflows/links.yml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # YOLO Continuous Integration (CI) GitHub Actions tests broken link checker
3
+ # Accept 429(Instagram, 'too many requests'), 999(LinkedIn, 'unknown status code'), Timeout(Twitter)
4
+
5
+ name: Check Broken links
6
+
7
+ on:
8
+ workflow_dispatch:
9
+ schedule:
10
+ - cron: '0 0 * * *' # runs at 00:00 UTC every day
11
+
12
+ jobs:
13
+ Links:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+
18
+ - name: Download and install lychee
19
+ run: |
20
+ 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)
21
+ curl -L $LYCHEE_URL -o lychee.tar.gz
22
+ tar xzf lychee.tar.gz
23
+ sudo mv lychee /usr/local/bin
24
+
25
+ - name: Test Markdown and HTML links with retry
26
+ uses: nick-invision/retry@v2
27
+ with:
28
+ timeout_minutes: 5
29
+ retry_wait_seconds: 60
30
+ max_attempts: 3
31
+ command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html'
32
+
33
+ - name: Test Markdown, HTML, YAML, Python and Notebook links with retry
34
+ if: github.event_name == 'workflow_dispatch'
35
+ uses: nick-invision/retry@v2
36
+ with:
37
+ timeout_minutes: 5
38
+ retry_wait_seconds: 60
39
+ max_attempts: 3
40
+ command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|url\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html' './**/*.yml' './**/*.yaml' './**/*.py' './**/*.ipynb'
STPoseNet/.github/workflows/publish.yml ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Publish pip package to PyPI https://pypi.org/project/ultralytics/ and Docs to https://docs.ultralytics.com
3
+
4
+ name: Publish to PyPI and Deploy Docs
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ workflow_dispatch:
10
+ inputs:
11
+ pypi:
12
+ type: boolean
13
+ description: Publish to PyPI
14
+ docs:
15
+ type: boolean
16
+ description: Deploy Docs
17
+
18
+ jobs:
19
+ publish:
20
+ if: github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
21
+ name: Publish
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v3
26
+ with:
27
+ fetch-depth: "0" # pulls all commits (needed correct last updated dates in Docs)
28
+ - name: Set up Python environment
29
+ uses: actions/setup-python@v4
30
+ with:
31
+ python-version: '3.10'
32
+ cache: 'pip' # caching pip dependencies
33
+ - name: Install dependencies
34
+ run: |
35
+ python -m pip install --upgrade pip wheel build twine
36
+ pip install -e ".[dev]" --extra-index-url https://download.pytorch.org/whl/cpu
37
+ - name: Check PyPI version
38
+ shell: python
39
+ run: |
40
+ import os
41
+ import pkg_resources as pkg
42
+ import ultralytics
43
+ from ultralytics.utils.checks import check_latest_pypi_version
44
+
45
+ v_local = pkg.parse_version(ultralytics.__version__).release
46
+ v_pypi = pkg.parse_version(check_latest_pypi_version()).release
47
+ print(f'Local version is {v_local}')
48
+ print(f'PyPI version is {v_pypi}')
49
+ d = [a - b for a, b in zip(v_local, v_pypi)] # diff
50
+ increment = (d[0] == d[1] == 0) and d[2] == 1 # only publish if patch version increments by 1
51
+ os.system(f'echo "increment={increment}" >> $GITHUB_OUTPUT')
52
+ os.system(f'echo "version={ultralytics.__version__}" >> $GITHUB_OUTPUT')
53
+ if increment:
54
+ print('Local version is higher than PyPI version. Publishing new version to PyPI ✅.')
55
+ id: check_pypi
56
+ - name: Publish to PyPI
57
+ continue-on-error: true
58
+ if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
59
+ env:
60
+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
61
+ run: |
62
+ python -m build
63
+ python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN
64
+ - name: Deploy Docs
65
+ continue-on-error: true
66
+ if: (github.event_name == 'push' || github.event.inputs.docs == 'true') && github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
67
+ env:
68
+ PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
69
+ run: |
70
+ mkdocs build
71
+ git config --global user.name "Glenn Jocher"
72
+ git config --global user.email "glenn.jocher@ultralytics.com"
73
+ git clone https://github.com/ultralytics/docs.git docs-repo
74
+ cd docs-repo
75
+ git checkout gh-pages || git checkout -b gh-pages
76
+ rm -rf *
77
+ cp -R ../site/* .
78
+ git add .
79
+ git commit -m "Update Docs for 'ultralytics ${{ steps.check_pypi.outputs.version }}'"
80
+ git push https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/ultralytics/docs.git gh-pages
81
+ - name: Extract PR Details
82
+ run: |
83
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
84
+ PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
85
+ PR_NUMBER=${{ github.event.pull_request.number }}
86
+ PR_TITLE=$(echo $PR_JSON | jq -r '.title')
87
+ else
88
+ COMMIT_SHA=${{ github.event.after }}
89
+ PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=repo:${{ github.repository }}+is:pr+is:merged+sha:$COMMIT_SHA")
90
+ PR_NUMBER=$(echo $PR_JSON | jq -r '.items[0].number')
91
+ PR_TITLE=$(echo $PR_JSON | jq -r '.items[0].title')
92
+ fi
93
+ echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
94
+ echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
95
+ - name: Notify on Slack (Success)
96
+ if: success() && github.event_name == 'push' && steps.check_pypi.outputs.increment == 'True'
97
+ uses: slackapi/slack-github-action@v1.24.0
98
+ with:
99
+ payload: |
100
+ {"text": "<!channel> GitHub Actions success 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:* NEW 'ultralytics ${{ steps.check_pypi.outputs.version }}' pip package published 😃\n*Job Status:* ${{ job.status }}\n*Pull Request:* <https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }}> ${{ env.PR_TITLE }}\n"}
101
+ env:
102
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
103
+ - name: Notify on Slack (Failure)
104
+ if: failure()
105
+ uses: slackapi/slack-github-action@v1.24.0
106
+ with:
107
+ payload: |
108
+ {"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*Job Status:* ${{ job.status }}\n*Pull Request:* <https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }}> ${{ env.PR_TITLE }}\n"}
109
+ env:
110
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
STPoseNet/.github/workflows/stale.yml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, 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.
STPoseNet/.gitignore ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # Profiling
85
+ *.pclprof
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ .idea
111
+ env/
112
+ venv/
113
+ ENV/
114
+ env.bak/
115
+ venv.bak/
116
+
117
+ # Spyder project settings
118
+ .spyderproject
119
+ .spyproject
120
+
121
+ # VSCode project settings
122
+ .vscode/
123
+
124
+ # Rope project settings
125
+ .ropeproject
126
+
127
+ # mkdocs documentation
128
+ /site
129
+ mkdocs_github_authors.yaml
130
+
131
+ # mypy
132
+ .mypy_cache/
133
+ .dmypy.json
134
+ dmypy.json
135
+
136
+ # Pyre type checker
137
+ .pyre/
138
+
139
+ # datasets and projects
140
+ datasets/
141
+ runs/
142
+ wandb/
143
+ tests/
144
+ .DS_Store
145
+
146
+ # Neural Network weights -----------------------------------------------------------------------------------------------
147
+ weights/
148
+ *.weights
149
+ *.pt
150
+ *.pb
151
+ *.onnx
152
+ *.engine
153
+ *.mlmodel
154
+ *.mlpackage
155
+ *.torchscript
156
+ *.tflite
157
+ *.h5
158
+ *_saved_model/
159
+ *_web_model/
160
+ *_openvino_model/
161
+ *_paddle_model/
162
+ pnnx*
163
+
164
+ # Autogenerated files for tests
165
+ /ultralytics/assets/
STPoseNet/.idea/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
STPoseNet/.idea/inspectionProfiles/Project_Default.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="11">
8
+ <item index="0" class="java.lang.String" itemvalue="tqdm" />
9
+ <item index="1" class="java.lang.String" itemvalue="scipy" />
10
+ <item index="2" class="java.lang.String" itemvalue="h5py" />
11
+ <item index="3" class="java.lang.String" itemvalue="matplotlib" />
12
+ <item index="4" class="java.lang.String" itemvalue="torch" />
13
+ <item index="5" class="java.lang.String" itemvalue="numpy" />
14
+ <item index="6" class="java.lang.String" itemvalue="torchvision" />
15
+ <item index="7" class="java.lang.String" itemvalue="opencv_python" />
16
+ <item index="8" class="java.lang.String" itemvalue="Pillow" />
17
+ <item index="9" class="java.lang.String" itemvalue="tables" />
18
+ <item index="10" class="java.lang.String" itemvalue="intel-openmp" />
19
+ </list>
20
+ </value>
21
+ </option>
22
+ </inspection_tool>
23
+ </profile>
24
+ </component>
STPoseNet/.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>
STPoseNet/.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (pytorch) (41)" project-jdk-type="Python SDK" />
4
+ </project>
STPoseNet/.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/ultralytics-main.iml" filepath="$PROJECT_DIR$/.idea/ultralytics-main.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
STPoseNet/.idea/ultralytics-main.iml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="Python 3.8 (pytorch) (41)" 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
+ <component name="TestRunnerService">
13
+ <option name="PROJECT_TEST_RUNNER" value="pytest" />
14
+ </component>
15
+ </module>
STPoseNet/.idea/workspace.xml ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="0a48a8c0-6104-4022-a36d-c9f1e277a944" name="Default Changelist" 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="GitSEFilterConfiguration">
21
+ <file-type-list>
22
+ <filtered-out-file-type name="LOCAL_BRANCH" />
23
+ <filtered-out-file-type name="REMOTE_BRANCH" />
24
+ <filtered-out-file-type name="TAG" />
25
+ <filtered-out-file-type name="COMMIT_BY_MESSAGE" />
26
+ </file-type-list>
27
+ </component>
28
+ <component name="ProjectId" id="2UeG848rGoibSJiuv7mJuB6fGtl" />
29
+ <component name="ProjectViewState">
30
+ <option name="hideEmptyMiddlePackages" value="true" />
31
+ <option name="showLibraryContents" value="true" />
32
+ <option name="showMembers" value="true" />
33
+ </component>
34
+ <component name="PropertiesComponent">
35
+ <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
36
+ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
37
+ <property name="last_opened_file_path" value="$PROJECT_DIR$/ultralytics/tool" />
38
+ <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
39
+ </component>
40
+ <component name="RecentsManager">
41
+ <key name="CopyFile.RECENT_KEYS">
42
+ <recent name="F:\code\ultralytics-main_trace\ultralytics\tool" />
43
+ <recent name="F:\code\ultralytics-main" />
44
+ <recent name="F:\code\ultralytics-main\ultralytics\cfg\datasets" />
45
+ </key>
46
+ <key name="MoveFile.RECENT_KEYS">
47
+ <recent name="F:\code\ultralytics-main_trace" />
48
+ </key>
49
+ </component>
50
+ <component name="RunManager" selected="Python.mouse-pre">
51
+ <configuration name="min_data_enhance" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
52
+ <module name="ultralytics-main" />
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$/min_data_enhance.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="mouse-pre" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
73
+ <module name="ultralytics-main" />
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="$PROJECT_DIR$/mouse-pre.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="mouse-train" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
94
+ <module name="ultralytics-main" />
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$/mouse-train.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="predictor" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
115
+ <module name="ultralytics-main" />
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$/ultralytics/engine" />
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$/ultralytics/engine/predictor.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
+ <recent_temporary>
136
+ <list>
137
+ <item itemvalue="Python.mouse-pre" />
138
+ <item itemvalue="Python.mouse-train" />
139
+ <item itemvalue="Python.min_data_enhance" />
140
+ <item itemvalue="Python.predictor" />
141
+ </list>
142
+ </recent_temporary>
143
+ </component>
144
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
145
+ <component name="TaskManager">
146
+ <task active="true" id="Default" summary="Default task">
147
+ <changelist id="0a48a8c0-6104-4022-a36d-c9f1e277a944" name="Default Changelist" comment="" />
148
+ <created>1693292470208</created>
149
+ <option name="number" value="Default" />
150
+ <option name="presentableId" value="Default" />
151
+ <updated>1693292470208</updated>
152
+ </task>
153
+ <servers />
154
+ </component>
155
+ <component name="XDebuggerManager">
156
+ <breakpoint-manager>
157
+ <breakpoints>
158
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
159
+ <url>file://$PROJECT_DIR$/ultralytics/engine/trainer.py</url>
160
+ <line>261</line>
161
+ <option name="timeStamp" value="12" />
162
+ </line-breakpoint>
163
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
164
+ <url>file://$PROJECT_DIR$/ultralytics/models/yolo/detect/predict.py</url>
165
+ <line>38</line>
166
+ <option name="timeStamp" value="33" />
167
+ </line-breakpoint>
168
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
169
+ <url>file://$PROJECT_DIR$/ultralytics/engine/predictor.py</url>
170
+ <line>458</line>
171
+ <option name="timeStamp" value="35" />
172
+ </line-breakpoint>
173
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
174
+ <url>file://$PROJECT_DIR$/ultralytics/engine/predictor.py</url>
175
+ <line>560</line>
176
+ <option name="timeStamp" value="36" />
177
+ </line-breakpoint>
178
+ </breakpoints>
179
+ <default-breakpoints>
180
+ <breakpoint type="python-exception">
181
+ <properties notifyOnTerminate="true" exception="BaseException">
182
+ <option name="notifyOnTerminate" value="true" />
183
+ </properties>
184
+ </breakpoint>
185
+ </default-breakpoints>
186
+ </breakpoint-manager>
187
+ <watches-manager>
188
+ <configuration name="PythonConfigurationType">
189
+ <watch expression="self.results" />
190
+ <watch expression="result" />
191
+ <watch expression="result[0].boxes.boxes" />
192
+ <watch expression="self.kal_kp" />
193
+ <watch expression="self.kalman_last" />
194
+ <watch expression="self.kalman_p_last" />
195
+ </configuration>
196
+ </watches-manager>
197
+ </component>
198
+ </project>
STPoseNet/.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.4.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.10.1
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.0
38
+ hooks:
39
+ - id: yapf
40
+ name: YAPF formatting
41
+
42
+ - repo: https://github.com/executablebooks/mdformat
43
+ rev: 0.7.16
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.5
60
+ hooks:
61
+ - id: codespell
62
+ args:
63
+ - --ignore-words-list=crate,nd,strack,dota,ane,segway,fo
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
STPoseNet/CITATION.cff ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cff-version: 1.2.0
2
+ preferred-citation:
3
+ type: software
4
+ message: If you use this software, 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
+ - family-names: Chaurasia
10
+ given-names: Ayush
11
+ orcid: "https://orcid.org/0000-0002-7603-6750"
12
+ - family-names: Qiu
13
+ given-names: Jing
14
+ orcid: "https://orcid.org/0000-0003-3783-7069"
15
+ title: "YOLO by Ultralytics"
16
+ version: 8.0.0
17
+ # doi: 10.5281/zenodo.3908559 # TODO
18
+ date-released: 2023-1-10
19
+ license: AGPL-3.0
20
+ url: "https://github.com/ultralytics/ultralytics"
STPoseNet/CONTRIBUTING.md ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Contributing to YOLOv8 🚀
2
+
3
+ We love your input! We want to make contributing to YOLOv8 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
+ YOLOv8 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
+ Button is in 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 `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 YOLOv8 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/ultralytics` `main` 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 main` 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 YOLOv8 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
+ ### Docstrings
61
+
62
+ Not all functions or classes require docstrings but when they do, we
63
+ follow [google-style docstrings format](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings).
64
+ Here is an example:
65
+
66
+ ```python
67
+ """
68
+ What the function does. Performs NMS on given detection predictions.
69
+
70
+ Args:
71
+ arg1: The description of the 1st argument
72
+ arg2: The description of the 2nd argument
73
+
74
+ Returns:
75
+ What the function returns. Empty if nothing is returned.
76
+
77
+ Raises:
78
+ Exception Class: When and why this exception can be raised by the function.
79
+ """
80
+ ```
81
+
82
+ ## Submitting a Bug Report 🐛
83
+
84
+ If you spot a problem with YOLOv8 please submit a Bug Report!
85
+
86
+ For us to start investigating a possible problem we need to be able to reproduce it ourselves first. We've created a few
87
+ short guidelines below to help users provide what we need in order to get started.
88
+
89
+ When asking a question, people will be better able to provide help if you provide **code** that they can easily
90
+ understand and use to **reproduce** the problem. This is referred to by community members as creating
91
+ a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/). Your code that reproduces
92
+ the problem should be:
93
+
94
+ - ✅ **Minimal** – Use as little code as possible that still produces the same problem
95
+ - ✅ **Complete** – Provide **all** parts someone else needs to reproduce your problem in the question itself
96
+ - ✅ **Reproducible** – Test the code you're about to provide to make sure it reproduces the problem
97
+
98
+ In addition to the above requirements, for [Ultralytics](https://ultralytics.com/) to provide assistance your code
99
+ should be:
100
+
101
+ - ✅ **Current** – Verify that your code is up-to-date with current
102
+ GitHub [main](https://github.com/ultralytics/ultralytics/tree/main) branch, and if necessary `git pull` or `git clone`
103
+ a new copy to ensure your problem has not already been resolved by previous commits.
104
+ - ✅ **Unmodified** – Your problem must be reproducible without any modifications to the codebase in this
105
+ repository. [Ultralytics](https://ultralytics.com/) does not provide support for custom code ⚠️.
106
+
107
+ If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the 🐛
108
+ **Bug Report** [template](https://github.com/ultralytics/ultralytics/issues/new/choose) and providing
109
+ a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us better
110
+ understand and diagnose your problem.
111
+
112
+ ## License
113
+
114
+ By contributing, you agree that your contributions will be licensed under
115
+ the [AGPL-3.0 license](https://choosealicense.com/licenses/agpl-3.0/)
STPoseNet/MANIFEST.in ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ include *.md
2
+ include requirements.txt
3
+ include LICENSE
4
+ include setup.py
5
+ include ultralytics/assets/bus.jpg
6
+ include ultralytics/assets/zidane.jpg
7
+ recursive-include ultralytics *.yaml
8
+ recursive-exclude __pycache__ *
STPoseNet/README.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # STPoseNet
2
+ This is a pose recognition model for laboratory mice based on yolov8.
3
+
4
+ ## The repository includes:
5
+
6
+ Source code of STposeNet built on YOLO v8
7
+ Training code for STposeNet
8
+ Data enhancement code for STposeNet
9
+ Keypoints identification program for STposeNet
10
+
11
+ ## Using STPoseNet
12
+
13
+ ### **Create a new environment**
14
+
15
+ [requirements.txt](https://github.com/lvrgb777/STPoseNet/blob/master/STPoseNet/requirements.txt) supports the normal running of STPoseNet. Before using STPoseNet, ensure that the environment is configured according to this file.
16
+ ```
17
+ -conda create -n STPoseNet python=3.8
18
+ -pip install -r requirements.txt
19
+ ```
20
+ ### **Dataset preparation**
21
+
22
+ In this folder [Neurofinder](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/Neurofinder), We provide two images for testing.
23
+ * In this folder, [leftImg8bit](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/Neurofinder/test/leftImg8bit) stores the two-photon calcium imaging and [gtFine](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/Neurofinder/test/gtFine) stores the corresponding GT.
24
+ * [generate_dataset.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/Neurofinder/generate_dataset.py) is used to generate [image list](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/Neurofinder/imglists). After adding new images, run this code to generate the list for training and test code can read new images.
25
+
26
+ ### **Model preparation**
27
+
28
+ This folder [models](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/models) is used to store the pretrained model and the test model. The test model can be downloaded from our [huggingface](https://huggingface.co/XZH-James/NeuroSeg2/tree/main).
29
+
30
+ ### **training or testing**
31
+
32
+ After abtaining the dataset and model, running [test.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/test.py) to test the image.
33
+ Running [train.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/train.py) to train the new dataset.
34
+
35
+ ### **The result**
36
+
37
+ [logs/evalution](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/logs/evalution/Neurofinder) contains the results of the neurons segmentation of NeuroSeg-II.
38
+ * [plt/difference](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/logs/evalution/Neurofinder/plt/difference) stores the segmented image by NeuroSeg-II.
39
+ * [evaluation_log.csv](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/logs/evalution/Neurofinder/evaluation_log.csv) is the score for this test.
40
+
41
+ ## Other matters
42
+
43
+ ### **Core code**
44
+ In [neuroseg2](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/neuroseg2) are the core code of NeuroSeg-II.
45
+ * [model.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/neuroseg2/model.py) and [utils.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/neuroseg2/utils.py) are the code of overall structure.
46
+ * [Down.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/neuroseg2/Down.py) is the code of FPN+.
47
+ * [attention.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/neuroseg2/attention.py) is the code of attention mechanism.
48
+ * [visualize.py](https://github.com/XZH-James/NeuroSeg2/blob/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/neuroseg2/visualize.py) is the code for visual segmentation result.
49
+
50
+ ### **Code of preprocessing**
51
+ In [utilities](https://github.com/XZH-James/NeuroSeg2/tree/main/NeuroSeg%E2%85%A1-main/NeuroSeg%E2%85%A1-main/utilities) are the code for preprocessing.
52
+
53
+ ## Contact information
54
+
55
+ If you have any questions about this project, please feel free to contact us. Email address: zhehao_xu@qq.com
STPoseNet/docker/Dockerfile ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Builds ultralytics/ultralytics:latest image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
3
+ # Image is CUDA-optimized for YOLOv8 single/multi-GPU training and inference
4
+
5
+ # Start FROM PyTorch image https://hub.docker.com/r/pytorch/pytorch or nvcr.io/nvidia/pytorch:23.03-py3
6
+ FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
7
+ RUN pip install --no-cache nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com
8
+
9
+ # Downloads to user config dir
10
+ ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
11
+
12
+ # Install linux packages
13
+ # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
14
+ RUN apt update \
15
+ && apt install --no-install-recommends -y gcc git zip curl htop libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
16
+ # RUN alias python=python3
17
+
18
+ # Security updates
19
+ # https://security.snyk.io/vuln/SNYK-UBUNTU1804-OPENSSL-3314796
20
+ RUN apt upgrade --no-install-recommends -y openssl tar
21
+
22
+ # Create working directory
23
+ WORKDIR /usr/src/ultralytics
24
+
25
+ # Copy contents
26
+ # COPY . /usr/src/app (issues as not a .git directory)
27
+ RUN git clone https://github.com/ultralytics/ultralytics /usr/src/ultralytics
28
+ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
29
+
30
+ # Install pip packages
31
+ RUN python3 -m pip install --upgrade pip wheel
32
+ RUN pip install --no-cache -e ".[export]" thop albumentations comet pycocotools pytest-cov
33
+
34
+ # Run exports to AutoInstall packages
35
+ RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32
36
+ RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32
37
+ # Requires <= Python 3.10, bug with paddlepaddle==2.5.0
38
+ RUN pip install --no-cache paddlepaddle==2.4.2 x2paddle
39
+ # Fix error: `np.bool` was a deprecated alias for the builtin `bool`
40
+ RUN pip install --no-cache numpy==1.23.5
41
+ # Remove exported models
42
+ RUN rm -rf tmp
43
+
44
+ # Set environment variables
45
+ ENV OMP_NUM_THREADS=1
46
+ # Avoid DDP error "MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library" https://github.com/pytorch/pytorch/issues/37377
47
+ ENV MKL_THREADING_LAYER=GNU
48
+
49
+
50
+ # Usage Examples -------------------------------------------------------------------------------------------------------
51
+
52
+ # Build and Push
53
+ # t=ultralytics/ultralytics:latest && sudo docker build -f docker/Dockerfile -t $t . && sudo docker push $t
54
+
55
+ # Pull and Run with access to all GPUs
56
+ # t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all $t
57
+
58
+ # Pull and Run with access to GPUs 2 and 3 (inside container CUDA devices will appear as 0 and 1)
59
+ # t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus '"device=2,3"' $t
60
+
61
+ # Pull and Run with local directory access
62
+ # t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/datasets:/usr/src/datasets $t
63
+
64
+ # Kill all
65
+ # sudo docker kill $(sudo docker ps -q)
66
+
67
+ # Kill all image-based
68
+ # sudo docker kill $(sudo docker ps -qa --filter ancestor=ultralytics/ultralytics:latest)
69
+
70
+ # DockerHub tag update
71
+ # t=ultralytics/ultralytics:latest tnew=ultralytics/ultralytics:v6.2 && sudo docker pull $t && sudo docker tag $t $tnew && sudo docker push $tnew
72
+
73
+ # Clean up
74
+ # sudo docker system prune -a --volumes
75
+
76
+ # Update Ubuntu drivers
77
+ # https://www.maketecheasier.com/install-nvidia-drivers-ubuntu/
78
+
79
+ # DDP test
80
+ # python -m torch.distributed.run --nproc_per_node 2 --master_port 1 train.py --epochs 3
81
+
82
+ # GCP VM from Image
83
+ # docker.io/ultralytics/ultralytics:latest
STPoseNet/docker/Dockerfile-arm64 ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Builds ultralytics/ultralytics:latest-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
3
+ # Image is aarch64-compatible for Apple M1 and other ARM architectures i.e. Jetson Nano and Raspberry Pi
4
+
5
+ # Start FROM Ubuntu image https://hub.docker.com/_/ubuntu
6
+ FROM arm64v8/ubuntu:22.10
7
+
8
+ # Downloads to user config dir
9
+ ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
10
+
11
+ # Install linux packages
12
+ # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
13
+ RUN apt update \
14
+ && apt install --no-install-recommends -y python3-pip git zip curl htop gcc libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
15
+ # RUN alias python=python3
16
+
17
+ # Create working directory
18
+ WORKDIR /usr/src/ultralytics
19
+
20
+ # Copy contents
21
+ # COPY . /usr/src/app (issues as not a .git directory)
22
+ RUN git clone https://github.com/ultralytics/ultralytics /usr/src/ultralytics
23
+ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
24
+
25
+ # Install pip packages
26
+ RUN python3 -m pip install --upgrade pip wheel
27
+ RUN pip install --no-cache -e . thop
28
+
29
+
30
+ # Usage Examples -------------------------------------------------------------------------------------------------------
31
+
32
+ # Build and Push
33
+ # t=ultralytics/ultralytics:latest-arm64 && sudo docker build --platform linux/arm64 -f docker/Dockerfile-arm64 -t $t . && sudo docker push $t
34
+
35
+ # Run
36
+ # t=ultralytics/ultralytics:latest-arm64 && sudo docker run -it --ipc=host $t
37
+
38
+ # Pull and Run with local volume mounted
39
+ # t=ultralytics/ultralytics:latest-arm64 && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t
STPoseNet/docker/Dockerfile-cpu ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Builds ultralytics/ultralytics:latest-cpu image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
3
+ # Image is CPU-optimized for ONNX, OpenVINO and PyTorch YOLOv8 deployments
4
+
5
+ # Start FROM Ubuntu image https://hub.docker.com/_/ubuntu
6
+ FROM ubuntu:lunar-20230615
7
+
8
+ # Downloads to user config dir
9
+ ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
10
+
11
+ # Install linux packages
12
+ # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
13
+ RUN apt update \
14
+ && apt install --no-install-recommends -y python3-pip git zip curl htop libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
15
+ # RUN alias python=python3
16
+
17
+ # Create working directory
18
+ WORKDIR /usr/src/ultralytics
19
+
20
+ # Copy contents
21
+ # COPY . /usr/src/app (issues as not a .git directory)
22
+ RUN git clone https://github.com/ultralytics/ultralytics /usr/src/ultralytics
23
+ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
24
+
25
+ # Remove python3.11/EXTERNALLY-MANAGED or use 'pip install --break-system-packages' avoid 'externally-managed-environment' Ubuntu nightly error
26
+ RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
27
+
28
+ # Install pip packages
29
+ RUN python3 -m pip install --upgrade pip wheel
30
+ RUN pip install --no-cache -e ".[export]" thop --extra-index-url https://download.pytorch.org/whl/cpu
31
+
32
+ # Run exports to AutoInstall packages
33
+ RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32
34
+ RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32
35
+ # Requires <= Python 3.10, bug with paddlepaddle==2.5.0
36
+ # RUN pip install --no-cache paddlepaddle==2.4.2 x2paddle
37
+ # Remove exported models
38
+ RUN rm -rf tmp
39
+
40
+ # Usage Examples -------------------------------------------------------------------------------------------------------
41
+
42
+ # Build and Push
43
+ # t=ultralytics/ultralytics:latest-cpu && sudo docker build -f docker/Dockerfile-cpu -t $t . && sudo docker push $t
44
+
45
+ # Run
46
+ # t=ultralytics/ultralytics:latest-cpu && sudo docker run -it --ipc=host $t
47
+
48
+ # Pull and Run with local volume mounted
49
+ # t=ultralytics/ultralytics:latest-cpu && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t
STPoseNet/docker/Dockerfile-jetson ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Builds ultralytics/ultralytics:jetson image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
3
+ # Supports JetPack for YOLOv8 on Jetson Nano, TX1/TX2, Xavier NX, AGX Xavier, AGX Orin, and Orin NX
4
+
5
+ # Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch
6
+ FROM nvcr.io/nvidia/l4t-pytorch:r35.2.1-pth2.0-py3
7
+
8
+ # Downloads to user config dir
9
+ ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
10
+
11
+ # Install linux packages
12
+ # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
13
+ RUN apt update \
14
+ && apt install --no-install-recommends -y gcc git zip curl htop libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
15
+ # RUN alias python=python3
16
+
17
+ # Create working directory
18
+ WORKDIR /usr/src/ultralytics
19
+
20
+ # Copy contents
21
+ # COPY . /usr/src/app (issues as not a .git directory)
22
+ RUN git clone https://github.com/ultralytics/ultralytics /usr/src/ultralytics
23
+ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
24
+
25
+ # Remove opencv-python from requirements.txt as it conflicts with opencv-python installed in base image
26
+ RUN grep -v '^opencv-python' requirements.txt > tmp.txt && mv tmp.txt requirements.txt
27
+
28
+ # Install pip packages manually for TensorRT compatibility https://github.com/NVIDIA/TensorRT/issues/2567
29
+ RUN python3 -m pip install --upgrade pip wheel
30
+ RUN pip install --no-cache tqdm matplotlib pyyaml psutil pandas onnx thop "numpy==1.23"
31
+ RUN pip install --no-cache -e .
32
+
33
+ # Set environment variables
34
+ ENV OMP_NUM_THREADS=1
35
+
36
+
37
+ # Usage Examples -------------------------------------------------------------------------------------------------------
38
+
39
+ # Build and Push
40
+ # t=ultralytics/ultralytics:latest-jetson && sudo docker build --platform linux/arm64 -f docker/Dockerfile-jetson -t $t . && sudo docker push $t
41
+
42
+ # Run
43
+ # t=ultralytics/ultralytics:latest-jetson && sudo docker run -it --ipc=host $t
44
+
45
+ # Pull and Run with NVIDIA runtime
46
+ # t=ultralytics/ultralytics:latest-jetson && sudo docker pull $t && sudo docker run -it --ipc=host --runtime=nvidia $t
STPoseNet/docker/Dockerfile-python ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Builds ultralytics/ultralytics:latest-cpu image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
3
+ # Image is CPU-optimized for ONNX, OpenVINO and PyTorch YOLOv8 deployments
4
+
5
+ # Use the official Python 3.10 slim-bookworm as base image
6
+ FROM python:3.10-slim-bookworm
7
+
8
+ # Downloads to user config dir
9
+ ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
10
+
11
+ # Install linux packages
12
+ # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
13
+ RUN apt update \
14
+ && apt install --no-install-recommends -y python3-pip git zip curl htop libgl1-mesa-glx libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
15
+ # RUN alias python=python3
16
+
17
+ # Create working directory
18
+ WORKDIR /usr/src/ultralytics
19
+
20
+ # Copy contents
21
+ # COPY . /usr/src/app (issues as not a .git directory)
22
+ RUN git clone https://github.com/ultralytics/ultralytics /usr/src/ultralytics
23
+ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
24
+
25
+ # Remove python3.11/EXTERNALLY-MANAGED or use 'pip install --break-system-packages' avoid 'externally-managed-environment' Ubuntu nightly error
26
+ # RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
27
+
28
+ # Install pip packages
29
+ RUN python3 -m pip install --upgrade pip wheel
30
+ RUN pip install --no-cache -e ".[export]" thop --extra-index-url https://download.pytorch.org/whl/cpu
31
+
32
+ # Run exports to AutoInstall packages
33
+ RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32
34
+ RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32
35
+ # Requires <= Python 3.10, bug with paddlepaddle==2.5.0
36
+ RUN pip install --no-cache paddlepaddle==2.4.2 x2paddle
37
+ # Remove exported models
38
+ RUN rm -rf tmp
39
+
40
+ # Usage Examples -------------------------------------------------------------------------------------------------------
41
+
42
+ # Build and Push
43
+ # t=ultralytics/ultralytics:latest-python && sudo docker build -f docker/Dockerfile-python -t $t . && sudo docker push $t
44
+
45
+ # Run
46
+ # t=ultralytics/ultralytics:latest-python && sudo docker run -it --ipc=host $t
47
+
48
+ # Pull and Run with local volume mounted
49
+ # t=ultralytics/ultralytics:latest-python && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t
STPoseNet/docker/Dockerfile-runner ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
3
+ # Image is CUDA-optimized for YOLOv8 single/multi-GPU training and inference tests
4
+
5
+ # Start FROM Ultralytics GPU image
6
+ FROM ultralytics/ultralytics:latest
7
+
8
+ # Set the working directory
9
+ WORKDIR /actions-runner
10
+
11
+ # Download and unpack the latest runner
12
+ RUN curl -o actions-runner-linux-x64-2.308.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.308.0/actions-runner-linux-x64-2.308.0.tar.gz && \
13
+ tar xzf actions-runner-linux-x64-2.308.0.tar.gz && \
14
+ rm actions-runner-linux-x64-2.308.0.tar.gz
15
+
16
+ # Install runner dependencies
17
+ ENV RUNNER_ALLOW_RUNASROOT=1
18
+ ENV DEBIAN_FRONTEND=noninteractive
19
+ RUN ./bin/installdependencies.sh && \
20
+ apt-get -y install libicu-dev
21
+
22
+ # Inline ENTRYPOINT command to configure and start runner with default TOKEN and NAME
23
+ ENTRYPOINT sh -c './config.sh --url https://github.com/ultralytics/ultralytics \
24
+ --token ${GITHUB_RUNNER_TOKEN:-TOKEN} \
25
+ --name ${GITHUB_RUNNER_NAME:-NAME} \
26
+ --labels gpu-latest \
27
+ --replace && \
28
+ ./run.sh'
29
+
30
+
31
+ # Usage Examples -------------------------------------------------------------------------------------------------------
32
+
33
+ # Build and Push
34
+ # t=ultralytics/ultralytics:latest-runner && sudo docker build -f docker/Dockerfile-runner -t $t . && sudo docker push $t
35
+
36
+ # Pull and Run in detached mode with access to GPUs 0 and 1
37
+ # t=ultralytics/ultralytics:latest-runner && sudo docker run -d -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host --gpus '"device=0,1"' $t
STPoseNet/min_data_enhance.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from tool.min_img_label import min_img
2
+
3
+ min_img(r'F:\mouse_re\paper-data\dataset\comprrehensive_ea_fe_wm\comprehensive-min')
STPoseNet/mkdocs.yml ADDED
@@ -0,0 +1,507 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+
3
+ site_name: Ultralytics YOLOv8 Docs
4
+ site_url: https://docs.ultralytics.com
5
+ site_description: Explore Ultralytics YOLOv8, a cutting-edge real-time object detection and image segmentation model for various applications and hardware platforms.
6
+ site_author: Ultralytics
7
+ repo_url: https://github.com/ultralytics/ultralytics
8
+ edit_uri: https://github.com/ultralytics/ultralytics/tree/main/docs
9
+ repo_name: ultralytics/ultralytics
10
+ remote_name: https://github.com/ultralytics/docs
11
+
12
+ theme:
13
+ name: material
14
+ custom_dir: docs/overrides
15
+ logo: https://github.com/ultralytics/assets/raw/main/logo/Ultralytics_Logotype_Reverse.svg
16
+ favicon: assets/favicon.ico
17
+ icon:
18
+ repo: fontawesome/brands/github
19
+ font:
20
+ text: Helvetica
21
+ code: Roboto Mono
22
+
23
+ palette:
24
+ # Palette toggle for light mode
25
+ - scheme: default
26
+ # primary: grey
27
+ toggle:
28
+ icon: material/brightness-7
29
+ name: Switch to dark mode
30
+
31
+ # Palette toggle for dark mode
32
+ - scheme: slate
33
+ # primary: black
34
+ toggle:
35
+ icon: material/brightness-4
36
+ name: Switch to light mode
37
+ features:
38
+ - announce.dismiss
39
+ - content.action.edit
40
+ - content.code.annotate
41
+ - content.code.copy
42
+ - content.tooltips
43
+ - search.highlight
44
+ - search.share
45
+ - search.suggest
46
+ - toc.follow
47
+ - toc.integrate
48
+ - navigation.top
49
+ - navigation.tabs
50
+ - navigation.tabs.sticky
51
+ - navigation.expand
52
+ - navigation.footer
53
+ - navigation.tracking
54
+ - navigation.instant
55
+ - navigation.indexes
56
+ - content.tabs.link # all code tabs change simultaneously
57
+
58
+ # Customization
59
+ copyright: <a href="https://ultralytics.com" target="_blank">© 2023 Ultralytics Inc.</a> All rights reserved.
60
+ extra:
61
+ # version:
62
+ # provider: mike # version drop-down menu
63
+ robots: robots.txt
64
+ analytics:
65
+ provider: google
66
+ property: G-2M5EHKC0BH
67
+ # feedback:
68
+ # title: Was this page helpful?
69
+ # ratings:
70
+ # - icon: material/heart
71
+ # name: This page was helpful
72
+ # data: 1
73
+ # note: Thanks for your feedback!
74
+ # - icon: material/heart-broken
75
+ # name: This page could be improved
76
+ # data: 0
77
+ # note: >-
78
+ # Thanks for your feedback!<br>
79
+ # <a href="https://github.com/ultralytics/ultralytics/issues/new?title=Docs+Feedback+for+{title}+page+at+https://docs.ultralytics.com/{url}&labels=enhancement&template=feature-request.yml" target="_blank" rel="noopener">Tell us what we can improve.</a>
80
+
81
+ social:
82
+ - icon: fontawesome/brands/github
83
+ link: https://github.com/ultralytics
84
+ - icon: fontawesome/brands/linkedin
85
+ link: https://www.linkedin.com/company/ultralytics/
86
+ - icon: fontawesome/brands/twitter
87
+ link: https://twitter.com/ultralytics
88
+ - icon: fontawesome/brands/youtube
89
+ link: https://www.youtube.com/ultralytics
90
+ - icon: fontawesome/brands/docker
91
+ link: https://hub.docker.com/r/ultralytics/ultralytics/
92
+ - icon: fontawesome/brands/python
93
+ link: https://pypi.org/project/ultralytics/
94
+ - icon: fontawesome/brands/discord
95
+ link: https://ultralytics.com/discord
96
+
97
+ extra_css:
98
+ - stylesheets/style.css
99
+ - https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css
100
+
101
+ markdown_extensions:
102
+ # Div text decorators
103
+ - admonition
104
+ - md_in_html
105
+ - pymdownx.details
106
+ - pymdownx.superfences
107
+ - tables
108
+ - attr_list
109
+ - def_list
110
+ # Syntax highlight
111
+ - pymdownx.highlight:
112
+ anchor_linenums: true
113
+ - pymdownx.inlinehilite
114
+ - pymdownx.snippets:
115
+ base_path: ./
116
+ - pymdownx.emoji:
117
+ emoji_index: !!python/name:materialx.emoji.twemoji # noqa
118
+ emoji_generator: !!python/name:materialx.emoji.to_svg
119
+ - pymdownx.tabbed:
120
+ alternate_style: true
121
+
122
+ # Highlight
123
+ - pymdownx.critic
124
+ - pymdownx.caret
125
+ - pymdownx.keys
126
+ - pymdownx.mark
127
+ - pymdownx.tilde
128
+
129
+ # Primary navigation ---------------------------------------------------------------------------------------------------
130
+ nav:
131
+ - Home:
132
+ - Home: index.md
133
+ - Quickstart: quickstart.md
134
+ - Modes:
135
+ - modes/index.md
136
+ - Train: modes/train.md
137
+ - Val: modes/val.md
138
+ - Predict: modes/predict.md
139
+ - Export: modes/export.md
140
+ - Track: modes/track.md
141
+ - Benchmark: modes/benchmark.md
142
+ - Tasks:
143
+ - tasks/index.md
144
+ - Detect: tasks/detect.md
145
+ - Segment: tasks/segment.md
146
+ - Classify: tasks/classify.md
147
+ - Pose: tasks/pose.md
148
+ - Quickstart: quickstart.md
149
+ - Modes:
150
+ - modes/index.md
151
+ - Train: modes/train.md
152
+ - Val: modes/val.md
153
+ - Predict: modes/predict.md
154
+ - Export: modes/export.md
155
+ - Track: modes/track.md
156
+ - Benchmark: modes/benchmark.md
157
+ - Tasks:
158
+ - tasks/index.md
159
+ - Detect: tasks/detect.md
160
+ - Segment: tasks/segment.md
161
+ - Classify: tasks/classify.md
162
+ - Pose: tasks/pose.md
163
+ - Models:
164
+ - models/index.md
165
+ - YOLOv3: models/yolov3.md
166
+ - YOLOv4: models/yolov4.md
167
+ - YOLOv5: models/yolov5.md
168
+ - YOLOv6: models/yolov6.md
169
+ - YOLOv7: models/yolov7.md
170
+ - YOLOv8: models/yolov8.md
171
+ - SAM (Segment Anything Model): models/sam.md
172
+ - MobileSAM (Mobile Segment Anything Model): models/mobile-sam.md
173
+ - FastSAM (Fast Segment Anything Model): models/fast-sam.md
174
+ - YOLO-NAS (Neural Architecture Search): models/yolo-nas.md
175
+ - RT-DETR (Realtime Detection Transformer): models/rtdetr.md
176
+ - Datasets:
177
+ - datasets/index.md
178
+ - Detection:
179
+ - datasets/detect/index.md
180
+ - Argoverse: datasets/detect/argoverse.md
181
+ - COCO: datasets/detect/coco.md
182
+ - COCO8: datasets/detect/coco8.md
183
+ - GlobalWheat2020: datasets/detect/globalwheat2020.md
184
+ - Objects365: datasets/detect/objects365.md
185
+ - OpenImagesV7: datasets/detect/open-images-v7.md
186
+ - SKU-110K: datasets/detect/sku-110k.md
187
+ - VisDrone: datasets/detect/visdrone.md
188
+ - VOC: datasets/detect/voc.md
189
+ - xView: datasets/detect/xview.md
190
+ - Segmentation:
191
+ - datasets/segment/index.md
192
+ - COCO: datasets/segment/coco.md
193
+ - COCO8-seg: datasets/segment/coco8-seg.md
194
+ - Pose:
195
+ - datasets/pose/index.md
196
+ - COCO: datasets/pose/coco.md
197
+ - COCO8-pose: datasets/pose/coco8-pose.md
198
+ - Classification:
199
+ - datasets/classify/index.md
200
+ - Caltech 101: datasets/classify/caltech101.md
201
+ - Caltech 256: datasets/classify/caltech256.md
202
+ - CIFAR-10: datasets/classify/cifar10.md
203
+ - CIFAR-100: datasets/classify/cifar100.md
204
+ - Fashion-MNIST: datasets/classify/fashion-mnist.md
205
+ - ImageNet: datasets/classify/imagenet.md
206
+ - ImageNet-10: datasets/classify/imagenet10.md
207
+ - Imagenette: datasets/classify/imagenette.md
208
+ - Imagewoof: datasets/classify/imagewoof.md
209
+ - MNIST: datasets/classify/mnist.md
210
+ - Oriented Bounding Boxes (OBB):
211
+ - datasets/obb/index.md
212
+ - DOTAv2: datasets/obb/dota-v2.md
213
+ - Multi-Object Tracking:
214
+ - datasets/track/index.md
215
+ - Guides:
216
+ - guides/index.md
217
+ - K-Fold Cross Validation: guides/kfold-cross-validation.md
218
+ - Hyperparameter Tuning: guides/hyperparameter-tuning.md
219
+ - Integrations:
220
+ - integrations/index.md
221
+ - OpenVINO: integrations/openvino.md
222
+ - Ray Tune: integrations/ray-tune.md
223
+ - Usage:
224
+ - CLI: usage/cli.md
225
+ - Python: usage/python.md
226
+ - Callbacks: usage/callbacks.md
227
+ - Configuration: usage/cfg.md
228
+ - Advanced Customization: usage/engine.md
229
+ - YOLOv5:
230
+ - yolov5/index.md
231
+ - Quickstart: yolov5/quickstart_tutorial.md
232
+ - Environments:
233
+ - Amazon Web Services (AWS): yolov5/environments/aws_quickstart_tutorial.md
234
+ - Google Cloud (GCP): yolov5/environments/google_cloud_quickstart_tutorial.md
235
+ - Docker Image: yolov5/environments/docker_image_quickstart_tutorial.md
236
+ - Tutorials:
237
+ - Train Custom Data: yolov5/tutorials/train_custom_data.md
238
+ - Tips for Best Training Results: yolov5/tutorials/tips_for_best_training_results.md
239
+ - Multi-GPU Training: yolov5/tutorials/multi_gpu_training.md
240
+ - PyTorch Hub: yolov5/tutorials/pytorch_hub_model_loading.md
241
+ - TFLite, ONNX, CoreML, TensorRT Export: yolov5/tutorials/model_export.md
242
+ - NVIDIA Jetson Nano Deployment: yolov5/tutorials/running_on_jetson_nano.md
243
+ - Test-Time Augmentation (TTA): yolov5/tutorials/test_time_augmentation.md
244
+ - Model Ensembling: yolov5/tutorials/model_ensembling.md
245
+ - Pruning/Sparsity Tutorial: yolov5/tutorials/model_pruning_and_sparsity.md
246
+ - Hyperparameter evolution: yolov5/tutorials/hyperparameter_evolution.md
247
+ - Transfer learning with frozen layers: yolov5/tutorials/transfer_learning_with_frozen_layers.md
248
+ - Architecture Summary: yolov5/tutorials/architecture_description.md
249
+ - Roboflow Datasets: yolov5/tutorials/roboflow_datasets_integration.md
250
+ - Neural Magic's DeepSparse: yolov5/tutorials/neural_magic_pruning_quantization.md
251
+ - Comet Logging: yolov5/tutorials/comet_logging_integration.md
252
+ - Clearml Logging: yolov5/tutorials/clearml_logging_integration.md
253
+ - Ultralytics HUB:
254
+ - hub/index.md
255
+ - Quickstart: hub/quickstart.md
256
+ - Datasets: hub/datasets.md
257
+ - Projects: hub/projects.md
258
+ - Models: hub/models.md
259
+ - Integrations: hub/integrations.md
260
+ - Ultralytics HUB App:
261
+ - hub/app/index.md
262
+ - 'iOS': hub/app/ios.md
263
+ - 'Android': hub/app/android.md
264
+ - Inference API: hub/inference_api.md
265
+ - Reference:
266
+ - cfg:
267
+ - __init__: reference/cfg/__init__.md
268
+ - data:
269
+ - annotator: reference/data/annotator.md
270
+ - augment: reference/data/augment.md
271
+ - base: reference/data/base.md
272
+ - build: reference/data/build.md
273
+ - converter: reference/data/converter.md
274
+ - dataset: reference/data/dataset.md
275
+ - loaders: reference/data/loaders.md
276
+ - utils: reference/data/utils.md
277
+ - engine:
278
+ - exporter: reference/engine/exporter.md
279
+ - model: reference/engine/model.md
280
+ - predictor: reference/engine/predictor.md
281
+ - results: reference/engine/results.md
282
+ - trainer: reference/engine/trainer.md
283
+ - tuner: reference/engine/tuner.md
284
+ - validator: reference/engine/validator.md
285
+ - hub:
286
+ - __init__: reference/hub/__init__.md
287
+ - auth: reference/hub/auth.md
288
+ - session: reference/hub/session.md
289
+ - utils: reference/hub/utils.md
290
+ - models:
291
+ - fastsam:
292
+ - model: reference/models/fastsam/model.md
293
+ - predict: reference/models/fastsam/predict.md
294
+ - prompt: reference/models/fastsam/prompt.md
295
+ - utils: reference/models/fastsam/utils.md
296
+ - val: reference/models/fastsam/val.md
297
+ - nas:
298
+ - model: reference/models/nas/model.md
299
+ - predict: reference/models/nas/predict.md
300
+ - val: reference/models/nas/val.md
301
+ - rtdetr:
302
+ - model: reference/models/rtdetr/model.md
303
+ - predict: reference/models/rtdetr/predict.md
304
+ - train: reference/models/rtdetr/train.md
305
+ - val: reference/models/rtdetr/val.md
306
+ - sam:
307
+ - amg: reference/models/sam/amg.md
308
+ - build: reference/models/sam/build.md
309
+ - model: reference/models/sam/model.md
310
+ - modules:
311
+ - decoders: reference/models/sam/modules/decoders.md
312
+ - encoders: reference/models/sam/modules/encoders.md
313
+ - sam: reference/models/sam/modules/sam.md
314
+ - tiny_encoder: reference/models/sam/modules/tiny_encoder.md
315
+ - transformer: reference/models/sam/modules/transformer.md
316
+ - predict: reference/models/sam/predict.md
317
+ - utils:
318
+ - loss: reference/models/utils/loss.md
319
+ - ops: reference/models/utils/ops.md
320
+ - yolo:
321
+ - classify:
322
+ - predict: reference/models/yolo/classify/predict.md
323
+ - train: reference/models/yolo/classify/train.md
324
+ - val: reference/models/yolo/classify/val.md
325
+ - detect:
326
+ - predict: reference/models/yolo/detect/predict.md
327
+ - train: reference/models/yolo/detect/train.md
328
+ - val: reference/models/yolo/detect/val.md
329
+ - model: reference/models/yolo/model.md
330
+ - pose:
331
+ - predict: reference/models/yolo/pose/predict.md
332
+ - train: reference/models/yolo/pose/train.md
333
+ - val: reference/models/yolo/pose/val.md
334
+ - segment:
335
+ - predict: reference/models/yolo/segment/predict.md
336
+ - train: reference/models/yolo/segment/train.md
337
+ - val: reference/models/yolo/segment/val.md
338
+ - nn:
339
+ - autobackend: reference/nn/autobackend.md
340
+ - modules:
341
+ - block: reference/nn/modules/block.md
342
+ - conv: reference/nn/modules/conv.md
343
+ - head: reference/nn/modules/head.md
344
+ - transformer: reference/nn/modules/transformer.md
345
+ - utils: reference/nn/modules/utils.md
346
+ - tasks: reference/nn/tasks.md
347
+ - trackers:
348
+ - basetrack: reference/trackers/basetrack.md
349
+ - bot_sort: reference/trackers/bot_sort.md
350
+ - byte_tracker: reference/trackers/byte_tracker.md
351
+ - track: reference/trackers/track.md
352
+ - utils:
353
+ - gmc: reference/trackers/utils/gmc.md
354
+ - kalman_filter: reference/trackers/utils/kalman_filter.md
355
+ - matching: reference/trackers/utils/matching.md
356
+ - utils:
357
+ - __init__: reference/utils/__init__.md
358
+ - autobatch: reference/utils/autobatch.md
359
+ - benchmarks: reference/utils/benchmarks.md
360
+ - callbacks:
361
+ - base: reference/utils/callbacks/base.md
362
+ - clearml: reference/utils/callbacks/clearml.md
363
+ - comet: reference/utils/callbacks/comet.md
364
+ - dvc: reference/utils/callbacks/dvc.md
365
+ - hub: reference/utils/callbacks/hub.md
366
+ - mlflow: reference/utils/callbacks/mlflow.md
367
+ - neptune: reference/utils/callbacks/neptune.md
368
+ - raytune: reference/utils/callbacks/raytune.md
369
+ - tensorboard: reference/utils/callbacks/tensorboard.md
370
+ - wb: reference/utils/callbacks/wb.md
371
+ - checks: reference/utils/checks.md
372
+ - dist: reference/utils/dist.md
373
+ - downloads: reference/utils/downloads.md
374
+ - errors: reference/utils/errors.md
375
+ - files: reference/utils/files.md
376
+ - instance: reference/utils/instance.md
377
+ - loss: reference/utils/loss.md
378
+ - metrics: reference/utils/metrics.md
379
+ - ops: reference/utils/ops.md
380
+ - patches: reference/utils/patches.md
381
+ - plotting: reference/utils/plotting.md
382
+ - tal: reference/utils/tal.md
383
+ - torch_utils: reference/utils/torch_utils.md
384
+ - tuner: reference/utils/tuner.md
385
+
386
+ - Help:
387
+ - Help: help/index.md
388
+ - Frequently Asked Questions (FAQ): help/FAQ.md
389
+ - Contributing Guide: help/contributing.md
390
+ - Continuous Integration (CI) Guide: help/CI.md
391
+ - Contributor License Agreement (CLA): help/CLA.md
392
+ - Minimum Reproducible Example (MRE) Guide: help/minimum_reproducible_example.md
393
+ - Code of Conduct: help/code_of_conduct.md
394
+ - Environmental, Health and Safety (EHS) Policy: help/environmental-health-safety.md
395
+ - Security Policy: SECURITY.md
396
+
397
+ # Plugins including 301 redirects navigation ---------------------------------------------------------------------------
398
+ plugins:
399
+ - search
400
+ - mkdocstrings:
401
+ enabled: true
402
+ default_handler: python
403
+ handlers:
404
+ python:
405
+ options:
406
+ docstring_style: google
407
+ show_root_heading: true
408
+ show_source: true
409
+ - ultralytics:
410
+ add_desc: False
411
+ add_image: True
412
+ add_share_buttons: True
413
+ default_image: https://github.com/ultralytics/ultralytics/assets/26833433/6d09221c-c52a-4234-9a5d-b862e93c6529
414
+ - redirects:
415
+ redirect_maps:
416
+ callbacks.md: usage/callbacks.md
417
+ cfg.md: usage/cfg.md
418
+ cli.md: usage/cli.md
419
+ config.md: usage/cfg.md
420
+ engine.md: usage/engine.md
421
+ environments/AWS-Quickstart.md: yolov5/environments/aws_quickstart_tutorial.md
422
+ environments/Docker-Quickstart.md: yolov5/environments/docker_image_quickstart_tutorial.md
423
+ environments/GCP-Quickstart.md: yolov5/environments/google_cloud_quickstart_tutorial.md
424
+ FAQ/augmentation.md: yolov5/tutorials/tips_for_best_training_results.md
425
+ package-framework.md: index.md
426
+ package-framework/mock_detector.md: index.md
427
+ predict.md: modes/predict.md
428
+ python.md: usage/python.md
429
+ quick-start.md: quickstart.md
430
+ app.md: hub/app/index.md
431
+ sdk.md: index.md
432
+ usage/hyperparameter_tuning.md: integrations/ray-tune.md
433
+ reference/base_pred.md: reference/engine/predictor.md
434
+ reference/base_trainer.md: reference/engine/trainer.md
435
+ reference/exporter.md: reference/engine/exporter.md
436
+ reference/model.md: reference/engine/model.md
437
+ reference/nn.md: reference/nn/modules/head.md
438
+ reference/ops.md: reference/utils/ops.md
439
+ reference/results.md: reference/engine/results.md
440
+ reference/base_val.md: index.md
441
+ tasks/classification.md: tasks/classify.md
442
+ tasks/detection.md: tasks/detect.md
443
+ tasks/segmentation.md: tasks/segment.md
444
+ tasks/keypoints.md: tasks/pose.md
445
+ tasks/tracking.md: modes/track.md
446
+ tutorials/architecture-summary.md: yolov5/tutorials/architecture_description.md
447
+ tutorials/clearml-logging.md: yolov5/tutorials/clearml_logging_integration.md
448
+ tutorials/comet-logging.md: yolov5/tutorials/comet_logging_integration.md
449
+ tutorials/hyperparameter-evolution.md: yolov5/tutorials/hyperparameter_evolution.md
450
+ tutorials/model-ensembling.md: yolov5/tutorials/model_ensembling.md
451
+ tutorials/multi-gpu-training.md: yolov5/tutorials/multi_gpu_training.md
452
+ tutorials/nvidia-jetson.md: yolov5/tutorials/running_on_jetson_nano.md
453
+ tutorials/pruning-sparsity.md: yolov5/tutorials/model_pruning_and_sparsity.md
454
+ tutorials/pytorch-hub.md: yolov5/tutorials/pytorch_hub_model_loading.md
455
+ tutorials/roboflow.md: yolov5/tutorials/roboflow_datasets_integration.md
456
+ tutorials/test-time-augmentation.md: yolov5/tutorials/test_time_augmentation.md
457
+ tutorials/torchscript-onnx-coreml-export.md: yolov5/tutorials/model_export.md
458
+ tutorials/train-custom-datasets.md: yolov5/tutorials/train_custom_data.md
459
+ tutorials/training-tips-best-results.md: yolov5/tutorials/tips_for_best_training_results.md
460
+ tutorials/transfer-learning-froze-layers.md: yolov5/tutorials/transfer_learning_with_frozen_layers.md
461
+ tutorials/weights-and-biasis-logging.md: yolov5/tutorials/comet_logging_integration.md
462
+ yolov5/pytorch_hub.md: yolov5/tutorials/pytorch_hub_model_loading.md
463
+ yolov5/hyp_evolution.md: yolov5/tutorials/hyperparameter_evolution.md
464
+ yolov5/pruning_sparsity.md: yolov5/tutorials/model_pruning_and_sparsity.md
465
+ yolov5/roboflow.md: yolov5/tutorials/roboflow_datasets_integration.md
466
+ yolov5/comet.md: yolov5/tutorials/comet_logging_integration.md
467
+ yolov5/clearml.md: yolov5/tutorials/clearml_logging_integration.md
468
+ yolov5/tta.md: yolov5/tutorials/test_time_augmentation.md
469
+ yolov5/multi_gpu_training.md: yolov5/tutorials/multi_gpu_training.md
470
+ yolov5/ensemble.md: yolov5/tutorials/model_ensembling.md
471
+ yolov5/jetson_nano.md: yolov5/tutorials/running_on_jetson_nano.md
472
+ yolov5/transfer_learn_frozen.md: yolov5/tutorials/transfer_learning_with_frozen_layers.md
473
+ yolov5/neural_magic.md: yolov5/tutorials/neural_magic_pruning_quantization.md
474
+ yolov5/train_custom_data.md: yolov5/tutorials/train_custom_data.md
475
+ yolov5/architecture.md: yolov5/tutorials/architecture_description.md
476
+ yolov5/export.md: yolov5/tutorials/model_export.md
477
+ yolov5/yolov5_quickstart_tutorial.md: yolov5/quickstart_tutorial.md
478
+ yolov5/tips_for_best_training_results.md: yolov5/tutorials/tips_for_best_training_results.md
479
+ yolov5/tutorials/yolov5_neural_magic_tutorial.md: yolov5/tutorials/neural_magic_pruning_quantization.md
480
+ yolov5/tutorials/model_ensembling_tutorial.md: yolov5/tutorials/model_ensembling.md
481
+ yolov5/tutorials/pytorch_hub_tutorial.md: yolov5/tutorials/pytorch_hub_model_loading.md
482
+ yolov5/tutorials/yolov5_architecture_tutorial.md: yolov5/tutorials/architecture_description.md
483
+ yolov5/tutorials/multi_gpu_training_tutorial.md: yolov5/tutorials/multi_gpu_training.md
484
+ yolov5/tutorials/yolov5_pytorch_hub_tutorial.md: yolov5/tutorials/pytorch_hub_model_loading.md
485
+ yolov5/tutorials/model_export_tutorial.md: yolov5/tutorials/model_export.md
486
+ yolov5/tutorials/jetson_nano_tutorial.md: yolov5/tutorials/running_on_jetson_nano.md
487
+ yolov5/tutorials/yolov5_model_ensembling_tutorial.md: yolov5/tutorials/model_ensembling.md
488
+ yolov5/tutorials/roboflow_integration.md: yolov5/tutorials/roboflow_datasets_integration.md
489
+ yolov5/tutorials/pruning_and_sparsity_tutorial.md: yolov5/tutorials/model_pruning_and_sparsity.md
490
+ yolov5/tutorials/yolov5_transfer_learning_with_frozen_layers_tutorial.md: yolov5/tutorials/transfer_learning_with_frozen_layers.md
491
+ yolov5/tutorials/transfer_learning_with_frozen_layers_tutorial.md: yolov5/tutorials/transfer_learning_with_frozen_layers.md
492
+ yolov5/tutorials/yolov5_model_export_tutorial.md: yolov5/tutorials/model_export.md
493
+ yolov5/tutorials/neural_magic_tutorial.md: yolov5/tutorials/neural_magic_pruning_quantization.md
494
+ yolov5/tutorials/yolov5_clearml_integration_tutorial.md: yolov5/tutorials/clearml_logging_integration.md
495
+ yolov5/tutorials/yolov5_train_custom_data.md: yolov5/tutorials/train_custom_data.md
496
+ yolov5/tutorials/comet_integration_tutorial.md: yolov5/tutorials/comet_logging_integration.md
497
+ yolov5/tutorials/yolov5_pruning_and_sparsity_tutorial.md: yolov5/tutorials/model_pruning_and_sparsity.md
498
+ yolov5/tutorials/yolov5_jetson_nano_tutorial.md: yolov5/tutorials/running_on_jetson_nano.md
499
+ yolov5/tutorials/yolov5_roboflow_integration.md: yolov5/tutorials/roboflow_datasets_integration.md
500
+ yolov5/tutorials/hyperparameter_evolution_tutorial.md: yolov5/tutorials/hyperparameter_evolution.md
501
+ yolov5/tutorials/yolov5_hyperparameter_evolution_tutorial.md: yolov5/tutorials/hyperparameter_evolution.md
502
+ yolov5/tutorials/clearml_integration_tutorial.md: yolov5/tutorials/clearml_logging_integration.md
503
+ yolov5/tutorials/test_time_augmentation_tutorial.md: yolov5/tutorials/test_time_augmentation.md
504
+ yolov5/tutorials/yolov5_test_time_augmentation_tutorial.md: yolov5/tutorials/test_time_augmentation.md
505
+ yolov5/environments/yolov5_amazon_web_services_quickstart_tutorial.md: yolov5/environments/aws_quickstart_tutorial.md
506
+ yolov5/environments/yolov5_google_cloud_platform_quickstart_tutorial.md: yolov5/environments/google_cloud_quickstart_tutorial.md
507
+ yolov5/environments/yolov5_docker_image_quickstart_tutorial.md: yolov5/environments/docker_image_quickstart_tutorial.md
STPoseNet/mouse-pre.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ultralytics import YOLO
2
+ import os
3
+
4
+
5
+ if __name__=='__main__':
6
+ os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"
7
+
8
+ model = YOLO(model="The weight file trained in the second step (.\runs\pose\train\train\xxx.pt)")
9
+ results = model(r"Video files that need to be identified")
10
+
11
+ # # Call camera recognition
12
+ # model = YOLO(model="trained_weight\\chase_min_l.pt")
13
+ # results = model(0)
14
+
15
+
STPoseNet/mouse-train.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ultralytics import YOLO
2
+ import os
3
+ from tool.min_img_label import min_img
4
+
5
+
6
+ if __name__=='__main__':
7
+ os.environ["WANDB_MODE"] = "offline"
8
+ os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"
9
+
10
+ # first train use it to enhance data
11
+ # min_img(r'F:\mouse_re\dataset\comprehensive-min')
12
+
13
+ # Load a model
14
+ model = YOLO('yolov8l-pose.yaml') # build a new model from YAML
15
+ model = YOLO('yolov8l-pose.pt') # load a pretrained model (recommended for training)
16
+ model = YOLO('yolov8l-pose.yaml').load('pretrain_weight.pt') # build from YAML and transfer weights
17
+
18
+ # Train the model
19
+ model.train(data='mouse-pose.yaml', epochs=400, imgsz=640)
STPoseNet/requirements.txt ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics requirements
2
+ # Example: pip install -r requirements.txt
3
+
4
+ # Base ----------------------------------------
5
+ matplotlib>=3.2.2
6
+ numpy>=1.22.2 # pinned by Snyk to avoid a vulnerability
7
+ opencv-python>=4.6.0
8
+ pillow>=7.1.2
9
+ pyyaml>=5.3.1
10
+ requests>=2.23.0
11
+ scipy>=1.4.1
12
+ torch>=1.8.0
13
+ torchvision>=0.9.0
14
+ tqdm>=4.64.0
15
+
16
+ # Logging -------------------------------------
17
+ # tensorboard>=2.13.0
18
+ # dvclive>=2.12.0
19
+ # clearml
20
+ # comet
21
+
22
+ # Plotting ------------------------------------
23
+ pandas>=1.1.4
24
+ seaborn>=0.11.0
25
+
26
+ # Export --------------------------------------
27
+ # coremltools>=7.0.b1 # CoreML export
28
+ # onnx>=1.12.0 # ONNX export
29
+ # onnxsim>=0.4.1 # ONNX simplifier
30
+ # nvidia-pyindex # TensorRT export
31
+ # nvidia-tensorrt # TensorRT export
32
+ # scikit-learn==0.19.2 # CoreML quantization
33
+ # tensorflow>=2.4.1 # TF exports (-cpu, -aarch64, -macos)
34
+ # tflite-support
35
+ # tensorflowjs>=3.9.0 # TF.js export
36
+ # openvino-dev>=2023.0 # OpenVINO export
37
+
38
+ # Extras --------------------------------------
39
+ psutil # system utilization
40
+ py-cpuinfo # display CPU info
41
+ # thop>=0.1.1 # FLOPs computation
42
+ # ipython # interactive notebook
43
+ # albumentations>=1.0.3 # training augmentations
44
+ # pycocotools>=2.0.6 # COCO mAP
45
+ # roboflow
STPoseNet/tmpni7swzfb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edcbd828f21e00f5836e2911b5de8979895f5cb8059800fb1d9a652c4e24be27
3
+ size 5251072
STPoseNet/tool/__pycache__/min_img_label.cpython-38.pyc ADDED
Binary file (2.56 kB). View file
 
STPoseNet/tool/min_img_label.py ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import copy
2
+ import os
3
+ import numpy as np
4
+ import cv2 as cv
5
+ import random
6
+
7
+
8
+ def ObtainRandom(n):
9
+ list_info = [] # 定义一个空列表(用于接收产生的随机数)
10
+ list_ = int(n/10)
11
+ while list_ != 0:
12
+ info = random.randint(1, n) # 每次循环获取一次随机数
13
+ if info not in list_info: # 判断随机数是否在列表中
14
+ list_info.append(info) # 不在列表中 进行添加
15
+ list_ = list_-1
16
+ return list_info
17
+
18
+ def min_img(path):
19
+ labels_path = path + '\\labels\\'
20
+ imgs_path = path + '\\images\\'
21
+ items = ('train', 'val')
22
+
23
+ total_num = len(os.listdir(imgs_path + 'train')) + len(os.listdir(imgs_path + 'val'))
24
+ val_list = ObtainRandom(total_num)
25
+
26
+ for k, item in enumerate(items):
27
+ if item == 'train':
28
+ m = total_num - len(val_list)
29
+ if item == 'val':
30
+ m = len(val_list)
31
+ list_txt = os.listdir(labels_path + item + '\\')
32
+ for j, file in enumerate(list_txt):
33
+ if j < m:
34
+ file_name = file.split('.')
35
+ if file_name[0] not in items:
36
+ img_path = imgs_path + item + '\\' + file_name[0] + '.jpg'
37
+ img = cv.imread(img_path)
38
+ # print(img_path)
39
+ img_size = img.shape
40
+ file_path = os.path.join(labels_path + item + '\\', file)
41
+ with open(file_path, "r") as labels:
42
+ label = labels.readlines()
43
+ label = label[0].split(" ")[1:-1]
44
+ for i in range(8):
45
+ label.remove('')
46
+ for i in range(3):
47
+ label.remove('2.000000')
48
+ label = list(map(float, label))
49
+
50
+ label_ = np.zeros(10)
51
+ for i in range(10):
52
+ if i % 2 == 0:
53
+ label_[i] = label[i] * img_size[1]
54
+ if i % 2 == 1:
55
+ label_[i] = label[i] * img_size[0]
56
+ label_int = label_.astype(int)
57
+
58
+ min_box = [[label_int[0]-label_int[2], label_int[1]-label_int[3]], [label_int[0]+label_int[2], label_int[1]+label_int[3]]]
59
+ for i in range(2):
60
+ if min_box[i][0] > img_size[1]:
61
+ min_box[i][0] = img_size[1]
62
+ if min_box[i][0] < 0:
63
+ min_box[i][0] = 0
64
+ for i in range(2):
65
+ if min_box[i][1] > img_size[0]:
66
+ min_box[i][1] = img_size[0]
67
+ if min_box[i][1] < 0:
68
+ min_box[i][1] = 0
69
+ min_img = img[min_box[0][1]:min_box[1][1], min_box[0][0]:min_box[1][0], :]
70
+
71
+ # print(j)
72
+ # print(label_int[0:4])
73
+ # print(min_box)
74
+ # cv.imshow('img', min_img)
75
+ # cv.waitKey()
76
+
77
+ min_img_size = min_img.shape
78
+ tf_set = min_box[0]
79
+ img_kps = copy.deepcopy(label_[4:])
80
+ min_kps = np.zeros(6)
81
+ for i in range(3):
82
+ min_kps[i * 2] = img_kps[i * 2] - tf_set[0]
83
+ min_kps[i * 2 + 1] = img_kps[i * 2 + 1] - tf_set[1]
84
+
85
+ i = len(list_txt) + total_num
86
+ min_name = 'min_' + file_name[0]
87
+
88
+ min_img_path = imgs_path + item + '\\' + min_name + '.jpg'
89
+ min_label_path = labels_path + item + '\\'
90
+ cv.imwrite(min_img_path, min_img)
91
+
92
+ f_txt = open(os.path.join(min_label_path + min_name + '.txt'), 'w')
93
+ f_txt.write("%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s" %
94
+ (0, 0.5, 0.5, 0.5, 0.5,
95
+ min_kps[0] / min_img_size[1], '', min_kps[1] / min_img_size[0], '', str(2.000000), '',
96
+ min_kps[2] / min_img_size[1], '', min_kps[3] / min_img_size[0], '', str(2.000000), '',
97
+ min_kps[4] / min_img_size[1], '', min_kps[5] / min_img_size[0], '', str(2.000000)
98
+ ))
99
+ f_txt.close()
STPoseNet/trained_weight/weight_download.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 链接:https://pan.baidu.com/s/10OoRX9jBjGijsdY_AXpWJA?pwd=mu9i
2
+ 提取码:mu9i
STPoseNet/ultralytics/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+
3
+ __version__ = '8.0.165'
4
+
5
+ from ultralytics.models import RTDETR, SAM, YOLO
6
+ from ultralytics.models.fastsam import FastSAM
7
+ from ultralytics.models.nas import NAS
8
+ from ultralytics.utils import SETTINGS as settings
9
+ from ultralytics.utils.checks import check_yolo as checks
10
+ from ultralytics.utils.downloads import download
11
+
12
+ __all__ = '__version__', 'YOLO', 'NAS', 'SAM', 'FastSAM', 'RTDETR', 'checks', 'download', 'settings' # allow simpler import
STPoseNet/ultralytics/__pycache__/__init__.cpython-38.pyc ADDED
Binary file (602 Bytes). View file
 
STPoseNet/ultralytics/assets/bus.jpg ADDED
STPoseNet/ultralytics/assets/zidane.jpg ADDED
STPoseNet/ultralytics/cfg/__init__.py ADDED
@@ -0,0 +1,460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+
3
+ import contextlib
4
+ import re
5
+ import shutil
6
+ import sys
7
+ from pathlib import Path
8
+ from types import SimpleNamespace
9
+ from typing import Dict, List, Union
10
+
11
+ from ultralytics.utils import (ASSETS, DEFAULT_CFG, DEFAULT_CFG_DICT, DEFAULT_CFG_PATH, LOGGER, RANK, SETTINGS,
12
+ SETTINGS_YAML, IterableSimpleNamespace, __version__, checks, colorstr, deprecation_warn,
13
+ yaml_load, yaml_print)
14
+
15
+ # Define valid tasks and modes
16
+ MODES = 'train', 'val', 'predict', 'export', 'track', 'benchmark'
17
+ TASKS = 'detect', 'segment', 'classify', 'pose'
18
+ TASK2DATA = {'detect': 'coco8.yaml', 'segment': 'coco8-seg.yaml', 'classify': 'imagenet100', 'pose': 'coco8-pose.yaml'}
19
+ TASK2MODEL = {
20
+ 'detect': 'yolov8n.pt',
21
+ 'segment': 'yolov8n-seg.pt',
22
+ 'classify': 'yolov8n-cls.pt',
23
+ 'pose': 'yolov8n-pose.pt'}
24
+ TASK2METRIC = {
25
+ 'detect': 'metrics/mAP50-95(B)',
26
+ 'segment': 'metrics/mAP50-95(M)',
27
+ 'classify': 'metrics/accuracy_top1',
28
+ 'pose': 'metrics/mAP50-95(P)'}
29
+
30
+ CLI_HELP_MSG = \
31
+ f"""
32
+ Arguments received: {str(['yolo'] + sys.argv[1:])}. Ultralytics 'yolo' commands use the following syntax:
33
+
34
+ yolo TASK MODE ARGS
35
+
36
+ Where TASK (optional) is one of {TASKS}
37
+ MODE (required) is one of {MODES}
38
+ ARGS (optional) are any number of custom 'arg=value' pairs like 'imgsz=320' that override defaults.
39
+ See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg'
40
+
41
+ 1. Train a detection model for 10 epochs with an initial learning_rate of 0.01
42
+ yolo train data=coco128.yaml model=yolov8n.pt epochs=10 lr0=0.01
43
+
44
+ 2. Predict a YouTube video using a pretrained segmentation model at image size 320:
45
+ yolo predict model=yolov8n-seg.pt source='https://youtu.be/Zgi9g1ksQHc' imgsz=320
46
+
47
+ 3. Val a pretrained detection model at batch-size 1 and image size 640:
48
+ yolo val model=yolov8n.pt data=coco128.yaml batch=1 imgsz=640
49
+
50
+ 4. Export a YOLOv8n classification model to ONNX format at image size 224 by 128 (no TASK required)
51
+ yolo export model=yolov8n-cls.pt format=onnx imgsz=224,128
52
+
53
+ 5. Run special commands:
54
+ yolo help
55
+ yolo checks
56
+ yolo version
57
+ yolo settings
58
+ yolo copy-cfg
59
+ yolo cfg
60
+
61
+ Docs: https://docs.ultralytics.com
62
+ Community: https://community.ultralytics.com
63
+ GitHub: https://github.com/ultralytics/ultralytics
64
+ """
65
+
66
+ # Define keys for arg type checks
67
+ CFG_FLOAT_KEYS = 'warmup_epochs', 'box', 'cls', 'dfl', 'degrees', 'shear'
68
+ CFG_FRACTION_KEYS = ('dropout', 'iou', 'lr0', 'lrf', 'momentum', 'weight_decay', 'warmup_momentum', 'warmup_bias_lr',
69
+ 'label_smoothing', 'hsv_h', 'hsv_s', 'hsv_v', 'translate', 'scale', 'perspective', 'flipud',
70
+ 'fliplr', 'mosaic', 'mixup', 'copy_paste', 'conf', 'iou', 'fraction') # fraction floats 0.0 - 1.0
71
+ CFG_INT_KEYS = ('epochs', 'patience', 'batch', 'workers', 'seed', 'close_mosaic', 'mask_ratio', 'max_det', 'vid_stride',
72
+ 'line_width', 'workspace', 'nbs', 'save_period')
73
+ CFG_BOOL_KEYS = ('save', 'exist_ok', 'verbose', 'deterministic', 'single_cls', 'rect', 'cos_lr', 'overlap_mask', 'val',
74
+ 'save_json', 'save_hybrid', 'half', 'dnn', 'plots', 'show', 'save_txt', 'save_conf', 'save_crop',
75
+ 'show_labels', 'show_conf', 'visualize', 'augment', 'agnostic_nms', 'retina_masks', 'boxes', 'keras',
76
+ 'optimize', 'int8', 'dynamic', 'simplify', 'nms', 'profile')
77
+
78
+
79
+ def cfg2dict(cfg):
80
+ """
81
+ Convert a configuration object to a dictionary, whether it is a file path, a string, or a SimpleNamespace object.
82
+
83
+ Args:
84
+ cfg (str | Path | dict | SimpleNamespace): Configuration object to be converted to a dictionary.
85
+
86
+ Returns:
87
+ cfg (dict): Configuration object in dictionary format.
88
+ """
89
+ if isinstance(cfg, (str, Path)):
90
+ cfg = yaml_load(cfg) # load dict
91
+ elif isinstance(cfg, SimpleNamespace):
92
+ cfg = vars(cfg) # convert to dict
93
+ return cfg
94
+
95
+
96
+ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, overrides: Dict = None):
97
+ """
98
+ Load and merge configuration data from a file or dictionary.
99
+
100
+ Args:
101
+ cfg (str | Path | Dict | SimpleNamespace): Configuration data.
102
+ overrides (str | Dict | optional): Overrides in the form of a file name or a dictionary. Default is None.
103
+
104
+ Returns:
105
+ (SimpleNamespace): Training arguments namespace.
106
+ """
107
+ cfg = cfg2dict(cfg)
108
+
109
+ # Merge overrides
110
+ if overrides:
111
+ overrides = cfg2dict(overrides)
112
+ if 'save_dir' not in cfg:
113
+ overrides.pop('save_dir', None) # special override keys to ignore
114
+ check_dict_alignment(cfg, overrides)
115
+ cfg = {**cfg, **overrides} # merge cfg and overrides dicts (prefer overrides)
116
+
117
+ # Special handling for numeric project/name
118
+ for k in 'project', 'name':
119
+ if k in cfg and isinstance(cfg[k], (int, float)):
120
+ cfg[k] = str(cfg[k])
121
+ if cfg.get('name') == 'model': # assign model to 'name' arg
122
+ cfg['name'] = cfg.get('model', '').split('.')[0]
123
+ LOGGER.warning(f"WARNING ⚠️ 'name=model' automatically updated to 'name={cfg['name']}'.")
124
+
125
+ # Type and Value checks
126
+ for k, v in cfg.items():
127
+ if v is not None: # None values may be from optional args
128
+ if k in CFG_FLOAT_KEYS and not isinstance(v, (int, float)):
129
+ raise TypeError(f"'{k}={v}' is of invalid type {type(v).__name__}. "
130
+ f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')")
131
+ elif k in CFG_FRACTION_KEYS:
132
+ if not isinstance(v, (int, float)):
133
+ raise TypeError(f"'{k}={v}' is of invalid type {type(v).__name__}. "
134
+ f"Valid '{k}' types are int (i.e. '{k}=0') or float (i.e. '{k}=0.5')")
135
+ if not (0.0 <= v <= 1.0):
136
+ raise ValueError(f"'{k}={v}' is an invalid value. "
137
+ f"Valid '{k}' values are between 0.0 and 1.0.")
138
+ elif k in CFG_INT_KEYS and not isinstance(v, int):
139
+ raise TypeError(f"'{k}={v}' is of invalid type {type(v).__name__}. "
140
+ f"'{k}' must be an int (i.e. '{k}=8')")
141
+ elif k in CFG_BOOL_KEYS and not isinstance(v, bool):
142
+ raise TypeError(f"'{k}={v}' is of invalid type {type(v).__name__}. "
143
+ f"'{k}' must be a bool (i.e. '{k}=True' or '{k}=False')")
144
+
145
+ # Return instance
146
+ return IterableSimpleNamespace(**cfg)
147
+
148
+
149
+ def get_save_dir(args, name=None):
150
+ """Return save_dir as created from train/val/predict arguments."""
151
+
152
+ if getattr(args, 'save_dir', None):
153
+ save_dir = args.save_dir
154
+ else:
155
+ from ultralytics.utils.files import increment_path
156
+
157
+ project = args.project or Path(SETTINGS['runs_dir']) / args.task
158
+ name = name or args.name or f'{args.mode}'
159
+ save_dir = increment_path(Path(project) / name, exist_ok=args.exist_ok if RANK in (-1, 0) else True)
160
+
161
+ return Path(save_dir)
162
+
163
+
164
+ def _handle_deprecation(custom):
165
+ """Hardcoded function to handle deprecated config keys."""
166
+
167
+ for key in custom.copy().keys():
168
+ if key == 'hide_labels':
169
+ deprecation_warn(key, 'show_labels')
170
+ custom['show_labels'] = custom.pop('hide_labels') == 'False'
171
+ if key == 'hide_conf':
172
+ deprecation_warn(key, 'show_conf')
173
+ custom['show_conf'] = custom.pop('hide_conf') == 'False'
174
+ if key == 'line_thickness':
175
+ deprecation_warn(key, 'line_width')
176
+ custom['line_width'] = custom.pop('line_thickness')
177
+
178
+ return custom
179
+
180
+
181
+ def check_dict_alignment(base: Dict, custom: Dict, e=None):
182
+ """
183
+ This function checks for any mismatched keys between a custom configuration list and a base configuration list.
184
+ If any mismatched keys are found, the function prints out similar keys from the base list and exits the program.
185
+
186
+ Args:
187
+ custom (dict): a dictionary of custom configuration options
188
+ base (dict): a dictionary of base configuration options
189
+ e (Error, optional): An optional error that is passed by the calling function.
190
+ """
191
+ custom = _handle_deprecation(custom)
192
+ base_keys, custom_keys = (set(x.keys()) for x in (base, custom))
193
+ mismatched = [k for k in custom_keys if k not in base_keys]
194
+ if mismatched:
195
+ from difflib import get_close_matches
196
+
197
+ string = ''
198
+ for x in mismatched:
199
+ matches = get_close_matches(x, base_keys) # key list
200
+ matches = [f'{k}={base[k]}' if base.get(k) is not None else k for k in matches]
201
+ match_str = f'Similar arguments are i.e. {matches}.' if matches else ''
202
+ string += f"'{colorstr('red', 'bold', x)}' is not a valid YOLO argument. {match_str}\n"
203
+ raise SyntaxError(string + CLI_HELP_MSG) from e
204
+
205
+
206
+ def merge_equals_args(args: List[str]) -> List[str]:
207
+ """
208
+ Merges arguments around isolated '=' args in a list of strings.
209
+ The function considers cases where the first argument ends with '=' or the second starts with '=',
210
+ as well as when the middle one is an equals sign.
211
+
212
+ Args:
213
+ args (List[str]): A list of strings where each element is an argument.
214
+
215
+ Returns:
216
+ List[str]: A list of strings where the arguments around isolated '=' are merged.
217
+ """
218
+ new_args = []
219
+ for i, arg in enumerate(args):
220
+ if arg == '=' and 0 < i < len(args) - 1: # merge ['arg', '=', 'val']
221
+ new_args[-1] += f'={args[i + 1]}'
222
+ del args[i + 1]
223
+ elif arg.endswith('=') and i < len(args) - 1 and '=' not in args[i + 1]: # merge ['arg=', 'val']
224
+ new_args.append(f'{arg}{args[i + 1]}')
225
+ del args[i + 1]
226
+ elif arg.startswith('=') and i > 0: # merge ['arg', '=val']
227
+ new_args[-1] += arg
228
+ else:
229
+ new_args.append(arg)
230
+ return new_args
231
+
232
+
233
+ def handle_yolo_hub(args: List[str]) -> None:
234
+ """
235
+ Handle Ultralytics HUB command-line interface (CLI) commands.
236
+
237
+ This function processes Ultralytics HUB CLI commands such as login and logout.
238
+ It should be called when executing a script with arguments related to HUB authentication.
239
+
240
+ Args:
241
+ args (List[str]): A list of command line arguments
242
+
243
+ Example:
244
+ ```bash
245
+ python my_script.py hub login your_api_key
246
+ ```
247
+ """
248
+ from ultralytics import hub
249
+
250
+ if args[0] == 'login':
251
+ key = args[1] if len(args) > 1 else ''
252
+ # Log in to Ultralytics HUB using the provided API key
253
+ hub.login(key)
254
+ elif args[0] == 'logout':
255
+ # Log out from Ultralytics HUB
256
+ hub.logout()
257
+
258
+
259
+ def handle_yolo_settings(args: List[str]) -> None:
260
+ """
261
+ Handle YOLO settings command-line interface (CLI) commands.
262
+
263
+ This function processes YOLO settings CLI commands such as reset.
264
+ It should be called when executing a script with arguments related to YOLO settings management.
265
+
266
+ Args:
267
+ args (List[str]): A list of command line arguments for YOLO settings management.
268
+
269
+ Example:
270
+ ```bash
271
+ python my_script.py yolo settings reset
272
+ ```
273
+ """
274
+ url = 'https://docs.ultralytics.com/quickstart/#ultralytics-settings' # help URL
275
+ try:
276
+ if any(args):
277
+ if args[0] == 'reset':
278
+ SETTINGS_YAML.unlink() # delete the settings file
279
+ SETTINGS.reset() # create new settings
280
+ LOGGER.info('Settings reset successfully') # inform the user that settings have been reset
281
+ else: # save a new setting
282
+ new = dict(parse_key_value_pair(a) for a in args)
283
+ check_dict_alignment(SETTINGS, new)
284
+ SETTINGS.update(new)
285
+
286
+ LOGGER.info(f'💡 Learn about settings at {url}')
287
+ yaml_print(SETTINGS_YAML) # print the current settings
288
+ except Exception as e:
289
+ LOGGER.warning(f"WARNING ⚠️ settings error: '{e}'. Please see {url} for help.")
290
+
291
+
292
+ def parse_key_value_pair(pair):
293
+ """Parse one 'key=value' pair and return key and value."""
294
+ re.sub(r' *= *', '=', pair) # remove spaces around equals sign
295
+ k, v = pair.split('=', 1) # split on first '=' sign
296
+ assert v, f"missing '{k}' value"
297
+ return k, smart_value(v)
298
+
299
+
300
+ def smart_value(v):
301
+ """Convert a string to an underlying type such as int, float, bool, etc."""
302
+ if v.lower() == 'none':
303
+ return None
304
+ elif v.lower() == 'true':
305
+ return True
306
+ elif v.lower() == 'false':
307
+ return False
308
+ else:
309
+ with contextlib.suppress(Exception):
310
+ return eval(v)
311
+ return v
312
+
313
+
314
+ def entrypoint(debug=''):
315
+ """
316
+ This function is the ultralytics package entrypoint, it's responsible for parsing the command line arguments passed
317
+ to the package.
318
+
319
+ This function allows for:
320
+ - passing mandatory YOLO args as a list of strings
321
+ - specifying the task to be performed, either 'detect', 'segment' or 'classify'
322
+ - specifying the mode, either 'train', 'val', 'test', or 'predict'
323
+ - running special modes like 'checks'
324
+ - passing overrides to the package's configuration
325
+
326
+ It uses the package's default cfg and initializes it using the passed overrides.
327
+ Then it calls the CLI function with the composed cfg
328
+ """
329
+ args = (debug.split(' ') if debug else sys.argv)[1:]
330
+ if not args: # no arguments passed
331
+ LOGGER.info(CLI_HELP_MSG)
332
+ return
333
+
334
+ special = {
335
+ 'help': lambda: LOGGER.info(CLI_HELP_MSG),
336
+ 'checks': checks.check_yolo,
337
+ 'version': lambda: LOGGER.info(__version__),
338
+ 'settings': lambda: handle_yolo_settings(args[1:]),
339
+ 'cfg': lambda: yaml_print(DEFAULT_CFG_PATH),
340
+ 'hub': lambda: handle_yolo_hub(args[1:]),
341
+ 'login': lambda: handle_yolo_hub(args),
342
+ 'copy-cfg': copy_default_cfg}
343
+ full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special}
344
+
345
+ # Define common mis-uses of special commands, i.e. -h, -help, --help
346
+ special.update({k[0]: v for k, v in special.items()}) # singular
347
+ special.update({k[:-1]: v for k, v in special.items() if len(k) > 1 and k.endswith('s')}) # singular
348
+ special = {**special, **{f'-{k}': v for k, v in special.items()}, **{f'--{k}': v for k, v in special.items()}}
349
+
350
+ overrides = {} # basic overrides, i.e. imgsz=320
351
+ for a in merge_equals_args(args): # merge spaces around '=' sign
352
+ if a.startswith('--'):
353
+ LOGGER.warning(f"WARNING ⚠️ '{a}' does not require leading dashes '--', updating to '{a[2:]}'.")
354
+ a = a[2:]
355
+ if a.endswith(','):
356
+ LOGGER.warning(f"WARNING ⚠️ '{a}' does not require trailing comma ',', updating to '{a[:-1]}'.")
357
+ a = a[:-1]
358
+ if '=' in a:
359
+ try:
360
+ k, v = parse_key_value_pair(a)
361
+ if k == 'cfg': # custom.yaml passed
362
+ LOGGER.info(f'Overriding {DEFAULT_CFG_PATH} with {v}')
363
+ overrides = {k: val for k, val in yaml_load(checks.check_yaml(v)).items() if k != 'cfg'}
364
+ else:
365
+ overrides[k] = v
366
+ except (NameError, SyntaxError, ValueError, AssertionError) as e:
367
+ check_dict_alignment(full_args_dict, {a: ''}, e)
368
+
369
+ elif a in TASKS:
370
+ overrides['task'] = a
371
+ elif a in MODES:
372
+ overrides['mode'] = a
373
+ elif a.lower() in special:
374
+ special[a.lower()]()
375
+ return
376
+ elif a in DEFAULT_CFG_DICT and isinstance(DEFAULT_CFG_DICT[a], bool):
377
+ overrides[a] = True # auto-True for default bool args, i.e. 'yolo show' sets show=True
378
+ elif a in DEFAULT_CFG_DICT:
379
+ raise SyntaxError(f"'{colorstr('red', 'bold', a)}' is a valid YOLO argument but is missing an '=' sign "
380
+ f"to set its value, i.e. try '{a}={DEFAULT_CFG_DICT[a]}'\n{CLI_HELP_MSG}")
381
+ else:
382
+ check_dict_alignment(full_args_dict, {a: ''})
383
+
384
+ # Check keys
385
+ check_dict_alignment(full_args_dict, overrides)
386
+
387
+ # Mode
388
+ mode = overrides.get('mode')
389
+ if mode is None:
390
+ mode = DEFAULT_CFG.mode or 'predict'
391
+ LOGGER.warning(f"WARNING ⚠️ 'mode' is missing. Valid modes are {MODES}. Using default 'mode={mode}'.")
392
+ elif mode not in MODES:
393
+ raise ValueError(f"Invalid 'mode={mode}'. Valid modes are {MODES}.\n{CLI_HELP_MSG}")
394
+
395
+ # Task
396
+ task = overrides.pop('task', None)
397
+ if task:
398
+ if task not in TASKS:
399
+ raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}")
400
+ if 'model' not in overrides:
401
+ overrides['model'] = TASK2MODEL[task]
402
+
403
+ # Model
404
+ model = overrides.pop('model', DEFAULT_CFG.model)
405
+ if model is None:
406
+ model = 'yolov8n.pt'
407
+ LOGGER.warning(f"WARNING ⚠️ 'model' is missing. Using default 'model={model}'.")
408
+ overrides['model'] = model
409
+ if 'rtdetr' in model.lower(): # guess architecture
410
+ from ultralytics import RTDETR
411
+ model = RTDETR(model) # no task argument
412
+ elif 'fastsam' in model.lower():
413
+ from ultralytics import FastSAM
414
+ model = FastSAM(model)
415
+ elif 'sam' in model.lower():
416
+ from ultralytics import SAM
417
+ model = SAM(model)
418
+ else:
419
+ from ultralytics import YOLO
420
+ model = YOLO(model, task=task)
421
+ if isinstance(overrides.get('pretrained'), str):
422
+ model.load(overrides['pretrained'])
423
+
424
+ # Task Update
425
+ if task != model.task:
426
+ if task:
427
+ LOGGER.warning(f"WARNING ⚠️ conflicting 'task={task}' passed with 'task={model.task}' model. "
428
+ f"Ignoring 'task={task}' and updating to 'task={model.task}' to match model.")
429
+ task = model.task
430
+
431
+ # Mode
432
+ if mode in ('predict', 'track') and 'source' not in overrides:
433
+ overrides['source'] = DEFAULT_CFG.source or ASSETS
434
+ LOGGER.warning(f"WARNING ⚠️ 'source' is missing. Using default 'source={overrides['source']}'.")
435
+ elif mode in ('train', 'val'):
436
+ if 'data' not in overrides and 'resume' not in overrides:
437
+ overrides['data'] = TASK2DATA.get(task or DEFAULT_CFG.task, DEFAULT_CFG.data)
438
+ LOGGER.warning(f"WARNING ⚠️ 'data' is missing. Using default 'data={overrides['data']}'.")
439
+ elif mode == 'export':
440
+ if 'format' not in overrides:
441
+ overrides['format'] = DEFAULT_CFG.format or 'torchscript'
442
+ LOGGER.warning(f"WARNING ⚠️ 'format' is missing. Using default 'format={overrides['format']}'.")
443
+
444
+ # Run command in python
445
+ # getattr(model, mode)(**vars(get_cfg(overrides=overrides))) # default args using default.yaml
446
+ getattr(model, mode)(**overrides) # default args from model
447
+
448
+
449
+ # Special modes --------------------------------------------------------------------------------------------------------
450
+ def copy_default_cfg():
451
+ """Copy and create a new default configuration file with '_copy' appended to its name."""
452
+ new_file = Path.cwd() / DEFAULT_CFG_PATH.name.replace('.yaml', '_copy.yaml')
453
+ shutil.copy2(DEFAULT_CFG_PATH, new_file)
454
+ LOGGER.info(f'{DEFAULT_CFG_PATH} copied to {new_file}\n'
455
+ f"Example YOLO command with this new custom cfg:\n yolo cfg='{new_file}' imgsz=320 batch=8")
456
+
457
+
458
+ if __name__ == '__main__':
459
+ # Example: entrypoint(debug='yolo predict model=yolov8n.pt')
460
+ entrypoint(debug='')
STPoseNet/ultralytics/cfg/__pycache__/__init__.cpython-38.pyc ADDED
Binary file (16.9 kB). View file
 
STPoseNet/ultralytics/cfg/datasets/Argoverse.yaml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ultralytics YOLO 🚀, 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: yolo train data=Argoverse.yaml
4
+ # parent
5
+ # ├── ultralytics
6
+ # └── datasets
7
+ # └── Argoverse ← downloads here (31.5 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
+ from tqdm import tqdm
32
+ from ultralytics.utils.downloads import download
33
+ from pathlib import Path
34
+
35
+ def argoverse2yolo(set):
36
+ labels = {}
37
+ a = json.load(open(set, "rb"))
38
+ for annot in tqdm(a['annotations'], desc=f"Converting {set} to YOLOv5 format..."):
39
+ img_id = annot['image_id']
40
+ img_name = a['images'][img_id]['name']
41
+ img_label_name = f'{img_name[:-3]}txt'
42
+
43
+ cls = annot['category_id'] # instance class id
44
+ x_center, y_center, width, height = annot['bbox']
45
+ x_center = (x_center + width / 2) / 1920.0 # offset and scale
46
+ y_center = (y_center + height / 2) / 1200.0 # offset and scale
47
+ width /= 1920.0 # scale
48
+ height /= 1200.0 # scale
49
+
50
+ img_dir = set.parents[2] / 'Argoverse-1.1' / 'labels' / a['seq_dirs'][a['images'][annot['image_id']]['sid']]
51
+ if not img_dir.exists():
52
+ img_dir.mkdir(parents=True, exist_ok=True)
53
+
54
+ k = str(img_dir / img_label_name)
55
+ if k not in labels:
56
+ labels[k] = []
57
+ labels[k].append(f"{cls} {x_center} {y_center} {width} {height}\n")
58
+
59
+ for k in labels:
60
+ with open(k, "w") as f:
61
+ f.writelines(labels[k])
62
+
63
+
64
+ # Download 'https://argoverse-hd.s3.us-east-2.amazonaws.com/Argoverse-HD-Full.zip' (deprecated S3 link)
65
+ dir = Path(yaml['path']) # dataset root dir
66
+ urls = ['https://drive.google.com/file/d/1st9qW3BeIwQsnR0t8mRpvbsSWIo16ACi/view?usp=drive_link']
67
+ download(urls, dir=dir)
68
+
69
+ # Convert
70
+ annotations_dir = 'Argoverse-HD/annotations/'
71
+ (dir / 'Argoverse-1.1' / 'tracking').rename(dir / 'Argoverse-1.1' / 'images') # rename 'tracking' to 'images'
72
+ for d in "train.json", "val.json":
73
+ argoverse2yolo(dir / annotations_dir / d) # convert Argoverse annotations to YOLO labels