ultralytics 8.2.2__py3-none-any.whl → 8.2.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ultralytics might be problematic. Click here for more details.
- ultralytics/__init__.py +1 -1
- ultralytics/trackers/byte_tracker.py +2 -2
- ultralytics/utils/benchmarks.py +132 -0
- {ultralytics-8.2.2.dist-info → ultralytics-8.2.4.dist-info}/METADATA +3 -2
- {ultralytics-8.2.2.dist-info → ultralytics-8.2.4.dist-info}/RECORD +9 -9
- {ultralytics-8.2.2.dist-info → ultralytics-8.2.4.dist-info}/LICENSE +0 -0
- {ultralytics-8.2.2.dist-info → ultralytics-8.2.4.dist-info}/WHEEL +0 -0
- {ultralytics-8.2.2.dist-info → ultralytics-8.2.4.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.2.2.dist-info → ultralytics-8.2.4.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
|
@@ -264,11 +264,11 @@ class BYTETracker:
|
|
|
264
264
|
bboxes = np.concatenate([bboxes, np.arange(len(bboxes)).reshape(-1, 1)], axis=-1)
|
|
265
265
|
cls = results.cls
|
|
266
266
|
|
|
267
|
-
remain_inds = scores
|
|
267
|
+
remain_inds = scores >= self.args.track_high_thresh
|
|
268
268
|
inds_low = scores > self.args.track_low_thresh
|
|
269
269
|
inds_high = scores < self.args.track_high_thresh
|
|
270
270
|
|
|
271
|
-
inds_second =
|
|
271
|
+
inds_second = inds_low & inds_high
|
|
272
272
|
dets_second = bboxes[inds_second]
|
|
273
273
|
dets = bboxes[remain_inds]
|
|
274
274
|
scores_keep = scores[remain_inds]
|
ultralytics/utils/benchmarks.py
CHANGED
|
@@ -25,18 +25,23 @@ NCNN | `ncnn` | yolov8n_ncnn_model/
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
import glob
|
|
28
|
+
import os
|
|
28
29
|
import platform
|
|
30
|
+
import re
|
|
31
|
+
import shutil
|
|
29
32
|
import time
|
|
30
33
|
from pathlib import Path
|
|
31
34
|
|
|
32
35
|
import numpy as np
|
|
33
36
|
import torch.cuda
|
|
37
|
+
import yaml
|
|
34
38
|
|
|
35
39
|
from ultralytics import YOLO, YOLOWorld
|
|
36
40
|
from ultralytics.cfg import TASK2DATA, TASK2METRIC
|
|
37
41
|
from ultralytics.engine.exporter import export_formats
|
|
38
42
|
from ultralytics.utils import ARM64, ASSETS, IS_JETSON, IS_RASPBERRYPI, LINUX, LOGGER, MACOS, TQDM, WEIGHTS_DIR
|
|
39
43
|
from ultralytics.utils.checks import IS_PYTHON_3_12, check_requirements, check_yolo
|
|
44
|
+
from ultralytics.utils.downloads import safe_download
|
|
40
45
|
from ultralytics.utils.files import file_size
|
|
41
46
|
from ultralytics.utils.torch_utils import select_device
|
|
42
47
|
|
|
@@ -152,6 +157,133 @@ def benchmark(
|
|
|
152
157
|
return df
|
|
153
158
|
|
|
154
159
|
|
|
160
|
+
class RF100Benchmark:
|
|
161
|
+
def __init__(self):
|
|
162
|
+
"""Function for initialization of RF100Benchmark."""
|
|
163
|
+
self.ds_names = []
|
|
164
|
+
self.ds_cfg_list = []
|
|
165
|
+
self.rf = None
|
|
166
|
+
self.val_metrics = ["class", "images", "targets", "precision", "recall", "map50", "map95"]
|
|
167
|
+
|
|
168
|
+
def set_key(self, api_key):
|
|
169
|
+
"""
|
|
170
|
+
Set Roboflow API key for processing.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
api_key (str): The API key.
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
check_requirements("roboflow")
|
|
177
|
+
from roboflow import Roboflow
|
|
178
|
+
|
|
179
|
+
self.rf = Roboflow(api_key=api_key)
|
|
180
|
+
|
|
181
|
+
def parse_dataset(self, ds_link_txt="datasets_links.txt"):
|
|
182
|
+
"""
|
|
183
|
+
Parse dataset links and downloads datasets.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
ds_link_txt (str): Path to dataset_links file.
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
(shutil.rmtree("rf-100"), os.mkdir("rf-100")) if os.path.exists("rf-100") else os.mkdir("rf-100")
|
|
190
|
+
os.chdir("rf-100")
|
|
191
|
+
os.mkdir("ultralytics-benchmarks")
|
|
192
|
+
safe_download("https://ultralytics.com/assets/datasets_links.txt")
|
|
193
|
+
|
|
194
|
+
with open(ds_link_txt, "r") as file:
|
|
195
|
+
for line in file:
|
|
196
|
+
try:
|
|
197
|
+
_, url, workspace, project, version = re.split("/+", line.strip())
|
|
198
|
+
self.ds_names.append(project)
|
|
199
|
+
proj_version = f"{project}-{version}"
|
|
200
|
+
if not Path(proj_version).exists():
|
|
201
|
+
self.rf.workspace(workspace).project(project).version(version).download("yolov8")
|
|
202
|
+
else:
|
|
203
|
+
print("Dataset already downloaded.")
|
|
204
|
+
self.ds_cfg_list.append(Path.cwd() / proj_version / "data.yaml")
|
|
205
|
+
except Exception:
|
|
206
|
+
continue
|
|
207
|
+
|
|
208
|
+
return self.ds_names, self.ds_cfg_list
|
|
209
|
+
|
|
210
|
+
def fix_yaml(self, path):
|
|
211
|
+
"""
|
|
212
|
+
Function to fix yaml train and val path.
|
|
213
|
+
|
|
214
|
+
Args:
|
|
215
|
+
path (str): YAML file path.
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
with open(path, "r") as file:
|
|
219
|
+
yaml_data = yaml.safe_load(file)
|
|
220
|
+
yaml_data["train"] = "train/images"
|
|
221
|
+
yaml_data["val"] = "valid/images"
|
|
222
|
+
with open(path, "w") as file:
|
|
223
|
+
yaml.safe_dump(yaml_data, file)
|
|
224
|
+
|
|
225
|
+
def evaluate(self, yaml_path, val_log_file, eval_log_file, list_ind):
|
|
226
|
+
"""
|
|
227
|
+
Model evaluation on validation results.
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
yaml_path (str): YAML file path.
|
|
231
|
+
val_log_file (str): val_log_file path.
|
|
232
|
+
eval_log_file (str): eval_log_file path.
|
|
233
|
+
list_ind (int): Index for current dataset.
|
|
234
|
+
"""
|
|
235
|
+
skip_symbols = ["🚀", "⚠️", "💡", "❌"]
|
|
236
|
+
with open(yaml_path) as stream:
|
|
237
|
+
class_names = yaml.safe_load(stream)["names"]
|
|
238
|
+
with open(val_log_file, "r", encoding="utf-8") as f:
|
|
239
|
+
lines = f.readlines()
|
|
240
|
+
eval_lines = []
|
|
241
|
+
for line in lines:
|
|
242
|
+
if any(symbol in line for symbol in skip_symbols):
|
|
243
|
+
continue
|
|
244
|
+
entries = line.split(" ")
|
|
245
|
+
entries = list(filter(lambda val: val != "", entries))
|
|
246
|
+
entries = [e.strip("\n") for e in entries]
|
|
247
|
+
start_class = False
|
|
248
|
+
for e in entries:
|
|
249
|
+
if e == "all":
|
|
250
|
+
if "(AP)" not in entries:
|
|
251
|
+
if "(AR)" not in entries:
|
|
252
|
+
# parse all
|
|
253
|
+
eval = {}
|
|
254
|
+
eval["class"] = entries[0]
|
|
255
|
+
eval["images"] = entries[1]
|
|
256
|
+
eval["targets"] = entries[2]
|
|
257
|
+
eval["precision"] = entries[3]
|
|
258
|
+
eval["recall"] = entries[4]
|
|
259
|
+
eval["map50"] = entries[5]
|
|
260
|
+
eval["map95"] = entries[6]
|
|
261
|
+
eval_lines.append(eval)
|
|
262
|
+
|
|
263
|
+
if e in class_names:
|
|
264
|
+
eval = {}
|
|
265
|
+
eval["class"] = entries[0]
|
|
266
|
+
eval["images"] = entries[1]
|
|
267
|
+
eval["targets"] = entries[2]
|
|
268
|
+
eval["precision"] = entries[3]
|
|
269
|
+
eval["recall"] = entries[4]
|
|
270
|
+
eval["map50"] = entries[5]
|
|
271
|
+
eval["map95"] = entries[6]
|
|
272
|
+
eval_lines.append(eval)
|
|
273
|
+
map_val = 0.0
|
|
274
|
+
if len(eval_lines) > 1:
|
|
275
|
+
print("There's more dicts")
|
|
276
|
+
for lst in eval_lines:
|
|
277
|
+
if lst["class"] == "all":
|
|
278
|
+
map_val = lst["map50"]
|
|
279
|
+
else:
|
|
280
|
+
print("There's only one dict res")
|
|
281
|
+
map_val = [res["map50"] for res in eval_lines][0]
|
|
282
|
+
|
|
283
|
+
with open(eval_log_file, "a") as f:
|
|
284
|
+
f.write(f"{self.ds_names[list_ind]}: {map_val}\n")
|
|
285
|
+
|
|
286
|
+
|
|
155
287
|
class ProfileModels:
|
|
156
288
|
"""
|
|
157
289
|
ProfileModels class for profiling different models on ONNX and TensorRT.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.4
|
|
4
4
|
Summary: Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
|
5
5
|
Author: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
6
6
|
Maintainer: Glenn Jocher, Ayush Chaurasia, Jing Qiu
|
|
@@ -51,6 +51,7 @@ Requires-Dist: pre-commit ; extra == 'dev'
|
|
|
51
51
|
Requires-Dist: pytest ; extra == 'dev'
|
|
52
52
|
Requires-Dist: pytest-cov ; extra == 'dev'
|
|
53
53
|
Requires-Dist: coverage[toml] ; extra == 'dev'
|
|
54
|
+
Requires-Dist: mkdocs >=1.6.0 ; extra == 'dev'
|
|
54
55
|
Requires-Dist: mkdocs-material >=9.5.9 ; extra == 'dev'
|
|
55
56
|
Requires-Dist: mkdocstrings[python] ; extra == 'dev'
|
|
56
57
|
Requires-Dist: mkdocs-jupyter ; extra == 'dev'
|
|
@@ -84,7 +85,7 @@ Requires-Dist: dvclive >=2.12.0 ; extra == 'logging'
|
|
|
84
85
|
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png" alt="YOLO Vision banner"></a>
|
|
85
86
|
</p>
|
|
86
87
|
|
|
87
|
-
[中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [हिन्दी](https://docs.ultralytics.com/hi/) | [العربية](https://docs.ultralytics.com/ar/) <br>
|
|
88
|
+
[中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [हिन्दी](https://docs.ultralytics.com/hi/) | [العربية](https://docs.ultralytics.com/ar/) <br>
|
|
88
89
|
|
|
89
90
|
<div>
|
|
90
91
|
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ultralytics/__init__.py,sha256=
|
|
1
|
+
ultralytics/__init__.py,sha256=Xj8X_EB1cDYpOs0-CV0NRVpnXN6LsA43RusyuNaVECw,632
|
|
2
2
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
3
3
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
4
4
|
ultralytics/cfg/__init__.py,sha256=4ZnvY2ULMGofFhjaRIzKQlGC5YVkvWkEAYAhnsKC1Po,21312
|
|
@@ -163,7 +163,7 @@ ultralytics/solutions/speed_estimation.py,sha256=lvaU-F8f3V4KFVKFaNS7isIdYtMSFjh
|
|
|
163
163
|
ultralytics/trackers/__init__.py,sha256=j72IgH2dZHQArMPK4YwcV5ieIw94fYvlGdQjB9cOQKw,227
|
|
164
164
|
ultralytics/trackers/basetrack.py,sha256=-vBDD-Q9lsxfTMK2w9kuqWGrYbRMmaBCCEbGGyR53gE,3675
|
|
165
165
|
ultralytics/trackers/bot_sort.py,sha256=39AvhYVbT7izF3--rX_e6Lhgb5czTA23gw6AgnNcRds,8601
|
|
166
|
-
ultralytics/trackers/byte_tracker.py,sha256=
|
|
166
|
+
ultralytics/trackers/byte_tracker.py,sha256=X3IAl9v6GyCv5vLPBvWyUpzpLHk7Sq9CPpYKPsVlg2M,18857
|
|
167
167
|
ultralytics/trackers/track.py,sha256=mQX3vntIuNiUw1KjczitPFeEOsxrPWkjAPVOG6MldC8,3463
|
|
168
168
|
ultralytics/trackers/utils/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
169
169
|
ultralytics/trackers/utils/gmc.py,sha256=vwcPA1n5zjPaBGhCDt8ItN7rq_6Sczsjn4gsXJfRylU,13688
|
|
@@ -171,7 +171,7 @@ ultralytics/trackers/utils/kalman_filter.py,sha256=0oqhk59NKEiwcJ2FXnw6_sT4bIFC6
|
|
|
171
171
|
ultralytics/trackers/utils/matching.py,sha256=UxhSGa5pN6WoYwYSBAkkt-O7xMxUR47VuUB6PfVNkb4,5404
|
|
172
172
|
ultralytics/utils/__init__.py,sha256=BdmRL2UhbmzmWuhaB1iDUTOyQ3fTwOrB0aUijAgpOUg,39286
|
|
173
173
|
ultralytics/utils/autobatch.py,sha256=ygZ3f2ByIkcujB89ENcTnGWWnAQw5Pbg6nBuShg-5t4,3863
|
|
174
|
-
ultralytics/utils/benchmarks.py,sha256=
|
|
174
|
+
ultralytics/utils/benchmarks.py,sha256=l9SHatEr4itinf9R77bunBpNqrTI2S_qaPB3K2oAYRg,23470
|
|
175
175
|
ultralytics/utils/checks.py,sha256=UDrcHiTMjSHSyUZflTRGuyYRj0uz9-RQ-xfDq_lsXZo,27971
|
|
176
176
|
ultralytics/utils/dist.py,sha256=3HeNbY2gp7vYhcvVhsrvTrQXpQmgT8tpmnzApf3eQRA,2267
|
|
177
177
|
ultralytics/utils/downloads.py,sha256=Rx32imHkKyVltEDMiCtCT2N5aA9Cud_0PyIUoTh4ru0,21496
|
|
@@ -198,9 +198,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyz
|
|
|
198
198
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
|
199
199
|
ultralytics/utils/callbacks/tensorboard.py,sha256=Z1veCVcn9THPhdplWuIzwlsW2yF7y-On9IZIk3khM0Y,4135
|
|
200
200
|
ultralytics/utils/callbacks/wb.py,sha256=woCQVuZzqtM5KnwxIibcfM3sFBYojeMPnv11jrRaIQA,6674
|
|
201
|
-
ultralytics-8.2.
|
|
202
|
-
ultralytics-8.2.
|
|
203
|
-
ultralytics-8.2.
|
|
204
|
-
ultralytics-8.2.
|
|
205
|
-
ultralytics-8.2.
|
|
206
|
-
ultralytics-8.2.
|
|
201
|
+
ultralytics-8.2.4.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
202
|
+
ultralytics-8.2.4.dist-info/METADATA,sha256=iAb96Wi7-WznWV_swqk2Kthc8JdM9lscmfusdX2xQ7Q,40595
|
|
203
|
+
ultralytics-8.2.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
204
|
+
ultralytics-8.2.4.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
205
|
+
ultralytics-8.2.4.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
206
|
+
ultralytics-8.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|