ultralytics 8.2.96__py3-none-any.whl → 8.2.97__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/cfg/__init__.py +1 -0
- ultralytics/engine/model.py +5 -17
- ultralytics/hub/session.py +22 -28
- {ultralytics-8.2.96.dist-info → ultralytics-8.2.97.dist-info}/METADATA +1 -1
- {ultralytics-8.2.96.dist-info → ultralytics-8.2.97.dist-info}/RECORD +10 -10
- {ultralytics-8.2.96.dist-info → ultralytics-8.2.97.dist-info}/LICENSE +0 -0
- {ultralytics-8.2.96.dist-info → ultralytics-8.2.97.dist-info}/WHEEL +0 -0
- {ultralytics-8.2.96.dist-info → ultralytics-8.2.97.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.2.96.dist-info → ultralytics-8.2.97.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/cfg/__init__.py
CHANGED
|
@@ -712,6 +712,7 @@ def entrypoint(debug=""):
|
|
|
712
712
|
"cfg": lambda: yaml_print(DEFAULT_CFG_PATH),
|
|
713
713
|
"hub": lambda: handle_yolo_hub(args[1:]),
|
|
714
714
|
"login": lambda: handle_yolo_hub(args),
|
|
715
|
+
"logout": lambda: handle_yolo_hub(args),
|
|
715
716
|
"copy-cfg": copy_default_cfg,
|
|
716
717
|
"explorer": lambda: handle_explorer(args[1:]),
|
|
717
718
|
"streamlit-predict": lambda: handle_streamlit_inference(),
|
ultralytics/engine/model.py
CHANGED
|
@@ -206,33 +206,21 @@ class Model(nn.Module):
|
|
|
206
206
|
Check if the provided model is an Ultralytics HUB model.
|
|
207
207
|
|
|
208
208
|
This static method determines whether the given model string represents a valid Ultralytics HUB model
|
|
209
|
-
identifier.
|
|
210
|
-
or a standalone model ID.
|
|
209
|
+
identifier.
|
|
211
210
|
|
|
212
211
|
Args:
|
|
213
|
-
model (str): The model
|
|
214
|
-
combination, or a standalone model ID.
|
|
212
|
+
model (str): The model string to check.
|
|
215
213
|
|
|
216
214
|
Returns:
|
|
217
215
|
(bool): True if the model is a valid Ultralytics HUB model, False otherwise.
|
|
218
216
|
|
|
219
217
|
Examples:
|
|
220
|
-
>>> Model.is_hub_model("https://hub.ultralytics.com/models/
|
|
218
|
+
>>> Model.is_hub_model("https://hub.ultralytics.com/models/MODEL")
|
|
221
219
|
True
|
|
222
|
-
>>> Model.is_hub_model("
|
|
223
|
-
True
|
|
224
|
-
>>> Model.is_hub_model("example_model_id")
|
|
225
|
-
True
|
|
226
|
-
>>> Model.is_hub_model("not_a_hub_model.pt")
|
|
220
|
+
>>> Model.is_hub_model("yolov8n.pt")
|
|
227
221
|
False
|
|
228
222
|
"""
|
|
229
|
-
return
|
|
230
|
-
(
|
|
231
|
-
model.startswith(f"{HUB_WEB_ROOT}/models/"), # i.e. https://hub.ultralytics.com/models/MODEL_ID
|
|
232
|
-
[len(x) for x in model.split("_")] == [42, 20], # APIKEY_MODEL
|
|
233
|
-
len(model) == 20 and not Path(model).exists() and all(x not in model for x in "./\\"), # MODEL
|
|
234
|
-
)
|
|
235
|
-
)
|
|
223
|
+
return model.startswith(f"{HUB_WEB_ROOT}/models/")
|
|
236
224
|
|
|
237
225
|
def _new(self, cfg: str, task=None, model=None, verbose=False) -> None:
|
|
238
226
|
"""
|
ultralytics/hub/session.py
CHANGED
|
@@ -5,6 +5,7 @@ import threading
|
|
|
5
5
|
import time
|
|
6
6
|
from http import HTTPStatus
|
|
7
7
|
from pathlib import Path
|
|
8
|
+
from urllib.parse import parse_qs, urlparse
|
|
8
9
|
|
|
9
10
|
import requests
|
|
10
11
|
|
|
@@ -77,7 +78,6 @@ class HUBTrainingSession:
|
|
|
77
78
|
if not session.client.authenticated:
|
|
78
79
|
if identifier.startswith(f"{HUB_WEB_ROOT}/models/"):
|
|
79
80
|
LOGGER.warning(f"{PREFIX}WARNING ⚠️ Login to Ultralytics HUB with 'yolo hub login API_KEY'.")
|
|
80
|
-
exit()
|
|
81
81
|
return None
|
|
82
82
|
if args and not identifier.startswith(f"{HUB_WEB_ROOT}/models/"): # not a HUB model URL
|
|
83
83
|
session.create_model(args)
|
|
@@ -96,7 +96,8 @@ class HUBTrainingSession:
|
|
|
96
96
|
self.model_url = f"{HUB_WEB_ROOT}/models/{self.model.id}"
|
|
97
97
|
if self.model.is_trained():
|
|
98
98
|
print(emojis(f"Loading trained HUB model {self.model_url} 🚀"))
|
|
99
|
-
|
|
99
|
+
url = self.model.get_weights_url("best") # download URL with auth
|
|
100
|
+
self.model_file = checks.check_file(url, download_dir=Path(SETTINGS["weights_dir"]) / "hub" / self.model.id)
|
|
100
101
|
return
|
|
101
102
|
|
|
102
103
|
# Set training args and start heartbeats for HUB to monitor agent
|
|
@@ -146,9 +147,8 @@ class HUBTrainingSession:
|
|
|
146
147
|
Parses the given identifier to determine the type of identifier and extract relevant components.
|
|
147
148
|
|
|
148
149
|
The method supports different identifier formats:
|
|
149
|
-
- A HUB URL
|
|
150
|
-
-
|
|
151
|
-
- An identifier that is solely a model ID of a fixed length
|
|
150
|
+
- A HUB model URL https://hub.ultralytics.com/models/MODEL
|
|
151
|
+
- A HUB model URL with API Key https://hub.ultralytics.com/models/MODEL?api_key=APIKEY
|
|
152
152
|
- A local filename that ends with '.pt' or '.yaml'
|
|
153
153
|
|
|
154
154
|
Args:
|
|
@@ -160,32 +160,26 @@ class HUBTrainingSession:
|
|
|
160
160
|
Raises:
|
|
161
161
|
HUBModelError: If the identifier format is not recognized.
|
|
162
162
|
"""
|
|
163
|
-
# Initialize variables
|
|
164
163
|
api_key, model_id, filename = None, None, None
|
|
165
164
|
|
|
166
|
-
#
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
# path = identifier.split(f"{HUB_WEB_ROOT}/models/")[-1]
|
|
166
|
+
# parts = path.split("_")
|
|
167
|
+
# if Path(path).suffix in {".pt", ".yaml"}:
|
|
168
|
+
# filename = path
|
|
169
|
+
# elif len(parts) == 2 and len(parts[0]) == 42 and len(parts[1]) == 20:
|
|
170
|
+
# api_key, model_id = parts
|
|
171
|
+
# elif len(path) == 20:
|
|
172
|
+
# model_id = path
|
|
173
|
+
|
|
174
|
+
if Path(identifier).suffix in {".pt", ".yaml"}:
|
|
175
|
+
filename = identifier
|
|
176
|
+
elif identifier.startswith(f"{HUB_WEB_ROOT}/models/"):
|
|
177
|
+
parsed_url = urlparse(identifier)
|
|
178
|
+
model_id = Path(parsed_url.path).stem # handle possible final backslash robustly
|
|
179
|
+
query_params = parse_qs(parsed_url.query) # dictionary, i.e. {"api_key": ["API_KEY_HERE"]}
|
|
180
|
+
api_key = query_params.get("api_key", [None])[0]
|
|
170
181
|
else:
|
|
171
|
-
|
|
172
|
-
parts = identifier.split("_")
|
|
173
|
-
|
|
174
|
-
# Check if identifier is in the format of API key and model ID
|
|
175
|
-
if len(parts) == 2 and len(parts[0]) == 42 and len(parts[1]) == 20:
|
|
176
|
-
api_key, model_id = parts
|
|
177
|
-
# Check if identifier is a single model ID
|
|
178
|
-
elif len(parts) == 1 and len(parts[0]) == 20:
|
|
179
|
-
model_id = parts[0]
|
|
180
|
-
# Check if identifier is a local filename
|
|
181
|
-
elif identifier.endswith(".pt") or identifier.endswith(".yaml"):
|
|
182
|
-
filename = identifier
|
|
183
|
-
else:
|
|
184
|
-
raise HUBModelError(
|
|
185
|
-
f"model='{identifier}' could not be parsed. Check format is correct. "
|
|
186
|
-
f"Supported formats are Ultralytics HUB URL, apiKey_modelId, modelId, local pt or yaml file."
|
|
187
|
-
)
|
|
188
|
-
|
|
182
|
+
raise HUBModelError(f"model='{identifier} invalid, correct format is {HUB_WEB_ROOT}/models/MODEL_ID")
|
|
189
183
|
return api_key, model_id, filename
|
|
190
184
|
|
|
191
185
|
def _set_train_args(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.97
|
|
4
4
|
Summary: Ultralytics YOLO 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
|
|
@@ -8,10 +8,10 @@ tests/test_exports.py,sha256=Uezf3OatpPHlo5qoPw-2kqkZxuMCF9L4XF2riD4vmII,8225
|
|
|
8
8
|
tests/test_integrations.py,sha256=xglcfMPjfVh346PV8WTpk6tBxraCXEFJEQyyJMr5tyU,6064
|
|
9
9
|
tests/test_python.py,sha256=vkA0F9XgOSpU1BxI2Lzq69f6g-vi8PtOfmb_7P96ZUk,23560
|
|
10
10
|
tests/test_solutions.py,sha256=p_2edhl96Ty3jwzSf02Q2m2mTu9skc0Z-eMcUuuXfLg,3300
|
|
11
|
-
ultralytics/__init__.py,sha256=
|
|
11
|
+
ultralytics/__init__.py,sha256=4ko8wqP19EM9zJljwbpzSwRQRNGDBUI_jSGHJg5rmD0,695
|
|
12
12
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
13
13
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
14
|
-
ultralytics/cfg/__init__.py,sha256=
|
|
14
|
+
ultralytics/cfg/__init__.py,sha256=7FFk0HG4AvAre9CV70QMTtx1h74pSiNSJaxKSiuFkSo,33138
|
|
15
15
|
ultralytics/cfg/default.yaml,sha256=xRKVF-Z9E3imXTU9OCK94kj3jGgYoo67VJQwuYlHiUU,8228
|
|
16
16
|
ultralytics/cfg/datasets/Argoverse.yaml,sha256=FyeuJT5CHq_9d4hlfAf0kpZlnbUMO0S--UJ1yIqcdKk,3134
|
|
17
17
|
ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=QVfp_Qp-4rukuicaB4qx86NxSHM8Mrzym8l_fIDo8gw,1195
|
|
@@ -99,7 +99,7 @@ ultralytics/data/explorer/gui/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2
|
|
|
99
99
|
ultralytics/data/explorer/gui/dash.py,sha256=vZ476NaUH4FKU08rAJ1K9WNyKtg0soMyJJxqg176yWc,10498
|
|
100
100
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
101
101
|
ultralytics/engine/exporter.py,sha256=MtBFbJp3ifhn9sQXuQb7vxxOmtS_SOw7lnQhrq4H42c,57078
|
|
102
|
-
ultralytics/engine/model.py,sha256=
|
|
102
|
+
ultralytics/engine/model.py,sha256=1sWOBvLL2JIH8JuHoxwvr1MPfKFww0ORyLESx3Fs2c8,51582
|
|
103
103
|
ultralytics/engine/predictor.py,sha256=MgMWHUJdRcVCaVmOyvdy2Gjk_EyRHv-ar0SSGxQe8F4,17471
|
|
104
104
|
ultralytics/engine/results.py,sha256=8RJlN8J-_9w-mrDZm9wC-DZJTPBS7v1c_r_R173QyRM,75043
|
|
105
105
|
ultralytics/engine/trainer.py,sha256=VOuR9WpDgYILevpWnWAtKLEIcJ4iFG41HxOCSbOy0YA,36657
|
|
@@ -107,7 +107,7 @@ ultralytics/engine/tuner.py,sha256=gPqDTHH7vRB2O3YyH26m1BjVKbXxuA2XAlPRzTKFZsc,1
|
|
|
107
107
|
ultralytics/engine/validator.py,sha256=483Ad87Irk7IBlJNLu2SQAJsb7YriALTX9GIgriCmRg,14650
|
|
108
108
|
ultralytics/hub/__init__.py,sha256=AM_twjV9ouUmyxh3opoPgTqDpMOd8xIOHsAKdWS2L18,5663
|
|
109
109
|
ultralytics/hub/auth.py,sha256=kDLakGa2NbzvMAeXc2UdzZ65r0AH-XeM_JfsDY97WGk,5545
|
|
110
|
-
ultralytics/hub/session.py,sha256=
|
|
110
|
+
ultralytics/hub/session.py,sha256=ivTJpGEKEi7F55RloWN-Ks6oeB3ll74AWGAsBtAQOPM,16715
|
|
111
111
|
ultralytics/hub/utils.py,sha256=I7NATG6O_QRw7EU7EHkdTVvbCkwKCyUe54BP60To_so,9715
|
|
112
112
|
ultralytics/hub/google/__init__.py,sha256=uclNs-_5vAzQMgQKgl8eBvml1cx6IZYXRUhrF57v6_k,7504
|
|
113
113
|
ultralytics/models/__init__.py,sha256=TT9iLCL_n9Y80dcUq0Fo-p-GRZCSU2vrWXM3CoMwqqE,265
|
|
@@ -225,9 +225,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyz
|
|
|
225
225
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
|
226
226
|
ultralytics/utils/callbacks/tensorboard.py,sha256=0kn4IR10no99UCIheojWRujgybmUHSx5fPI6Vsq6l_g,4135
|
|
227
227
|
ultralytics/utils/callbacks/wb.py,sha256=9-fjQIdLjr3b73DTE3rHO171KvbH1VweJ-bmbv-rqTw,6747
|
|
228
|
-
ultralytics-8.2.
|
|
229
|
-
ultralytics-8.2.
|
|
230
|
-
ultralytics-8.2.
|
|
231
|
-
ultralytics-8.2.
|
|
232
|
-
ultralytics-8.2.
|
|
233
|
-
ultralytics-8.2.
|
|
228
|
+
ultralytics-8.2.97.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
229
|
+
ultralytics-8.2.97.dist-info/METADATA,sha256=ZXllOjVWz8Z_-O8l8U7EAIr7Hy32uYtPLoMpa9-Vbs0,39504
|
|
230
|
+
ultralytics-8.2.97.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
231
|
+
ultralytics-8.2.97.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
232
|
+
ultralytics-8.2.97.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
233
|
+
ultralytics-8.2.97.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|