ultralytics 8.3.72__py3-none-any.whl → 8.3.74__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.
- ultralytics/__init__.py +1 -1
- ultralytics/engine/model.py +1 -0
- ultralytics/engine/results.py +9 -20
- ultralytics/engine/trainer.py +2 -0
- ultralytics/utils/__init__.py +0 -1
- ultralytics/utils/benchmarks.py +5 -3
- ultralytics/utils/callbacks/raytune.py +1 -1
- ultralytics/utils/checks.py +1 -1
- ultralytics/utils/torch_utils.py +9 -2
- {ultralytics-8.3.72.dist-info → ultralytics-8.3.74.dist-info}/METADATA +1 -2
- {ultralytics-8.3.72.dist-info → ultralytics-8.3.74.dist-info}/RECORD +15 -15
- {ultralytics-8.3.72.dist-info → ultralytics-8.3.74.dist-info}/LICENSE +0 -0
- {ultralytics-8.3.72.dist-info → ultralytics-8.3.74.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.72.dist-info → ultralytics-8.3.74.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.72.dist-info → ultralytics-8.3.74.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/engine/model.py
CHANGED
@@ -140,6 +140,7 @@ class Model(torch.nn.Module):
|
|
140
140
|
return
|
141
141
|
|
142
142
|
# Load or create new YOLO model
|
143
|
+
__import__("os").environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8" # to avoid deterministic warnings
|
143
144
|
if Path(model).suffix in {".yaml", ".yml"}:
|
144
145
|
self._new(model, task=task, verbose=verbose)
|
145
146
|
else:
|
ultralytics/engine/results.py
CHANGED
@@ -583,7 +583,7 @@ class Results(SimpleClass):
|
|
583
583
|
if save:
|
584
584
|
annotator.save(filename)
|
585
585
|
|
586
|
-
return annotator.result()
|
586
|
+
return annotator.im if pil else annotator.result()
|
587
587
|
|
588
588
|
def show(self, *args, **kwargs):
|
589
589
|
"""
|
@@ -967,7 +967,7 @@ class Results(SimpleClass):
|
|
967
967
|
|
968
968
|
# Convert results to a list of dictionaries
|
969
969
|
data = self.summary(normalize=normalize, decimals=decimals)
|
970
|
-
if
|
970
|
+
if len(data) == 0:
|
971
971
|
LOGGER.warning("⚠️ No results to save to SQL. Results dict is empty")
|
972
972
|
return
|
973
973
|
|
@@ -977,31 +977,20 @@ class Results(SimpleClass):
|
|
977
977
|
|
978
978
|
# Create table if it doesn't exist
|
979
979
|
columns = (
|
980
|
-
"id INTEGER PRIMARY KEY AUTOINCREMENT, class_name TEXT, confidence REAL, "
|
981
|
-
"box TEXT, masks TEXT, kpts TEXT, obb TEXT"
|
980
|
+
"id INTEGER PRIMARY KEY AUTOINCREMENT, class_name TEXT, confidence REAL, box TEXT, masks TEXT, kpts TEXT"
|
982
981
|
)
|
983
982
|
cursor.execute(f"CREATE TABLE IF NOT EXISTS {table_name} ({columns})")
|
984
983
|
|
985
984
|
# Insert data into the table
|
986
|
-
for
|
987
|
-
detect, obb = None, None # necessary to reinit these variables inside for loop to avoid duplication
|
988
|
-
class_name = item.get("name")
|
989
|
-
box = item.get("box", {})
|
990
|
-
# Serialize the box as JSON for 'detect' and 'obb' based on key presence
|
991
|
-
if all(key in box for key in ["x1", "y1", "x2", "y2"]) and not any(key in box for key in ["x3", "x4"]):
|
992
|
-
detect = json.dumps(box)
|
993
|
-
if all(key in box for key in ["x1", "y1", "x2", "y2", "x3", "x4"]):
|
994
|
-
obb = json.dumps(box)
|
995
|
-
|
985
|
+
for item in data:
|
996
986
|
cursor.execute(
|
997
|
-
f"INSERT INTO {table_name} (class_name, confidence, box, masks, kpts
|
987
|
+
f"INSERT INTO {table_name} (class_name, confidence, box, masks, kpts) VALUES (?, ?, ?, ?, ?)",
|
998
988
|
(
|
999
|
-
|
989
|
+
item.get("name"),
|
1000
990
|
item.get("confidence"),
|
1001
|
-
|
1002
|
-
json.dumps(item.get("segments", {})
|
1003
|
-
json.dumps(item.get("keypoints", {})
|
1004
|
-
obb,
|
991
|
+
json.dumps(item.get("box", {})),
|
992
|
+
json.dumps(item.get("segments", {})),
|
993
|
+
json.dumps(item.get("keypoints", {})),
|
1005
994
|
),
|
1006
995
|
)
|
1007
996
|
|
ultralytics/engine/trainer.py
CHANGED
@@ -52,6 +52,7 @@ from ultralytics.utils.torch_utils import (
|
|
52
52
|
select_device,
|
53
53
|
strip_optimizer,
|
54
54
|
torch_distributed_zero_first,
|
55
|
+
unset_deterministic,
|
55
56
|
)
|
56
57
|
|
57
58
|
|
@@ -471,6 +472,7 @@ class BaseTrainer:
|
|
471
472
|
self.plot_metrics()
|
472
473
|
self.run_callbacks("on_train_end")
|
473
474
|
self._clear_memory()
|
475
|
+
unset_deterministic()
|
474
476
|
self.run_callbacks("teardown")
|
475
477
|
|
476
478
|
def auto_batch(self, max_num_obj=0):
|
ultralytics/utils/__init__.py
CHANGED
@@ -128,7 +128,6 @@ torch.set_printoptions(linewidth=320, precision=4, profile="default")
|
|
128
128
|
np.set_printoptions(linewidth=320, formatter={"float_kind": "{:11.5g}".format}) # format short g, %precision=5
|
129
129
|
cv2.setNumThreads(0) # prevent OpenCV from multithreading (incompatible with PyTorch DataLoader)
|
130
130
|
os.environ["NUMEXPR_MAX_THREADS"] = str(NUM_THREADS) # NumExpr max threads
|
131
|
-
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8" # for deterministic training to avoid CUDA warning
|
132
131
|
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" # suppress verbose TF compiler warnings in Colab
|
133
132
|
os.environ["TORCH_CPP_LOG_LEVEL"] = "ERROR" # suppress "NNPACK.cpp could not initialize NNPACK" warnings
|
134
133
|
os.environ["KINETO_LOG_LEVEL"] = "5" # suppress verbose PyTorch profiler output when computing FLOPs
|
ultralytics/utils/benchmarks.py
CHANGED
@@ -93,6 +93,8 @@ def benchmark(
|
|
93
93
|
if isinstance(model, (str, Path)):
|
94
94
|
model = YOLO(model)
|
95
95
|
is_end2end = getattr(model.model.model[-1], "end2end", False)
|
96
|
+
data = data or TASK2DATA[model.task] # task to dataset, i.e. coco8.yaml for task=detect
|
97
|
+
key = TASK2METRIC[model.task] # task to metric, i.e. metrics/mAP50-95(B) for task=detect
|
96
98
|
|
97
99
|
y = []
|
98
100
|
t0 = time.time()
|
@@ -150,7 +152,9 @@ def benchmark(
|
|
150
152
|
filename = model.pt_path or model.ckpt_path or model.model_name
|
151
153
|
exported_model = model # PyTorch format
|
152
154
|
else:
|
153
|
-
filename = model.export(
|
155
|
+
filename = model.export(
|
156
|
+
imgsz=imgsz, format=format, half=half, int8=int8, data=data, device=device, verbose=False
|
157
|
+
)
|
154
158
|
exported_model = YOLO(filename, task=model.task)
|
155
159
|
assert suffix in str(filename), "export failed"
|
156
160
|
emoji = "❎" # indicates export succeeded
|
@@ -164,11 +168,9 @@ def benchmark(
|
|
164
168
|
exported_model.predict(ASSETS / "bus.jpg", imgsz=imgsz, device=device, half=half, verbose=False)
|
165
169
|
|
166
170
|
# Validate
|
167
|
-
data = data or TASK2DATA[model.task] # task to dataset, i.e. coco8.yaml for task=detect
|
168
171
|
results = exported_model.val(
|
169
172
|
data=data, batch=1, imgsz=imgsz, plots=False, device=device, half=half, int8=int8, verbose=False
|
170
173
|
)
|
171
|
-
key = TASK2METRIC[model.task] # task to metric, i.e. metrics/mAP50-95(B) for task=detect
|
172
174
|
metric, speed = results.results_dict[key], results.speed["inference"]
|
173
175
|
fps = round(1000 / (speed + eps), 2) # frames per second
|
174
176
|
y.append([name, "✅", round(file_size(filename), 1), round(metric, 4), round(speed, 2), fps])
|
@@ -14,7 +14,7 @@ except (ImportError, AssertionError):
|
|
14
14
|
|
15
15
|
def on_fit_epoch_end(trainer):
|
16
16
|
"""Sends training metrics to Ray Tune at end of each epoch."""
|
17
|
-
if ray.train._internal.session.
|
17
|
+
if ray.train._internal.session.get_session(): # replacement for deprecated ray.tune.is_session_enabled()
|
18
18
|
metrics = trainer.metrics
|
19
19
|
session.report({**metrics, **{"epoch": trainer.epoch + 1}})
|
20
20
|
|
ultralytics/utils/checks.py
CHANGED
@@ -131,7 +131,7 @@ def check_imgsz(imgsz, stride=32, min_dim=1, max_dim=2, floor=0):
|
|
131
131
|
floor (int): Minimum allowed value for image size.
|
132
132
|
|
133
133
|
Returns:
|
134
|
-
(List[int]): Updated image size.
|
134
|
+
(List[int] | int): Updated image size.
|
135
135
|
"""
|
136
136
|
# Convert stride to integer if it is a tensor
|
137
137
|
stride = int(stride.max() if isinstance(stride, torch.Tensor) else stride)
|
ultralytics/utils/torch_utils.py
CHANGED
@@ -488,8 +488,15 @@ def init_seeds(seed=0, deterministic=False):
|
|
488
488
|
else:
|
489
489
|
LOGGER.warning("WARNING ⚠️ Upgrade to torch>=2.0.0 for deterministic training.")
|
490
490
|
else:
|
491
|
-
|
492
|
-
|
491
|
+
unset_deterministic()
|
492
|
+
|
493
|
+
|
494
|
+
def unset_deterministic():
|
495
|
+
"""Unsets all the configurations applied for deterministic training."""
|
496
|
+
torch.use_deterministic_algorithms(False)
|
497
|
+
torch.backends.cudnn.deterministic = False
|
498
|
+
os.environ.pop("CUBLAS_WORKSPACE_CONFIG", None)
|
499
|
+
os.environ.pop("PYTHONHASHSEED", None)
|
493
500
|
|
494
501
|
|
495
502
|
class ModelEMA:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.74
|
4
4
|
Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
@@ -54,7 +54,6 @@ Requires-Dist: pytest; extra == "dev"
|
|
54
54
|
Requires-Dist: pytest-cov; extra == "dev"
|
55
55
|
Requires-Dist: coverage[toml]; extra == "dev"
|
56
56
|
Requires-Dist: mkdocs>=1.6.0; extra == "dev"
|
57
|
-
Requires-Dist: beautifulsoup4<=4.12.3; extra == "dev"
|
58
57
|
Requires-Dist: mkdocs-material>=9.5.9; extra == "dev"
|
59
58
|
Requires-Dist: mkdocstrings[python]; extra == "dev"
|
60
59
|
Requires-Dist: mkdocs-redirects; extra == "dev"
|
@@ -7,7 +7,7 @@ tests/test_exports.py,sha256=T_z_NUS9URQXv83k5XNLHTuksJ8srtzbZnWuiiQWM98,9260
|
|
7
7
|
tests/test_integrations.py,sha256=p3DMnnPMKsV0Qm82JVJUIY1UZ67xRgF9E8AaL76TEHE,6154
|
8
8
|
tests/test_python.py,sha256=tW-EFJC2rjl_DvAa8khXGWYdypseQjrLjGHhe2p9r9A,23238
|
9
9
|
tests/test_solutions.py,sha256=aY0G3vNzXGCENG9FD76MfUp7jgzeESPsUvbvQYBUvH0,4205
|
10
|
-
ultralytics/__init__.py,sha256=
|
10
|
+
ultralytics/__init__.py,sha256=Qxmv1s_8OG3hItE_vx1c3R_I-L9FUUwE5AKzDsn7d1E,709
|
11
11
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
12
12
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
13
13
|
ultralytics/cfg/__init__.py,sha256=qP44HnFP4QcC5FQz29A-EGTuwdtxXAzPvw_IvCVmiqA,39771
|
@@ -103,10 +103,10 @@ ultralytics/data/split_dota.py,sha256=YI-i2MqdiBt06W67TJnBXQHJrqTnkJDJ3zzoL0UZVr
|
|
103
103
|
ultralytics/data/utils.py,sha256=K8xyA1xHLpaeluUbqOl5fy6AWZ6nDciCBZJofjxzOuw,33841
|
104
104
|
ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
105
105
|
ultralytics/engine/exporter.py,sha256=14zD5klVbAqv1jh2QPmpDcGflBUlLurRhYGM-wH9hFI,76780
|
106
|
-
ultralytics/engine/model.py,sha256=
|
106
|
+
ultralytics/engine/model.py,sha256=8CnLnd_c8Ecey4q2JZFJBbUPOYflr5cgjJnw4sH3Vyo,53382
|
107
107
|
ultralytics/engine/predictor.py,sha256=jiYDAjupOlRUpPvw9tu7or9PjXtLm-YCRiawANtWxj0,17881
|
108
|
-
ultralytics/engine/results.py,sha256=
|
109
|
-
ultralytics/engine/trainer.py,sha256=
|
108
|
+
ultralytics/engine/results.py,sha256=8iHooY3IpBsARBo9LsQJYUfJHlcXk7T7urB3gP6rViU,78120
|
109
|
+
ultralytics/engine/trainer.py,sha256=6LTw_52KBLuaQf6rAn-VQ8702cibBkGoaom-aKMbQrw,37417
|
110
110
|
ultralytics/engine/tuner.py,sha256=EUlTs7KJQ2RVABm8pihr_14M_Z2kGSzJaWH-Y9TJYDw,11976
|
111
111
|
ultralytics/engine/validator.py,sha256=r27X8HGeDEwq7V5sFjEQH_3EnP1CyG-HcOLpFABUisU,15034
|
112
112
|
ultralytics/hub/__init__.py,sha256=1ifzSYV0PIT4ZWOm2V7HnpGyY3G3hCz0malw3AXHFlY,5660
|
@@ -204,10 +204,10 @@ ultralytics/trackers/utils/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6D
|
|
204
204
|
ultralytics/trackers/utils/gmc.py,sha256=kU54RozuGJcAVlyb5_HjXiNIUIX5VuH613AMc6Gdnwg,14597
|
205
205
|
ultralytics/trackers/utils/kalman_filter.py,sha256=OBvemZXptgn9v1sgBLvFomCqOWwjIB3-8wBbc8nakHo,21377
|
206
206
|
ultralytics/trackers/utils/matching.py,sha256=64PKHGoETwXhuZ9udE217hbjJHygLOPaYA66J2qMSno,7130
|
207
|
-
ultralytics/utils/__init__.py,sha256=
|
207
|
+
ultralytics/utils/__init__.py,sha256=7_Kh3l2IBHLE_cM1BXPHgjasa-sRIpqnf_eicQw2RTk,49908
|
208
208
|
ultralytics/utils/autobatch.py,sha256=zc81HlAMArPASEbExty0E_zpITF8PVwin7w-xBFFZ5w,5048
|
209
|
-
ultralytics/utils/benchmarks.py,sha256=
|
210
|
-
ultralytics/utils/checks.py,sha256=
|
209
|
+
ultralytics/utils/benchmarks.py,sha256=enf8emMQ7OcZa6RokvwrNm4ZfW-XS7SBKp57staqGRM,26751
|
210
|
+
ultralytics/utils/checks.py,sha256=Hz7yLxQHqzYJkL3HmGy6nhHLG2eYjwH5B0BK5GXV9a4,31011
|
211
211
|
ultralytics/utils/dist.py,sha256=fuiJQEnyyL-SighlI3hUlZPaaSreUl4Q39snF6OhQtI,2386
|
212
212
|
ultralytics/utils/downloads.py,sha256=aUESyJOE2d7mJwbGECHWLR3RF8HVQPSwNH0cfmLGgdI,21999
|
213
213
|
ultralytics/utils/errors.py,sha256=sXKDEd8ws3L-yIfG_-P_h86axbm37sJNha7kFBJbQMQ,844
|
@@ -219,7 +219,7 @@ ultralytics/utils/ops.py,sha256=HJ33Z9U1_Fl2MJyiv1JKLb2hTmvQqbeNemqR0lbCZgQ,3457
|
|
219
219
|
ultralytics/utils/patches.py,sha256=ARR89dP4YKq7Dd3g2eU-ukbnc2lo3BELukL_1c_d854,3298
|
220
220
|
ultralytics/utils/plotting.py,sha256=hKji4TyxAmCXdSL264VX6dsC2AZYiL9StShI02dcAOM,62990
|
221
221
|
ultralytics/utils/tal.py,sha256=DO-c006HEI62pcrNRpmt4lpqJPC5yu3veRDOvUuExno,18498
|
222
|
-
ultralytics/utils/torch_utils.py,sha256=
|
222
|
+
ultralytics/utils/torch_utils.py,sha256=mhDD-usOKazv5h44ggJ3A2BX3E2ka-N8Sgo4zcsj2f0,33387
|
223
223
|
ultralytics/utils/triton.py,sha256=2L1_rZ8xCJEjexRVj75g9YU-u4tQln_DJ5N1Yr_0bSs,4071
|
224
224
|
ultralytics/utils/tuner.py,sha256=gySDBzTlq_klTOq6CGEyUN58HXzPCulObaMBHacXzHo,6294
|
225
225
|
ultralytics/utils/callbacks/__init__.py,sha256=hzL63Rce6VkZhP4Lcim9LKjadixaQG86nKqPhk7IkS0,242
|
@@ -230,12 +230,12 @@ ultralytics/utils/callbacks/dvc.py,sha256=4ln4wqU3ZZTK5JfvUmbKfQuIdO6QohDSnFVV4v
|
|
230
230
|
ultralytics/utils/callbacks/hub.py,sha256=bqU83kBnNZ0U9qjm0I9xvM4DWA0VMxSLxQDgjuTZbKM,3977
|
231
231
|
ultralytics/utils/callbacks/mlflow.py,sha256=3y4xOPLZe1bES0ETWGJYywulTEUGv8I849e2TNms8yI,5420
|
232
232
|
ultralytics/utils/callbacks/neptune.py,sha256=waZ_bRu0-qBKujTLuqonC2gx2DkgBuVnfqiBNPr7ssY,3841
|
233
|
-
ultralytics/utils/callbacks/raytune.py,sha256=
|
233
|
+
ultralytics/utils/callbacks/raytune.py,sha256=A_NVWjyPNf2m6iB-mbW7SMpyqM9QBvpbPa-MCMFMtdk,727
|
234
234
|
ultralytics/utils/callbacks/tensorboard.py,sha256=JHOEVlNQ5dYJPd4Z-EvqbXowuK5uA0p8wPgyyaIUQs0,4194
|
235
235
|
ultralytics/utils/callbacks/wb.py,sha256=ayhT2y62AcSOacnawshATU0rWrlSFQ77mrGgBdRl3W4,7086
|
236
|
-
ultralytics-8.3.
|
237
|
-
ultralytics-8.3.
|
238
|
-
ultralytics-8.3.
|
239
|
-
ultralytics-8.3.
|
240
|
-
ultralytics-8.3.
|
241
|
-
ultralytics-8.3.
|
236
|
+
ultralytics-8.3.74.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
237
|
+
ultralytics-8.3.74.dist-info/METADATA,sha256=60GpYqC0yL9xkMk7UnjahV3HtaXxBPRWcJAhKkTt3GM,35158
|
238
|
+
ultralytics-8.3.74.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
239
|
+
ultralytics-8.3.74.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
240
|
+
ultralytics-8.3.74.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
241
|
+
ultralytics-8.3.74.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|