ultralytics 8.2.85__py3-none-any.whl → 8.2.86__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.
- tests/test_python.py +2 -0
- ultralytics/__init__.py +1 -1
- ultralytics/data/converter.py +1 -1
- ultralytics/data/dataset.py +1 -1
- ultralytics/data/split_dota.py +1 -1
- ultralytics/engine/exporter.py +9 -45
- ultralytics/engine/predictor.py +1 -1
- ultralytics/engine/validator.py +3 -2
- ultralytics/hub/utils.py +8 -9
- ultralytics/models/fastsam/predict.py +1 -1
- ultralytics/models/sam/modules/blocks.py +1 -1
- ultralytics/nn/modules/block.py +2 -2
- ultralytics/solutions/parking_management.py +1 -1
- ultralytics/utils/benchmarks.py +3 -3
- ultralytics/utils/checks.py +11 -0
- ultralytics/utils/metrics.py +1 -1
- ultralytics/utils/torch_utils.py +7 -0
- {ultralytics-8.2.85.dist-info → ultralytics-8.2.86.dist-info}/METADATA +2 -1
- {ultralytics-8.2.85.dist-info → ultralytics-8.2.86.dist-info}/RECORD +23 -23
- {ultralytics-8.2.85.dist-info → ultralytics-8.2.86.dist-info}/LICENSE +0 -0
- {ultralytics-8.2.85.dist-info → ultralytics-8.2.86.dist-info}/WHEEL +0 -0
- {ultralytics-8.2.85.dist-info → ultralytics-8.2.86.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.2.85.dist-info → ultralytics-8.2.86.dist-info}/top_level.txt +0 -0
tests/test_python.py
CHANGED
|
@@ -252,6 +252,8 @@ def test_labels_and_crops():
|
|
|
252
252
|
for r in results:
|
|
253
253
|
im_name = Path(r.path).stem
|
|
254
254
|
cls_idxs = r.boxes.cls.int().tolist()
|
|
255
|
+
# Check correct detections
|
|
256
|
+
assert cls_idxs == ([0, 0, 5, 0, 7] if r.path.endswith("bus.jpg") else [0, 0]) # bus.jpg and zidane.jpg classes
|
|
255
257
|
# Check label path
|
|
256
258
|
labels = save_path / f"labels/{im_name}.txt"
|
|
257
259
|
assert labels.exists()
|
ultralytics/__init__.py
CHANGED
ultralytics/data/converter.py
CHANGED
|
@@ -490,7 +490,7 @@ def convert_dota_to_yolo_obb(dota_root_path: str):
|
|
|
490
490
|
normalized_coords = [
|
|
491
491
|
coords[i] / image_width if i % 2 == 0 else coords[i] / image_height for i in range(8)
|
|
492
492
|
]
|
|
493
|
-
formatted_coords = ["{:.6g}"
|
|
493
|
+
formatted_coords = [f"{coord:.6g}" for coord in normalized_coords]
|
|
494
494
|
g.write(f"{class_idx} {' '.join(formatted_coords)}\n")
|
|
495
495
|
|
|
496
496
|
for phase in ["train", "val"]:
|
ultralytics/data/dataset.py
CHANGED
|
@@ -296,7 +296,7 @@ class GroundingDataset(YOLODataset):
|
|
|
296
296
|
"""Loads annotations from a JSON file, filters, and normalizes bounding boxes for each image."""
|
|
297
297
|
labels = []
|
|
298
298
|
LOGGER.info("Loading annotation file...")
|
|
299
|
-
with open(self.json_file
|
|
299
|
+
with open(self.json_file) as f:
|
|
300
300
|
annotations = json.load(f)
|
|
301
301
|
images = {f'{x["id"]:d}': x for x in annotations["images"]}
|
|
302
302
|
img_to_anns = defaultdict(list)
|
ultralytics/data/split_dota.py
CHANGED
|
@@ -193,7 +193,7 @@ def crop_and_save(anno, windows, window_objs, im_dir, lb_dir, allow_background_i
|
|
|
193
193
|
|
|
194
194
|
with open(Path(lb_dir) / f"{new_name}.txt", "w") as f:
|
|
195
195
|
for lb in label:
|
|
196
|
-
formatted_coords = ["{:.6g}"
|
|
196
|
+
formatted_coords = [f"{coord:.6g}" for coord in lb[1:]]
|
|
197
197
|
f.write(f"{int(lb[0])} {' '.join(formatted_coords)}\n")
|
|
198
198
|
|
|
199
199
|
|
ultralytics/engine/exporter.py
CHANGED
|
@@ -138,7 +138,7 @@ def try_export(inner_func):
|
|
|
138
138
|
LOGGER.info(f"{prefix} export success ✅ {dt.t:.1f}s, saved as '{f}' ({file_size(f):.1f} MB)")
|
|
139
139
|
return f, model
|
|
140
140
|
except Exception as e:
|
|
141
|
-
LOGGER.
|
|
141
|
+
LOGGER.error(f"{prefix} export failure ❌ {dt.t:.1f}s: {e}")
|
|
142
142
|
raise e
|
|
143
143
|
|
|
144
144
|
return outer_func
|
|
@@ -204,9 +204,8 @@ class Exporter:
|
|
|
204
204
|
self.args.half = False
|
|
205
205
|
assert not self.args.dynamic, "half=True not compatible with dynamic=True, i.e. use only one."
|
|
206
206
|
self.imgsz = check_imgsz(self.args.imgsz, stride=model.stride, min_dim=2) # check image size
|
|
207
|
-
if self.args.int8 and
|
|
208
|
-
self.args.dynamic = True # enforce dynamic to export TensorRT INT8
|
|
209
|
-
LOGGER.warning("WARNING ⚠️ INT8 export requires dynamic image sizes, setting dynamic=True.")
|
|
207
|
+
if self.args.int8 and engine:
|
|
208
|
+
self.args.dynamic = True # enforce dynamic to export TensorRT INT8
|
|
210
209
|
if self.args.optimize:
|
|
211
210
|
assert not ncnn, "optimize=True not compatible with format='ncnn', i.e. use optimize=False"
|
|
212
211
|
assert self.device.type == "cpu", "optimize=True not compatible with cuda devices, i.e. use device='cpu'"
|
|
@@ -355,18 +354,20 @@ class Exporter:
|
|
|
355
354
|
"""Build and return a dataloader suitable for calibration of INT8 models."""
|
|
356
355
|
LOGGER.info(f"{prefix} collecting INT8 calibration images from 'data={self.args.data}'")
|
|
357
356
|
data = (check_cls_dataset if self.model.task == "classify" else check_det_dataset)(self.args.data)
|
|
357
|
+
# TensorRT INT8 calibration should use 2x batch size
|
|
358
|
+
batch = self.args.batch * (2 if self.args.format == "engine" else 1)
|
|
358
359
|
dataset = YOLODataset(
|
|
359
360
|
data[self.args.split or "val"],
|
|
360
361
|
data=data,
|
|
361
362
|
task=self.model.task,
|
|
362
363
|
imgsz=self.imgsz[0],
|
|
363
364
|
augment=False,
|
|
364
|
-
batch_size=
|
|
365
|
+
batch_size=batch,
|
|
365
366
|
)
|
|
366
367
|
n = len(dataset)
|
|
367
368
|
if n < 300:
|
|
368
369
|
LOGGER.warning(f"{prefix} WARNING ⚠️ >300 images recommended for INT8 calibration, found {n} images.")
|
|
369
|
-
return build_dataloader(dataset, batch=
|
|
370
|
+
return build_dataloader(dataset, batch=batch, workers=0) # required for batch loading
|
|
370
371
|
|
|
371
372
|
@try_export
|
|
372
373
|
def export_torchscript(self, prefix=colorstr("TorchScript:")):
|
|
@@ -422,7 +423,6 @@ class Exporter:
|
|
|
422
423
|
|
|
423
424
|
# Checks
|
|
424
425
|
model_onnx = onnx.load(f) # load onnx model
|
|
425
|
-
# onnx.checker.check_model(model_onnx) # check onnx model
|
|
426
426
|
|
|
427
427
|
# Simplify
|
|
428
428
|
if self.args.simplify:
|
|
@@ -432,10 +432,6 @@ class Exporter:
|
|
|
432
432
|
LOGGER.info(f"{prefix} slimming with onnxslim {onnxslim.__version__}...")
|
|
433
433
|
model_onnx = onnxslim.slim(model_onnx)
|
|
434
434
|
|
|
435
|
-
# ONNX Simplifier (deprecated as must be compiled with 'cmake' in aarch64 and Conda CI environments)
|
|
436
|
-
# import onnxsim
|
|
437
|
-
# model_onnx, check = onnxsim.simplify(model_onnx)
|
|
438
|
-
# assert check, "Simplified ONNX model could not be validated"
|
|
439
435
|
except Exception as e:
|
|
440
436
|
LOGGER.warning(f"{prefix} simplifier failure: {e}")
|
|
441
437
|
|
|
@@ -679,7 +675,6 @@ class Exporter:
|
|
|
679
675
|
def export_engine(self, prefix=colorstr("TensorRT:")):
|
|
680
676
|
"""YOLOv8 TensorRT export https://developer.nvidia.com/tensorrt."""
|
|
681
677
|
assert self.im.device.type != "cpu", "export running on CPU but must be on GPU, i.e. use 'device=0'"
|
|
682
|
-
# self.args.simplify = True
|
|
683
678
|
f_onnx, _ = self.export_onnx() # run before TRT import https://github.com/ultralytics/ultralytics/issues/7016
|
|
684
679
|
|
|
685
680
|
try:
|
|
@@ -786,7 +781,7 @@ class Exporter:
|
|
|
786
781
|
# Load dataset w/ builder (for batching) and calibrate
|
|
787
782
|
config.int8_calibrator = EngineCalibrator(
|
|
788
783
|
dataset=self.get_int8_calibration_dataloader(prefix),
|
|
789
|
-
batch=2 * self.args.batch,
|
|
784
|
+
batch=2 * self.args.batch, # TensorRT INT8 calibration should use 2x batch size
|
|
790
785
|
cache=str(self.file.with_suffix(".cache")),
|
|
791
786
|
)
|
|
792
787
|
|
|
@@ -869,8 +864,6 @@ class Exporter:
|
|
|
869
864
|
f.mkdir()
|
|
870
865
|
images = [batch["img"].permute(0, 2, 3, 1) for batch in self.get_int8_calibration_dataloader(prefix)]
|
|
871
866
|
images = torch.cat(images, 0).float()
|
|
872
|
-
# mean = images.view(-1, 3).mean(0) # imagenet mean [123.675, 116.28, 103.53]
|
|
873
|
-
# std = images.view(-1, 3).std(0) # imagenet std [58.395, 57.12, 57.375]
|
|
874
867
|
np.save(str(tmp_file), images.numpy().astype(np.float32)) # BHWC
|
|
875
868
|
np_data = [["images", tmp_file, [[[[0, 0, 0]]]], [[[[255, 255, 255]]]]]]
|
|
876
869
|
else:
|
|
@@ -998,20 +991,7 @@ class Exporter:
|
|
|
998
991
|
if " " in f:
|
|
999
992
|
LOGGER.warning(f"{prefix} WARNING ⚠️ your model may not work correctly with spaces in path '{f}'.")
|
|
1000
993
|
|
|
1001
|
-
#
|
|
1002
|
-
# with open(f_json, 'w') as j: # sort JSON Identity_* in ascending order
|
|
1003
|
-
# subst = re.sub(
|
|
1004
|
-
# r'{"outputs": {"Identity.?.?": {"name": "Identity.?.?"}, '
|
|
1005
|
-
# r'"Identity.?.?": {"name": "Identity.?.?"}, '
|
|
1006
|
-
# r'"Identity.?.?": {"name": "Identity.?.?"}, '
|
|
1007
|
-
# r'"Identity.?.?": {"name": "Identity.?.?"}}}',
|
|
1008
|
-
# r'{"outputs": {"Identity": {"name": "Identity"}, '
|
|
1009
|
-
# r'"Identity_1": {"name": "Identity_1"}, '
|
|
1010
|
-
# r'"Identity_2": {"name": "Identity_2"}, '
|
|
1011
|
-
# r'"Identity_3": {"name": "Identity_3"}}}',
|
|
1012
|
-
# f_json.read_text(),
|
|
1013
|
-
# )
|
|
1014
|
-
# j.write(subst)
|
|
994
|
+
# Add metadata
|
|
1015
995
|
yaml_save(Path(f) / "metadata.yaml", self.metadata) # add metadata.yaml
|
|
1016
996
|
return f, None
|
|
1017
997
|
|
|
@@ -1104,27 +1084,11 @@ class Exporter:
|
|
|
1104
1084
|
names = self.metadata["names"]
|
|
1105
1085
|
nx, ny = spec.description.input[0].type.imageType.width, spec.description.input[0].type.imageType.height
|
|
1106
1086
|
_, nc = out0_shape # number of anchors, number of classes
|
|
1107
|
-
# _, nc = out0.type.multiArrayType.shape
|
|
1108
1087
|
assert len(names) == nc, f"{len(names)} names found for nc={nc}" # check
|
|
1109
1088
|
|
|
1110
1089
|
# Define output shapes (missing)
|
|
1111
1090
|
out0.type.multiArrayType.shape[:] = out0_shape # (3780, 80)
|
|
1112
1091
|
out1.type.multiArrayType.shape[:] = out1_shape # (3780, 4)
|
|
1113
|
-
# spec.neuralNetwork.preprocessing[0].featureName = '0'
|
|
1114
|
-
|
|
1115
|
-
# Flexible input shapes
|
|
1116
|
-
# from coremltools.models.neural_network import flexible_shape_utils
|
|
1117
|
-
# s = [] # shapes
|
|
1118
|
-
# s.append(flexible_shape_utils.NeuralNetworkImageSize(320, 192))
|
|
1119
|
-
# s.append(flexible_shape_utils.NeuralNetworkImageSize(640, 384)) # (height, width)
|
|
1120
|
-
# flexible_shape_utils.add_enumerated_image_sizes(spec, feature_name='image', sizes=s)
|
|
1121
|
-
# r = flexible_shape_utils.NeuralNetworkImageSizeRange() # shape ranges
|
|
1122
|
-
# r.add_height_range((192, 640))
|
|
1123
|
-
# r.add_width_range((192, 640))
|
|
1124
|
-
# flexible_shape_utils.update_image_size_range(spec, feature_name='image', size_range=r)
|
|
1125
|
-
|
|
1126
|
-
# Print
|
|
1127
|
-
# print(spec.description)
|
|
1128
1092
|
|
|
1129
1093
|
# Model from spec
|
|
1130
1094
|
model = ct.models.MLModel(spec, weights_dir=weights_dir)
|
ultralytics/engine/predictor.py
CHANGED
|
@@ -328,7 +328,7 @@ class BasePredictor:
|
|
|
328
328
|
frame = int(match[1]) if match else None # 0 if frame undetermined
|
|
329
329
|
|
|
330
330
|
self.txt_path = self.save_dir / "labels" / (p.stem + ("" if self.dataset.mode == "image" else f"_{frame}"))
|
|
331
|
-
string += "
|
|
331
|
+
string += "{:g}x{:g} ".format(*im.shape[2:])
|
|
332
332
|
result = self.results[i]
|
|
333
333
|
result.save_dir = self.save_dir.__str__() # used in other locations
|
|
334
334
|
string += f"{result.verbose()}{result.speed['inference']:.1f}ms"
|
ultralytics/engine/validator.py
CHANGED
|
@@ -202,8 +202,9 @@ class BaseValidator:
|
|
|
202
202
|
return {k: round(float(v), 5) for k, v in results.items()} # return results as 5 decimal place floats
|
|
203
203
|
else:
|
|
204
204
|
LOGGER.info(
|
|
205
|
-
"Speed:
|
|
206
|
-
|
|
205
|
+
"Speed: {:.1f}ms preprocess, {:.1f}ms inference, {:.1f}ms loss, {:.1f}ms postprocess per image".format(
|
|
206
|
+
*tuple(self.speed.values())
|
|
207
|
+
)
|
|
207
208
|
)
|
|
208
209
|
if self.args.save_json and self.jdict:
|
|
209
210
|
with open(str(self.save_dir / "predictions.json"), "w") as f:
|
ultralytics/hub/utils.py
CHANGED
|
@@ -55,23 +55,22 @@ def request_with_credentials(url: str) -> any:
|
|
|
55
55
|
|
|
56
56
|
display.display(
|
|
57
57
|
display.Javascript(
|
|
58
|
-
"""
|
|
59
|
-
window._hub_tmp = new Promise((resolve, reject) => {
|
|
58
|
+
f"""
|
|
59
|
+
window._hub_tmp = new Promise((resolve, reject) => {{
|
|
60
60
|
const timeout = setTimeout(() => reject("Failed authenticating existing browser session"), 5000)
|
|
61
|
-
fetch("
|
|
61
|
+
fetch("{url}", {{
|
|
62
62
|
method: 'POST',
|
|
63
63
|
credentials: 'include'
|
|
64
|
-
})
|
|
64
|
+
}})
|
|
65
65
|
.then((response) => resolve(response.json()))
|
|
66
|
-
.then((json) => {
|
|
66
|
+
.then((json) => {{
|
|
67
67
|
clearTimeout(timeout);
|
|
68
|
-
}).catch((err) => {
|
|
68
|
+
}}).catch((err) => {{
|
|
69
69
|
clearTimeout(timeout);
|
|
70
70
|
reject(err);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
71
|
+
}});
|
|
72
|
+
}});
|
|
73
73
|
"""
|
|
74
|
-
% url
|
|
75
74
|
)
|
|
76
75
|
)
|
|
77
76
|
return output.eval_js("_hub_tmp")
|
|
@@ -100,7 +100,7 @@ class FastSAMPredictor(SegmentationPredictor):
|
|
|
100
100
|
texts = [texts]
|
|
101
101
|
crop_ims, filter_idx = [], []
|
|
102
102
|
for i, b in enumerate(result.boxes.xyxy.tolist()):
|
|
103
|
-
x1, y1, x2, y2 =
|
|
103
|
+
x1, y1, x2, y2 = (int(x) for x in b)
|
|
104
104
|
if masks[i].sum() <= 100:
|
|
105
105
|
filter_idx.append(i)
|
|
106
106
|
continue
|
|
@@ -35,7 +35,7 @@ class DropPath(nn.Module):
|
|
|
35
35
|
|
|
36
36
|
def __init__(self, drop_prob=0.0, scale_by_keep=True):
|
|
37
37
|
"""Initialize DropPath module for stochastic depth regularization during training."""
|
|
38
|
-
super(
|
|
38
|
+
super().__init__()
|
|
39
39
|
self.drop_prob = drop_prob
|
|
40
40
|
self.scale_by_keep = scale_by_keep
|
|
41
41
|
|
ultralytics/nn/modules/block.py
CHANGED
|
@@ -672,7 +672,7 @@ class CBLinear(nn.Module):
|
|
|
672
672
|
|
|
673
673
|
def __init__(self, c1, c2s, k=1, s=1, p=None, g=1):
|
|
674
674
|
"""Initializes the CBLinear module, passing inputs unchanged."""
|
|
675
|
-
super(
|
|
675
|
+
super().__init__()
|
|
676
676
|
self.c2s = c2s
|
|
677
677
|
self.conv = nn.Conv2d(c1, sum(c2s), k, s, autopad(k, p), groups=g, bias=True)
|
|
678
678
|
|
|
@@ -686,7 +686,7 @@ class CBFuse(nn.Module):
|
|
|
686
686
|
|
|
687
687
|
def __init__(self, idx):
|
|
688
688
|
"""Initializes CBFuse module with layer index for selective feature fusion."""
|
|
689
|
-
super(
|
|
689
|
+
super().__init__()
|
|
690
690
|
self.idx = idx
|
|
691
691
|
|
|
692
692
|
def forward(self, xs):
|
|
@@ -210,7 +210,7 @@ class ParkingManagement:
|
|
|
210
210
|
Args:
|
|
211
211
|
json_file (str): file that have all parking slot points
|
|
212
212
|
"""
|
|
213
|
-
with open(json_file
|
|
213
|
+
with open(json_file) as f:
|
|
214
214
|
return json.load(f)
|
|
215
215
|
|
|
216
216
|
def process_data(self, json_data, im0, boxes, clss):
|
ultralytics/utils/benchmarks.py
CHANGED
|
@@ -198,7 +198,7 @@ class RF100Benchmark:
|
|
|
198
198
|
os.mkdir("ultralytics-benchmarks")
|
|
199
199
|
safe_download("https://github.com/ultralytics/assets/releases/download/v0.0.0/datasets_links.txt")
|
|
200
200
|
|
|
201
|
-
with open(ds_link_txt
|
|
201
|
+
with open(ds_link_txt) as file:
|
|
202
202
|
for line in file:
|
|
203
203
|
try:
|
|
204
204
|
_, url, workspace, project, version = re.split("/+", line.strip())
|
|
@@ -222,7 +222,7 @@ class RF100Benchmark:
|
|
|
222
222
|
Args:
|
|
223
223
|
path (str): YAML file path.
|
|
224
224
|
"""
|
|
225
|
-
with open(path
|
|
225
|
+
with open(path) as file:
|
|
226
226
|
yaml_data = yaml.safe_load(file)
|
|
227
227
|
yaml_data["train"] = "train/images"
|
|
228
228
|
yaml_data["val"] = "valid/images"
|
|
@@ -242,7 +242,7 @@ class RF100Benchmark:
|
|
|
242
242
|
skip_symbols = ["🚀", "⚠️", "💡", "❌"]
|
|
243
243
|
with open(yaml_path) as stream:
|
|
244
244
|
class_names = yaml.safe_load(stream)["names"]
|
|
245
|
-
with open(val_log_file,
|
|
245
|
+
with open(val_log_file, encoding="utf-8") as f:
|
|
246
246
|
lines = f.readlines()
|
|
247
247
|
eval_lines = []
|
|
248
248
|
for line in lines:
|
ultralytics/utils/checks.py
CHANGED
|
@@ -29,11 +29,13 @@ from ultralytics.utils import (
|
|
|
29
29
|
IS_PIP_PACKAGE,
|
|
30
30
|
LINUX,
|
|
31
31
|
LOGGER,
|
|
32
|
+
MACOS,
|
|
32
33
|
ONLINE,
|
|
33
34
|
PYTHON_VERSION,
|
|
34
35
|
ROOT,
|
|
35
36
|
TORCHVISION_VERSION,
|
|
36
37
|
USER_CONFIG_DIR,
|
|
38
|
+
WINDOWS,
|
|
37
39
|
Retry,
|
|
38
40
|
SimpleNamespace,
|
|
39
41
|
ThreadingLocked,
|
|
@@ -224,6 +226,14 @@ def check_version(
|
|
|
224
226
|
if not required: # if required is '' or None
|
|
225
227
|
return True
|
|
226
228
|
|
|
229
|
+
if "sys_platform" in required: # i.e. required='<2.4.0,>=1.8.0; sys_platform == "win32"'
|
|
230
|
+
if (
|
|
231
|
+
(WINDOWS and "win32" not in required)
|
|
232
|
+
or (LINUX and "linux" not in required)
|
|
233
|
+
or (MACOS and "macos" not in required and "darwin" not in required)
|
|
234
|
+
):
|
|
235
|
+
return True
|
|
236
|
+
|
|
227
237
|
op = ""
|
|
228
238
|
version = ""
|
|
229
239
|
result = True
|
|
@@ -422,6 +432,7 @@ def check_torchvision():
|
|
|
422
432
|
"""
|
|
423
433
|
# Compatibility table
|
|
424
434
|
compatibility_table = {
|
|
435
|
+
"2.4": ["0.19"],
|
|
425
436
|
"2.3": ["0.18"],
|
|
426
437
|
"2.2": ["0.17"],
|
|
427
438
|
"2.1": ["0.16"],
|
ultralytics/utils/metrics.py
CHANGED
|
@@ -460,7 +460,7 @@ def plot_pr_curve(px, py, ap, save_dir=Path("pr_curve.png"), names={}, on_plot=N
|
|
|
460
460
|
else:
|
|
461
461
|
ax.plot(px, py, linewidth=1, color="grey") # plot(recall, precision)
|
|
462
462
|
|
|
463
|
-
ax.plot(px, py.mean(1), linewidth=3, color="blue", label="all classes
|
|
463
|
+
ax.plot(px, py.mean(1), linewidth=3, color="blue", label=f"all classes {ap[:, 0].mean():.3f} mAP@0.5")
|
|
464
464
|
ax.set_xlabel("Recall")
|
|
465
465
|
ax.set_ylabel("Precision")
|
|
466
466
|
ax.set_xlim(0, 1)
|
ultralytics/utils/torch_utils.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
|
+
|
|
2
3
|
import contextlib
|
|
3
4
|
import gc
|
|
4
5
|
import math
|
|
@@ -24,6 +25,7 @@ from ultralytics.utils import (
|
|
|
24
25
|
NUM_THREADS,
|
|
25
26
|
PYTHON_VERSION,
|
|
26
27
|
TORCHVISION_VERSION,
|
|
28
|
+
WINDOWS,
|
|
27
29
|
__version__,
|
|
28
30
|
colorstr,
|
|
29
31
|
)
|
|
@@ -42,6 +44,11 @@ TORCHVISION_0_10 = check_version(TORCHVISION_VERSION, "0.10.0")
|
|
|
42
44
|
TORCHVISION_0_11 = check_version(TORCHVISION_VERSION, "0.11.0")
|
|
43
45
|
TORCHVISION_0_13 = check_version(TORCHVISION_VERSION, "0.13.0")
|
|
44
46
|
TORCHVISION_0_18 = check_version(TORCHVISION_VERSION, "0.18.0")
|
|
47
|
+
if WINDOWS and torch.__version__[:3] == "2.4": # reject all versions of 2.4 on Windows
|
|
48
|
+
LOGGER.warning(
|
|
49
|
+
"WARNING ⚠️ Known issue with torch>=2.4.0 on Windows with CPU, recommend downgrading to torch<=2.3.1 to resolve "
|
|
50
|
+
"https://github.com/ultralytics/ultralytics/issues/15049"
|
|
51
|
+
)
|
|
45
52
|
|
|
46
53
|
|
|
47
54
|
@contextmanager
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.86
|
|
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
|
|
@@ -45,6 +45,7 @@ Requires-Dist: py-cpuinfo
|
|
|
45
45
|
Requires-Dist: pandas>=1.1.4
|
|
46
46
|
Requires-Dist: seaborn>=0.11.0
|
|
47
47
|
Requires-Dist: ultralytics-thop>=2.0.0
|
|
48
|
+
Requires-Dist: torch<2.4.0,>=1.8.0; sys_platform == "win32"
|
|
48
49
|
Provides-Extra: dev
|
|
49
50
|
Requires-Dist: ipython; extra == "dev"
|
|
50
51
|
Requires-Dist: pytest; extra == "dev"
|
|
@@ -6,9 +6,9 @@ tests/test_engine.py,sha256=xW-UT9_9xZp-7-hSnbJgMw_ezTk6NqTOIiA59XZDmxA,4934
|
|
|
6
6
|
tests/test_explorer.py,sha256=IMFvZ9uMoEXVC5FwdaVh0821wBgs7muVF6aw1F-auAI,2572
|
|
7
7
|
tests/test_exports.py,sha256=Uezf3OatpPHlo5qoPw-2kqkZxuMCF9L4XF2riD4vmII,8225
|
|
8
8
|
tests/test_integrations.py,sha256=xglcfMPjfVh346PV8WTpk6tBxraCXEFJEQyyJMr5tyU,6064
|
|
9
|
-
tests/test_python.py,sha256=
|
|
9
|
+
tests/test_python.py,sha256=Vp12KbLg9IVBwArpRDrz-QzJPzA9tCU4JfDYneIKSc8,22083
|
|
10
10
|
tests/test_solutions.py,sha256=p_2edhl96Ty3jwzSf02Q2m2mTu9skc0Z-eMcUuuXfLg,3300
|
|
11
|
-
ultralytics/__init__.py,sha256=
|
|
11
|
+
ultralytics/__init__.py,sha256=Rq9UcU73XGzKW_l8nWeEaQbjoL8Vp6PnGukO_XZCJ-E,694
|
|
12
12
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
13
13
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
14
14
|
ultralytics/cfg/__init__.py,sha256=pkB7wk0pHOA3xzKzMbS-hA0iJoPOWVNnwZJh0LuWh-w,33089
|
|
@@ -87,10 +87,10 @@ ultralytics/data/annotator.py,sha256=PniOxH2MScWKp539vuufk69uG1JsltDB5OMCUhxn2QY
|
|
|
87
87
|
ultralytics/data/augment.py,sha256=RbFhBQQrE9TazD2MmRPP60HKL3yhkRG0e0VMWbrKe3I,119270
|
|
88
88
|
ultralytics/data/base.py,sha256=HK-YZOStAkD8hVHhfBetH-Q_CWfEfuyPvv_gYwxULzY,13527
|
|
89
89
|
ultralytics/data/build.py,sha256=AfMmz0sHIYmwry_90tEJFRk_kz0S3SolScVXqYHiT08,7261
|
|
90
|
-
ultralytics/data/converter.py,sha256=
|
|
91
|
-
ultralytics/data/dataset.py,sha256=
|
|
90
|
+
ultralytics/data/converter.py,sha256=uWOTPDduRBm5k-jO6G4yITFgPuPTRQ3pRv1tVWL-gGA,21493
|
|
91
|
+
ultralytics/data/dataset.py,sha256=IS07ulk7rXPZ-SW_rjYF9mS-TxPXOY9bbo5jqfcwPqM,22874
|
|
92
92
|
ultralytics/data/loaders.py,sha256=JF2Z_ESK6RweavOuYWejYSGJwmqINb5hNwwCb3AAf0M,24094
|
|
93
|
-
ultralytics/data/split_dota.py,sha256=
|
|
93
|
+
ultralytics/data/split_dota.py,sha256=yOtypHoY5HvIVBKZgFXdfj2tuCLLEBnMwNfAeG94Eik,10680
|
|
94
94
|
ultralytics/data/utils.py,sha256=ZvqocYXUGGhqJnLDvxF-gWChISkPZL-Bt-T2ZcA9tBI,31042
|
|
95
95
|
ultralytics/data/explorer/__init__.py,sha256=-Y3m1ZedepOQUv_KW82zaGxvU_PSHcuwUTFqG9BhAr4,113
|
|
96
96
|
ultralytics/data/explorer/explorer.py,sha256=JWmLHHhp68h2q3vx4poBou5RYoAX3R89yihR50YLDb0,18881
|
|
@@ -98,22 +98,22 @@ ultralytics/data/explorer/utils.py,sha256=EvvukQiQUTBrsZznmMnyEX2EqTuwZo_Geyc8yf
|
|
|
98
98
|
ultralytics/data/explorer/gui/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
99
99
|
ultralytics/data/explorer/gui/dash.py,sha256=vZ476NaUH4FKU08rAJ1K9WNyKtg0soMyJJxqg176yWc,10498
|
|
100
100
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
101
|
-
ultralytics/engine/exporter.py,sha256=
|
|
101
|
+
ultralytics/engine/exporter.py,sha256=VNTZUbZV9Pf6cYH39bawhudrrNMQ36RnQUCuTkfHktc,56852
|
|
102
102
|
ultralytics/engine/model.py,sha256=AB9tu7kJW-QiTAp0F_J8KQJ4FijsHXcYBTaVHb7aMrg,52281
|
|
103
|
-
ultralytics/engine/predictor.py,sha256=
|
|
103
|
+
ultralytics/engine/predictor.py,sha256=MgMWHUJdRcVCaVmOyvdy2Gjk_EyRHv-ar0SSGxQe8F4,17471
|
|
104
104
|
ultralytics/engine/results.py,sha256=PgRcz90S7eMwlogqEvax8O1sU3CPA2tEmrAL5kSr6II,70537
|
|
105
105
|
ultralytics/engine/trainer.py,sha256=ebFsES6KfVlVoCx9xeEpGDtVDumEndTHqojbcs9BzHg,35940
|
|
106
106
|
ultralytics/engine/tuner.py,sha256=gPqDTHH7vRB2O3YyH26m1BjVKbXxuA2XAlPRzTKFZsc,11838
|
|
107
|
-
ultralytics/engine/validator.py,sha256=
|
|
107
|
+
ultralytics/engine/validator.py,sha256=yaUMb5efBvgFg8M24IFlmv3J-acbbSgtqLCk-mM07Wo,14623
|
|
108
108
|
ultralytics/hub/__init__.py,sha256=AM_twjV9ouUmyxh3opoPgTqDpMOd8xIOHsAKdWS2L18,5663
|
|
109
109
|
ultralytics/hub/auth.py,sha256=kDLakGa2NbzvMAeXc2UdzZ65r0AH-XeM_JfsDY97WGk,5545
|
|
110
110
|
ultralytics/hub/session.py,sha256=_5yQNKkeaOnxwBeL85ueCgR-IYnDQ89WuzFNjTNPflU,16888
|
|
111
|
-
ultralytics/hub/utils.py,sha256=
|
|
111
|
+
ultralytics/hub/utils.py,sha256=I7NATG6O_QRw7EU7EHkdTVvbCkwKCyUe54BP60To_so,9715
|
|
112
112
|
ultralytics/hub/google/__init__.py,sha256=qyvvpGP-4NAtrn7GLqfqxP_aWuRP1T0OvJYafWKvL2Q,7512
|
|
113
113
|
ultralytics/models/__init__.py,sha256=TT9iLCL_n9Y80dcUq0Fo-p-GRZCSU2vrWXM3CoMwqqE,265
|
|
114
114
|
ultralytics/models/fastsam/__init__.py,sha256=W0rRSJM3vdxcsneuiN6_ajkUw86k6-opUKdLxVhKOoQ,203
|
|
115
115
|
ultralytics/models/fastsam/model.py,sha256=ikqOUoRbcTYH00YqA7WKdGXnrff1R8OdBi2OG0n9uaA,2008
|
|
116
|
-
ultralytics/models/fastsam/predict.py,sha256=
|
|
116
|
+
ultralytics/models/fastsam/predict.py,sha256=vkk_1FQHqpjne6QBUkJs29ZNNCTiDh42HpvxShCjiEI,7390
|
|
117
117
|
ultralytics/models/fastsam/utils.py,sha256=wH6pEjR2G45LYKqms5e8cJr5-Q-0bKyU8YcytDAn7d4,714
|
|
118
118
|
ultralytics/models/fastsam/val.py,sha256=ILKmw3U8FYmmQsO9wk9-bJ9Pyp_ZthJM36b61L75s3Y,1967
|
|
119
119
|
ultralytics/models/nas/__init__.py,sha256=d6-WTrYLXvbPs58ebA0-583ODi-VyzXc-t4aGIDQK6M,179
|
|
@@ -131,7 +131,7 @@ ultralytics/models/sam/build.py,sha256=zNQbrgSHUgz1gyXQwLKGTpa6CSEjeaevcP3w1Z1l3
|
|
|
131
131
|
ultralytics/models/sam/model.py,sha256=2KFUp8SHiqOgwUjkdqdau0oduJwKQxm4N9GHWjdhUFo,7382
|
|
132
132
|
ultralytics/models/sam/predict.py,sha256=4HOvBp27MvO8ef3gD64wVooNT1P5eMy3Bk8W7ysU57o,38352
|
|
133
133
|
ultralytics/models/sam/modules/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
134
|
-
ultralytics/models/sam/modules/blocks.py,sha256=
|
|
134
|
+
ultralytics/models/sam/modules/blocks.py,sha256=XqAINdAdAsijB3WgIQrkb22uopstGBgRKwML85KnNCw,45960
|
|
135
135
|
ultralytics/models/sam/modules/decoders.py,sha256=qDr12mDvDA-VIMI7Q9oIYBG9DQcvxDFpPzyAjyqrcbg,25896
|
|
136
136
|
ultralytics/models/sam/modules/encoders.py,sha256=vDOv8sdbcWc31aVn7hg-JyLP6CRziPep5FPDG2wxwns,34848
|
|
137
137
|
ultralytics/models/sam/modules/memory_attention.py,sha256=XilWBnRfH8wZxIoL2-yEk-dRypCsS0Jf_9t8WJxXKg0,9722
|
|
@@ -172,7 +172,7 @@ ultralytics/nn/autobackend.py,sha256=DZTIHsp2PLs8H2-oQR9LqA-uPj8DARGonCXzRv2Pkdc
|
|
|
172
172
|
ultralytics/nn/tasks.py,sha256=glHh-fqtlaP-q5rkOei6NYINypOe_f6buAyCocsDu3A,46135
|
|
173
173
|
ultralytics/nn/modules/__init__.py,sha256=m8x-XRHVLWMECPeysVlv1TQenV-n8oAbK1gxnoXzLpk,2553
|
|
174
174
|
ultralytics/nn/modules/activation.py,sha256=RS0DRDm9r56tojN79X8UBVtiktde9Wasw7GIbiopSMk,945
|
|
175
|
-
ultralytics/nn/modules/block.py,sha256=
|
|
175
|
+
ultralytics/nn/modules/block.py,sha256=n6Xhevz8_n05UCt_vmZ7eVRiDbA_zV_TvWNBbpZe-qA,34352
|
|
176
176
|
ultralytics/nn/modules/conv.py,sha256=zAnLM2G3PkfhcPvh9J4TBOZqeN9xAnxV821oFNOsAGQ,12693
|
|
177
177
|
ultralytics/nn/modules/head.py,sha256=C_toYU2yvDs9pCNhIwh3yr0D68_-V75L6BcBwZIPQkU,26456
|
|
178
178
|
ultralytics/nn/modules/transformer.py,sha256=tGiK8NmPfswwW1rbF21r5ILUkkZQ6Nk4s8j16vFBmps,18069
|
|
@@ -183,7 +183,7 @@ ultralytics/solutions/analytics.py,sha256=bGuZes11D7DNiTsHdwu6PJ0QA0vCiqMMAtZ7Ny
|
|
|
183
183
|
ultralytics/solutions/distance_calculation.py,sha256=dmHxKfC6CNwgS5otN5AF0LkygdZMGbn9UZ06Zrs-hlk,6485
|
|
184
184
|
ultralytics/solutions/heatmap.py,sha256=oEVivA4KAK6z0wA5Ca_a2qTckQN8tCt9MCpsPREeNnk,10375
|
|
185
185
|
ultralytics/solutions/object_counter.py,sha256=61KV4Ly7qVAN960fqNGlBUgojUkg-6rEcIhvaTOoaYE,10760
|
|
186
|
-
ultralytics/solutions/parking_management.py,sha256=
|
|
186
|
+
ultralytics/solutions/parking_management.py,sha256=z0-g2nehh4aA1nO71foT8Rw5pQTxKnEdcKJb1Arrd0Q,10134
|
|
187
187
|
ultralytics/solutions/queue_management.py,sha256=SWyZwzSrMbBZsc3JPn1Stv0WeOxv6Y39_6WK4trFOaI,6779
|
|
188
188
|
ultralytics/solutions/speed_estimation.py,sha256=kjqMSHGTHMZaNgTKNKWULxnJQNsvhq4WMUphMVlBjsc,6768
|
|
189
189
|
ultralytics/solutions/streamlit_inference.py,sha256=MKf5P3O5oJwIKu2h_URvzaQjMWoSEMDMBwordplfRxo,5703
|
|
@@ -198,20 +198,20 @@ ultralytics/trackers/utils/kalman_filter.py,sha256=cH9zD3fwkuezP97H9mw8cSBN7a8hH
|
|
|
198
198
|
ultralytics/trackers/utils/matching.py,sha256=3Ie1WNNRZ4_q3365F03XD7Nr9juZB_08mw4yUKC3w74,7162
|
|
199
199
|
ultralytics/utils/__init__.py,sha256=8AG5hOzrZmh_kax3haI1EM7gnS4jtfMPXKZXb3ED6g8,44101
|
|
200
200
|
ultralytics/utils/autobatch.py,sha256=AXboYfNSnTGsYj5FmgGYPQd0crfkeleyms6QXQfZGQ4,4194
|
|
201
|
-
ultralytics/utils/benchmarks.py,sha256=
|
|
202
|
-
ultralytics/utils/checks.py,sha256=
|
|
201
|
+
ultralytics/utils/benchmarks.py,sha256=UsVJXTgB6xQ8QBjlNghN3WuZQwXShQjuqv2RcGBLHDY,23640
|
|
202
|
+
ultralytics/utils/checks.py,sha256=_CVaDwy24lmjLms44Bid6k0TbDHz8aknmZDcJoy-FkM,28885
|
|
203
203
|
ultralytics/utils/dist.py,sha256=NDFga-uKxkBX2zLxFHSene_cCiGQJoyOeCXcN9JIOIk,2358
|
|
204
204
|
ultralytics/utils/downloads.py,sha256=uLsYFN2G4g2joTNrsZsfc8ytvfNNRXDPkI20qgkZ2B8,21897
|
|
205
205
|
ultralytics/utils/errors.py,sha256=GqP_Jgj_n0paxn8OMhn3DTCgoNkB2WjUcUaqs-M6SQk,816
|
|
206
206
|
ultralytics/utils/files.py,sha256=zxKNaH6YJvGKrD4DVPk0kkoo44Q7Xi-n_1Fy48TzTxw,8240
|
|
207
207
|
ultralytics/utils/instance.py,sha256=QSms7mPHZ5e8JGuJYLohLWltzI0aBE8dob2rOUK4RtM,16249
|
|
208
208
|
ultralytics/utils/loss.py,sha256=mDHGmF-gjggAUVhI1dkCm7TtfZHCwz25XKm4M2xJKLs,33916
|
|
209
|
-
ultralytics/utils/metrics.py,sha256=
|
|
209
|
+
ultralytics/utils/metrics.py,sha256=UgLGudWp57uXDMlMUJy4gsz6cfVjcq7tYmHeto3TqvM,53927
|
|
210
210
|
ultralytics/utils/ops.py,sha256=dsXNdyrYx_p6io6zezig9p84dxS7U-10vceHNVu2IL0,32888
|
|
211
211
|
ultralytics/utils/patches.py,sha256=Oo3DkP7MbXnNGvPfoFSocAkVvaPh9kwMT_9RQUfjVhI,3594
|
|
212
212
|
ultralytics/utils/plotting.py,sha256=m-JR-kAS_l3i-Dy1sFnGxfJuGGb0jlJZWZKORQtYZtQ,56183
|
|
213
213
|
ultralytics/utils/tal.py,sha256=ECsu95xEqOItmxMDN4YTD3FsUiIsQNWy0pZC3TfvFfk,16877
|
|
214
|
-
ultralytics/utils/torch_utils.py,sha256=
|
|
214
|
+
ultralytics/utils/torch_utils.py,sha256=LjMZC14Kz0ZU1YHXJygCzZcVy1qE32CWcLo5wElTiCA,29253
|
|
215
215
|
ultralytics/utils/triton.py,sha256=gg1finxno_tY2Ge9PMhmu7PI9wvoFZoiicdT4Bhqv3w,3936
|
|
216
216
|
ultralytics/utils/tuner.py,sha256=phFVyJIQ2ZqlBdWJ1NCTkCZ09OMAgHFgg39PoP0DANA,6170
|
|
217
217
|
ultralytics/utils/callbacks/__init__.py,sha256=YrWqC3BVVaTLob4iCPR6I36mUxIUOpPJW7B_LjT78Qw,214
|
|
@@ -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.86.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
229
|
+
ultralytics-8.2.86.dist-info/METADATA,sha256=_1p2SqyxVNugaJCEhsqLNuirZx7lqVwNNFQ3VLPZ5Uk,41838
|
|
230
|
+
ultralytics-8.2.86.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
|
231
|
+
ultralytics-8.2.86.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
232
|
+
ultralytics-8.2.86.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
233
|
+
ultralytics-8.2.86.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|