ultralytics 8.3.35__py3-none-any.whl → 8.3.36__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.
- tests/test_solutions.py +1 -1
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/solutions/default.yaml +1 -1
- ultralytics/engine/exporter.py +2 -3
- ultralytics/nn/tasks.py +4 -14
- ultralytics/solutions/object_counter.py +21 -25
- ultralytics/solutions/solutions.py +1 -1
- ultralytics/utils/torch_utils.py +1 -1
- {ultralytics-8.3.35.dist-info → ultralytics-8.3.36.dist-info}/METADATA +2 -2
- {ultralytics-8.3.35.dist-info → ultralytics-8.3.36.dist-info}/RECORD +14 -14
- {ultralytics-8.3.35.dist-info → ultralytics-8.3.36.dist-info}/LICENSE +0 -0
- {ultralytics-8.3.35.dist-info → ultralytics-8.3.36.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.35.dist-info → ultralytics-8.3.36.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.35.dist-info → ultralytics-8.3.36.dist-info}/top_level.txt +0 -0
tests/test_solutions.py
CHANGED
@@ -16,7 +16,7 @@ def test_major_solutions():
|
|
16
16
|
safe_download(url=MAJOR_SOLUTIONS_DEMO)
|
17
17
|
cap = cv2.VideoCapture("solutions_ci_demo.mp4")
|
18
18
|
assert cap.isOpened(), "Error reading video file"
|
19
|
-
region_points = [(20, 400), (1080,
|
19
|
+
region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)]
|
20
20
|
counter = solutions.ObjectCounter(region=region_points, model="yolo11n.pt", show=False) # Test object counter
|
21
21
|
heatmap = solutions.Heatmap(colormap=cv2.COLORMAP_PARULA, model="yolo11n.pt", show=False) # Test heatmaps
|
22
22
|
speed = solutions.SpeedEstimator(region=region_points, model="yolo11n.pt", show=False) # Test queue manager
|
ultralytics/__init__.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Configuration for Ultralytics Solutions
|
3
3
|
|
4
4
|
# Object counting settings
|
5
|
-
region: # Object counting, queue or speed estimation region points. Default region points are [(20, 400), (1080,
|
5
|
+
region: # Object counting, queue or speed estimation region points. Default region points are [(20, 400), (1080, 400), (1080, 360), (20, 360)]
|
6
6
|
show_in: True # Flag to display objects moving *into* the defined region
|
7
7
|
show_out: True # Flag to display objects moving *out of* the defined region
|
8
8
|
|
ultralytics/engine/exporter.py
CHANGED
@@ -501,8 +501,7 @@ class Exporter:
|
|
501
501
|
@try_export
|
502
502
|
def export_openvino(self, prefix=colorstr("OpenVINO:")):
|
503
503
|
"""YOLO OpenVINO export."""
|
504
|
-
|
505
|
-
check_requirements(f'openvino{"<=2024.0.0" if ARM64 else ">=2024.0.0"}') # fix OpenVINO issue on ARM64
|
504
|
+
check_requirements("openvino>=2024.5.0")
|
506
505
|
import openvino as ov
|
507
506
|
|
508
507
|
LOGGER.info(f"\n{prefix} starting export with openvino {ov.__version__}...")
|
@@ -530,7 +529,7 @@ class Exporter:
|
|
530
529
|
if self.args.int8:
|
531
530
|
fq = str(self.file).replace(self.file.suffix, f"_int8_openvino_model{os.sep}")
|
532
531
|
fq_ov = str(Path(fq) / self.file.with_suffix(".xml").name)
|
533
|
-
check_requirements("nncf>=2.
|
532
|
+
check_requirements("nncf>=2.14.0")
|
534
533
|
import nncf
|
535
534
|
|
536
535
|
def transform_fn(data_item) -> np.ndarray:
|
ultralytics/nn/tasks.py
CHANGED
@@ -960,10 +960,8 @@ def parse_model(d, ch, verbose=True): # model_dict, input_channels(3)
|
|
960
960
|
m = getattr(torch.nn, m[3:]) if "nn." in m else globals()[m] # get module
|
961
961
|
for j, a in enumerate(args):
|
962
962
|
if isinstance(a, str):
|
963
|
-
|
963
|
+
with contextlib.suppress(ValueError):
|
964
964
|
args[j] = locals()[a] if a in locals() else ast.literal_eval(a)
|
965
|
-
except ValueError:
|
966
|
-
pass
|
967
965
|
n = n_ = max(round(n * depth), 1) if n > 1 else n # depth gain
|
968
966
|
if m in {
|
969
967
|
Classify,
|
@@ -1141,24 +1139,16 @@ def guess_model_task(model):
|
|
1141
1139
|
|
1142
1140
|
# Guess from model cfg
|
1143
1141
|
if isinstance(model, dict):
|
1144
|
-
|
1142
|
+
with contextlib.suppress(Exception):
|
1145
1143
|
return cfg2task(model)
|
1146
|
-
except Exception:
|
1147
|
-
pass
|
1148
|
-
|
1149
1144
|
# Guess from PyTorch model
|
1150
1145
|
if isinstance(model, nn.Module): # PyTorch model
|
1151
1146
|
for x in "model.args", "model.model.args", "model.model.model.args":
|
1152
|
-
|
1147
|
+
with contextlib.suppress(Exception):
|
1153
1148
|
return eval(x)["task"]
|
1154
|
-
except Exception:
|
1155
|
-
pass
|
1156
1149
|
for x in "model.yaml", "model.model.yaml", "model.model.model.yaml":
|
1157
|
-
|
1150
|
+
with contextlib.suppress(Exception):
|
1158
1151
|
return cfg2task(eval(x))
|
1159
|
-
except Exception:
|
1160
|
-
pass
|
1161
|
-
|
1162
1152
|
for m in model.modules():
|
1163
1153
|
if isinstance(m, Segment):
|
1164
1154
|
return "segment"
|
@@ -80,37 +80,33 @@ class ObjectCounter(BaseSolution):
|
|
80
80
|
else: # Moving left
|
81
81
|
self.out_count += 1
|
82
82
|
self.classwise_counts[self.names[cls]]["OUT"] += 1
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
self.classwise_counts[self.names[cls]]["OUT"] += 1
|
83
|
+
# Horizontal region: Compare y-coordinates to determine direction
|
84
|
+
elif current_centroid[1] > prev_position[1]: # Moving downward
|
85
|
+
self.in_count += 1
|
86
|
+
self.classwise_counts[self.names[cls]]["IN"] += 1
|
87
|
+
else: # Moving upward
|
88
|
+
self.out_count += 1
|
89
|
+
self.classwise_counts[self.names[cls]]["OUT"] += 1
|
91
90
|
self.counted_ids.append(track_id)
|
92
91
|
|
93
92
|
elif len(self.region) > 2: # Polygonal region
|
94
93
|
polygon = self.Polygon(self.region)
|
95
94
|
if polygon.contains(self.Point(current_centroid)):
|
96
95
|
# Determine motion direction for vertical or horizontal polygons
|
97
|
-
region_width = max(
|
98
|
-
region_height = max(
|
99
|
-
|
100
|
-
if
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
else: # Moving upward
|
112
|
-
self.out_count += 1
|
113
|
-
self.classwise_counts[self.names[cls]]["OUT"] += 1
|
96
|
+
region_width = max(p[0] for p in self.region) - min(p[0] for p in self.region)
|
97
|
+
region_height = max(p[1] for p in self.region) - min(p[1] for p in self.region)
|
98
|
+
|
99
|
+
if (
|
100
|
+
region_width < region_height
|
101
|
+
and current_centroid[0] > prev_position[0]
|
102
|
+
or region_width >= region_height
|
103
|
+
and current_centroid[1] > prev_position[1]
|
104
|
+
): # Moving right
|
105
|
+
self.in_count += 1
|
106
|
+
self.classwise_counts[self.names[cls]]["IN"] += 1
|
107
|
+
else: # Moving left
|
108
|
+
self.out_count += 1
|
109
|
+
self.classwise_counts[self.names[cls]]["OUT"] += 1
|
114
110
|
self.counted_ids.append(track_id)
|
115
111
|
|
116
112
|
def store_classwise_counts(self, cls):
|
@@ -135,7 +135,7 @@ class BaseSolution:
|
|
135
135
|
def initialize_region(self):
|
136
136
|
"""Initialize the counting region and line segment based on configuration settings."""
|
137
137
|
if self.region is None:
|
138
|
-
self.region = [(20, 400), (1080,
|
138
|
+
self.region = [(20, 400), (1080, 400), (1080, 360), (20, 360)]
|
139
139
|
self.r_s = (
|
140
140
|
self.Polygon(self.region) if len(self.region) >= 3 else self.LineString(self.region)
|
141
141
|
) # region or line
|
ultralytics/utils/torch_utils.py
CHANGED
@@ -675,7 +675,7 @@ def profile(input, ops, n=10, device=None, max_num_obj=0):
|
|
675
675
|
torch.randn(
|
676
676
|
x.shape[0],
|
677
677
|
max_num_obj,
|
678
|
-
int(sum(
|
678
|
+
int(sum((x.shape[-1] / s) * (x.shape[-2] / s) for s in m.stride.tolist())),
|
679
679
|
device=device,
|
680
680
|
dtype=torch.float32,
|
681
681
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.36
|
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>
|
@@ -96,7 +96,7 @@ Requires-Dist: pycocotools>=2.0.7; extra == "extra"
|
|
96
96
|
|
97
97
|
<div>
|
98
98
|
<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>
|
99
|
-
<a href="https://
|
99
|
+
<a href="https://pepy.tech/projects/ultralytics"><img src="https://static.pepy.tech/badge/ultralytics" alt="Ultralytics Downloads"></a>
|
100
100
|
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="Ultralytics YOLO Citation"></a>
|
101
101
|
<a href="https://discord.com/invite/ultralytics"><img alt="Ultralytics Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
102
102
|
<a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a>
|
@@ -6,8 +6,8 @@ tests/test_engine.py,sha256=dcEcJsMQh61rDSNv7l4TIAgybLpzjVwerv9JZC_KCM8,4934
|
|
6
6
|
tests/test_exports.py,sha256=1MvhcQ2qHdbJImHII-bFarcaIcm-kPlEK-OdFLxnj7o,8769
|
7
7
|
tests/test_integrations.py,sha256=f5-QCUk1SU_-qn4mBCZwS3GN3tXEBIIXo4z2EhExbHw,6126
|
8
8
|
tests/test_python.py,sha256=I1RRdCwLdrc3jX06huVxct8HX8ccQOmQgVpuEflRl0U,23560
|
9
|
-
tests/test_solutions.py,sha256=
|
10
|
-
ultralytics/__init__.py,sha256=
|
9
|
+
tests/test_solutions.py,sha256=HlDe-XOgBX0k1cLhRTAhhawMHk6p-5dg5xl2AIRjfdk,3790
|
10
|
+
ultralytics/__init__.py,sha256=8zf8uvs_KTLPV49QQoIaydRNBC_k4H1qsXDKoxjxuy4,681
|
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=ArJow4-pOPN3y6aKOv5KcVXimikI6vAQvQlSRb7IdWE,38743
|
@@ -86,7 +86,7 @@ ultralytics/cfg/models/v9/yolov9e.yaml,sha256=dhaR47WxuLOrZWDCceS4bQG00sQdrMc8FQ
|
|
86
86
|
ultralytics/cfg/models/v9/yolov9m.yaml,sha256=l6CmivzNu44sRVmkQXk4-tXflbV1nWnk5MSc8su2vhs,1311
|
87
87
|
ultralytics/cfg/models/v9/yolov9s.yaml,sha256=lPWcu-6ub1kCBD6zIDFwthYZ3RvdJfODWKy3vEQWRjo,1291
|
88
88
|
ultralytics/cfg/models/v9/yolov9t.yaml,sha256=qL__kr6GoefpQWP4jV0jdzwTp46bdFUcqtPRnfDbkY8,1275
|
89
|
-
ultralytics/cfg/solutions/default.yaml,sha256=
|
89
|
+
ultralytics/cfg/solutions/default.yaml,sha256=KjzFvzwZkP3gO4-2R8QcCHHeE2mF-ZWLB_jrGy6_vjs,1239
|
90
90
|
ultralytics/cfg/trackers/botsort.yaml,sha256=FDIrZ3hAhRtMfDl654pt1HIexmPqlFQK-3lQ4D0tF84,918
|
91
91
|
ultralytics/cfg/trackers/bytetrack.yaml,sha256=rBWY4RjjX6PTO2o6TUJFYHVgXNZHCN5TuBuzwuPYVjA,723
|
92
92
|
ultralytics/data/__init__.py,sha256=VGe-ATG7j35F4A4r8Jmzffjlhve4JAJPgRa5ahKTU18,616
|
@@ -100,7 +100,7 @@ ultralytics/data/loaders.py,sha256=Fr70Q9p9t7buLW_8R2_lI_nyCMG033gWSxvwy1M-a-U,2
|
|
100
100
|
ultralytics/data/split_dota.py,sha256=eFafJ7Vg52wj6KDCHFJAf1tKzyPD5YaPB8kM4VX5Aeg,10688
|
101
101
|
ultralytics/data/utils.py,sha256=bmWEIrdogj4kssZQSJdSbIF8QsJU00lo-EY-Mgcqv4M,31073
|
102
102
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
103
|
-
ultralytics/engine/exporter.py,sha256=
|
103
|
+
ultralytics/engine/exporter.py,sha256=hTzJ09-7E0WCehrqws_joG613VBhyIfWZYrRCsnafjQ,66832
|
104
104
|
ultralytics/engine/model.py,sha256=TfuTczFjNJ3GW0E_qWVH6OaJ_2I-_Srx7i_4GQebDoo,51472
|
105
105
|
ultralytics/engine/predictor.py,sha256=nO6lzxG75GXyQsUNEimLk5MLfcMwl8AkRAaoYMPwQug,17687
|
106
106
|
ultralytics/engine/results.py,sha256=a1XFZRPwqgKDBOEAibHuT9nP2xefLiWVsMoBJbcr4iA,75058
|
@@ -171,7 +171,7 @@ ultralytics/models/yolo/world/train.py,sha256=gaDrAmLJpg9qDtmL5evA5HsV2yb4RTRSfk
|
|
171
171
|
ultralytics/models/yolo/world/train_world.py,sha256=IsnCEVt6DcM9lUskCKmIN-M8MM79xLpwTRqRoAHUnZ4,4857
|
172
172
|
ultralytics/nn/__init__.py,sha256=4BPLHY89xEM_al5uK0aOmFgiML6CMGEZbezxOvTjOEs,587
|
173
173
|
ultralytics/nn/autobackend.py,sha256=Arke5BaRQmr4yQd-xr6Z8P7kbTBNLI-O0fsDPFLOXMw,35625
|
174
|
-
ultralytics/nn/tasks.py,sha256=
|
174
|
+
ultralytics/nn/tasks.py,sha256=pqRe1F1HOH8AjLZpFaZCGb5gSYsXH0eVnHITKDTFFhI,48527
|
175
175
|
ultralytics/nn/modules/__init__.py,sha256=xhW2BennT9U_VaMXVpRu-bdLgp1BXt9L8mkIUBE3idU,2625
|
176
176
|
ultralytics/nn/modules/activation.py,sha256=chhn469wnRHEs5BMGNBYXwPYZc_7-urspTT8fnBd-xA,895
|
177
177
|
ultralytics/nn/modules/block.py,sha256=PAm23KpRHDNlGtNWf1w8Ae0LdjII2H5vu0A4eeWx_XQ,41851
|
@@ -184,11 +184,11 @@ ultralytics/solutions/ai_gym.py,sha256=Jb9Rbd9gOOj2ox4Q5mqalCdvg3RMXA6Cxe5kS18IF
|
|
184
184
|
ultralytics/solutions/analytics.py,sha256=C57pIghXeKN8hul8QOV7W9YDMpfFfSfPTBb-lE9HeAc,11535
|
185
185
|
ultralytics/solutions/distance_calculation.py,sha256=KN3CC-dm2dTQylj79IrifCJT8ZhE7hc2EweH3KK31mE,5461
|
186
186
|
ultralytics/solutions/heatmap.py,sha256=-1VtMCJRmpHnLqgna0i2HOBsxNoqFernzpKQnICngUM,5449
|
187
|
-
ultralytics/solutions/object_counter.py,sha256
|
187
|
+
ultralytics/solutions/object_counter.py,sha256=MuxQG4a22458WwciAB96m5AxVXwH98AIWAaf_kPali4,9613
|
188
188
|
ultralytics/solutions/parking_management.py,sha256=1DsEE94eauqcnnFxUYI-BX9eA1GbJVNt7oncj1okYpI,11198
|
189
189
|
ultralytics/solutions/queue_management.py,sha256=D9TqwJSVrZQFxp_M8O62WfBAxkAuDWWnXe7FFmnp7_w,4881
|
190
190
|
ultralytics/solutions/region_counter.py,sha256=w0c0Sz9XG6rwzr5nA6nb1zFW8IVkTQuatfZNBtOik68,4947
|
191
|
-
ultralytics/solutions/solutions.py,sha256=
|
191
|
+
ultralytics/solutions/solutions.py,sha256=HC5008BgQmWTw4aY8VgTEQioUzvuZxJebIk35E5HdcA,7275
|
192
192
|
ultralytics/solutions/speed_estimation.py,sha256=A10DmuZlGkoZUyfHhZWcDRjj1-9GXiDhEjyBbAzfaDs,4936
|
193
193
|
ultralytics/solutions/streamlit_inference.py,sha256=w4dnvSv2FOrpji9W1Ir86phka3OXc7jd_38-OCbQdZw,5701
|
194
194
|
ultralytics/trackers/__init__.py,sha256=j72IgH2dZHQArMPK4YwcV5ieIw94fYvlGdQjB9cOQKw,227
|
@@ -215,7 +215,7 @@ ultralytics/utils/ops.py,sha256=dsXNdyrYx_p6io6zezig9p84dxS7U-10vceHNVu2IL0,3288
|
|
215
215
|
ultralytics/utils/patches.py,sha256=J-iOwIRbfUs-inBZerhnXby5tUKjYcOIyvhLTS352JE,3270
|
216
216
|
ultralytics/utils/plotting.py,sha256=TKtdbAOl6gZdFD2hlA5T4LNWfr2LUWbCC-cXkgL1JAU,61089
|
217
217
|
ultralytics/utils/tal.py,sha256=thD_AEhVmhaZqmS5szZMvpKO-RKOeZwfX1BYAhdnA0o,18470
|
218
|
-
ultralytics/utils/torch_utils.py,sha256=
|
218
|
+
ultralytics/utils/torch_utils.py,sha256=57y3iY2ke-E-v7MGMN2nPPAEwqEBsf0rjHEOfo9VPBc,32068
|
219
219
|
ultralytics/utils/triton.py,sha256=gg1finxno_tY2Ge9PMhmu7PI9wvoFZoiicdT4Bhqv3w,3936
|
220
220
|
ultralytics/utils/tuner.py,sha256=K09-z5k1E4ZriSKoWdwQrJ2PJ2fY1ez3-b2R6aKPTqM,6198
|
221
221
|
ultralytics/utils/callbacks/__init__.py,sha256=YrWqC3BVVaTLob4iCPR6I36mUxIUOpPJW7B_LjT78Qw,214
|
@@ -229,9 +229,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=IbGQfEltamUKXJt93uSLQFn8c2rYh3DMTg
|
|
229
229
|
ultralytics/utils/callbacks/raytune.py,sha256=Ck_yFzg7UZXiDWrLHaltjQybzVWSFDfzpdrx9ZYTRfI,700
|
230
230
|
ultralytics/utils/callbacks/tensorboard.py,sha256=SHlE58Fb-sg-uZKtgy-ybIO3SAIfK55aj8kTYGA0Cyg,4167
|
231
231
|
ultralytics/utils/callbacks/wb.py,sha256=sizfTa-xI9k2pnDSP_Q9pHZEFwcl__gSFM0AcneuRpY,7058
|
232
|
-
ultralytics-8.3.
|
233
|
-
ultralytics-8.3.
|
234
|
-
ultralytics-8.3.
|
235
|
-
ultralytics-8.3.
|
236
|
-
ultralytics-8.3.
|
237
|
-
ultralytics-8.3.
|
232
|
+
ultralytics-8.3.36.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
233
|
+
ultralytics-8.3.36.dist-info/METADATA,sha256=32AcyU2TCZfAUFhgWdjFWJN9FJSCDug98r1IhHOOXOM,35209
|
234
|
+
ultralytics-8.3.36.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
235
|
+
ultralytics-8.3.36.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
236
|
+
ultralytics-8.3.36.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
237
|
+
ultralytics-8.3.36.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|