ultralytics 8.3.141__py3-none-any.whl → 8.3.142__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/cfg/__init__.py +6 -6
- ultralytics/engine/results.py +0 -1
- ultralytics/solutions/distance_calculation.py +2 -1
- ultralytics/solutions/object_counter.py +2 -4
- ultralytics/utils/plotting.py +14 -16
- {ultralytics-8.3.141.dist-info → ultralytics-8.3.142.dist-info}/METADATA +1 -1
- {ultralytics-8.3.141.dist-info → ultralytics-8.3.142.dist-info}/RECORD +12 -12
- {ultralytics-8.3.141.dist-info → ultralytics-8.3.142.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.141.dist-info → ultralytics-8.3.142.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.141.dist-info → ultralytics-8.3.142.dist-info}/licenses/LICENSE +0 -0
- {ultralytics-8.3.141.dist-info → ultralytics-8.3.142.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/cfg/__init__.py
CHANGED
@@ -108,8 +108,8 @@ CLI_HELP_MSG = f"""
|
|
108
108
|
|
109
109
|
yolo TASK MODE ARGS
|
110
110
|
|
111
|
-
Where TASK (optional) is one of {TASKS}
|
112
|
-
MODE (required) is one of {MODES}
|
111
|
+
Where TASK (optional) is one of {list(TASKS)}
|
112
|
+
MODE (required) is one of {list(MODES)}
|
113
113
|
ARGS (optional) are any number of custom 'arg=value' pairs like 'imgsz=320' that override defaults.
|
114
114
|
See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg'
|
115
115
|
|
@@ -909,9 +909,9 @@ def entrypoint(debug: str = "") -> None:
|
|
909
909
|
mode = overrides.get("mode")
|
910
910
|
if mode is None:
|
911
911
|
mode = DEFAULT_CFG.mode or "predict"
|
912
|
-
LOGGER.warning(f"'mode' argument is missing. Valid modes are {MODES}. Using default 'mode={mode}'.")
|
912
|
+
LOGGER.warning(f"'mode' argument is missing. Valid modes are {list(MODES)}. Using default 'mode={mode}'.")
|
913
913
|
elif mode not in MODES:
|
914
|
-
raise ValueError(f"Invalid 'mode={mode}'. Valid modes are {MODES}.\n{CLI_HELP_MSG}")
|
914
|
+
raise ValueError(f"Invalid 'mode={mode}'. Valid modes are {list(MODES)}.\n{CLI_HELP_MSG}")
|
915
915
|
|
916
916
|
# Task
|
917
917
|
task = overrides.pop("task", None)
|
@@ -919,11 +919,11 @@ def entrypoint(debug: str = "") -> None:
|
|
919
919
|
if task not in TASKS:
|
920
920
|
if task == "track":
|
921
921
|
LOGGER.warning(
|
922
|
-
f"invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}."
|
922
|
+
f"invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {list(TASKS)}.\n{CLI_HELP_MSG}."
|
923
923
|
)
|
924
924
|
task, mode = "detect", "track"
|
925
925
|
else:
|
926
|
-
raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}")
|
926
|
+
raise ValueError(f"Invalid 'task={task}'. Valid tasks are {list(TASKS)}.\n{CLI_HELP_MSG}")
|
927
927
|
if "model" not in overrides:
|
928
928
|
overrides["model"] = TASK2MODEL[task]
|
929
929
|
|
ultralytics/engine/results.py
CHANGED
@@ -118,7 +118,8 @@ class DistanceCalculation(BaseSolution):
|
|
118
118
|
self.centroids = [] # Reset centroids for next frame
|
119
119
|
plot_im = annotator.result()
|
120
120
|
self.display_output(plot_im) # Display output with base class function
|
121
|
-
|
121
|
+
if self.CFG.get("show") and self.env_check:
|
122
|
+
cv2.setMouseCallback("Ultralytics Solutions", self.mouse_event_for_distance)
|
122
123
|
|
123
124
|
# Return SolutionResults with processed image and calculated metrics
|
124
125
|
return SolutionResults(plot_im=plot_im, pixels_distance=pixels_distance, total_tracks=len(self.track_ids))
|
@@ -160,7 +160,7 @@ class ObjectCounter(BaseSolution):
|
|
160
160
|
self.annotator = SolutionAnnotator(im0, line_width=self.line_width) # Initialize annotator
|
161
161
|
|
162
162
|
is_obb = getattr(self.tracks[0], "obb", None) is not None # True if OBB results exist
|
163
|
-
if is_obb:
|
163
|
+
if is_obb and self.track_data and self.track_data.id is not None:
|
164
164
|
self.boxes = self.track_data.xyxyxyxy.reshape(-1, 4, 2).cpu()
|
165
165
|
|
166
166
|
self.annotator.draw_region(
|
@@ -170,9 +170,7 @@ class ObjectCounter(BaseSolution):
|
|
170
170
|
# Iterate over bounding boxes, track ids and classes index
|
171
171
|
for box, track_id, cls, conf in zip(self.boxes, self.track_ids, self.clss, self.confs):
|
172
172
|
# Draw bounding box and counting region
|
173
|
-
self.annotator.box_label(
|
174
|
-
box, label=self.adjust_box_label(cls, conf, track_id), color=colors(cls, True), rotated=is_obb
|
175
|
-
)
|
173
|
+
self.annotator.box_label(box, label=self.adjust_box_label(cls, conf, track_id), color=colors(cls, True))
|
176
174
|
self.store_tracking_history(track_id, box, is_obb=is_obb) # Store track history
|
177
175
|
|
178
176
|
# Store previous position of track for object counting
|
ultralytics/utils/plotting.py
CHANGED
@@ -278,7 +278,7 @@ class Annotator:
|
|
278
278
|
else:
|
279
279
|
return txt_color
|
280
280
|
|
281
|
-
def box_label(self, box, label="", color=(128, 128, 128), txt_color=(255, 255, 255)
|
281
|
+
def box_label(self, box, label="", color=(128, 128, 128), txt_color=(255, 255, 255)):
|
282
282
|
"""
|
283
283
|
Draw a bounding box on an image with a given label.
|
284
284
|
|
@@ -287,7 +287,6 @@ class Annotator:
|
|
287
287
|
label (str, optional): The text label to be displayed.
|
288
288
|
color (tuple, optional): The background color of the rectangle (B, G, R).
|
289
289
|
txt_color (tuple, optional): The color of the text (R, G, B).
|
290
|
-
rotated (bool, optional): Whether the task is oriented bounding box detection.
|
291
290
|
|
292
291
|
Examples:
|
293
292
|
>>> from ultralytics.utils.plotting import Annotator
|
@@ -298,13 +297,13 @@ class Annotator:
|
|
298
297
|
txt_color = self.get_txt_color(color, txt_color)
|
299
298
|
if isinstance(box, torch.Tensor):
|
300
299
|
box = box.tolist()
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
300
|
+
|
301
|
+
multi_points = isinstance(box[0], list) # multiple points with shape (n, 2)
|
302
|
+
p1 = [int(b) for b in box[0]] if multi_points else (int(box[0]), int(box[1]))
|
303
|
+
if self.pil:
|
304
|
+
self.draw.polygon(
|
305
|
+
[tuple(b) for b in box], width=self.lw, outline=color
|
306
|
+
) if multi_points else self.draw.rectangle(box, width=self.lw, outline=color)
|
308
307
|
if label:
|
309
308
|
w, h = self.font.getsize(label) # text width, height
|
310
309
|
outside = p1[1] >= h # label fits outside box
|
@@ -317,12 +316,11 @@ class Annotator:
|
|
317
316
|
# self.draw.text([box[0], box[1]], label, fill=txt_color, font=self.font, anchor='ls') # for PIL>8.0
|
318
317
|
self.draw.text((p1[0], p1[1] - h if outside else p1[1]), label, fill=txt_color, font=self.font)
|
319
318
|
else: # cv2
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
cv2.rectangle(self.im, p1, p2, color, thickness=self.lw, lineType=cv2.LINE_AA)
|
319
|
+
cv2.polylines(
|
320
|
+
self.im, [np.asarray(box, dtype=int)], True, color, self.lw
|
321
|
+
) if multi_points else cv2.rectangle(
|
322
|
+
self.im, p1, (int(box[2]), int(box[3])), color, thickness=self.lw, lineType=cv2.LINE_AA
|
323
|
+
)
|
326
324
|
if label:
|
327
325
|
w, h = cv2.getTextSize(label, 0, fontScale=self.sf, thickness=self.tf)[0] # text width, height
|
328
326
|
h += 3 # add pixels to pad text
|
@@ -750,7 +748,7 @@ def plot_images(
|
|
750
748
|
c = names.get(c, c) if names else c
|
751
749
|
if labels or conf[j] > conf_thres:
|
752
750
|
label = f"{c}" if labels else f"{c} {conf[j]:.1f}"
|
753
|
-
annotator.box_label(box, label, color=color
|
751
|
+
annotator.box_label(box, label, color=color)
|
754
752
|
|
755
753
|
elif len(classes):
|
756
754
|
for c in classes:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.142
|
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>
|
@@ -7,10 +7,10 @@ tests/test_exports.py,sha256=dhZn86LdbapW15RthQF870LGxDjC1MUZhlGdBgPmgIQ,9716
|
|
7
7
|
tests/test_integrations.py,sha256=dQteeRsRVuT_p5-T88-7jqT65Zm9iAXkyKg-KQ1_TQ8,6341
|
8
8
|
tests/test_python.py,sha256=Zx9OlPN11_D1WSLpi9nPFqORNHNz0lEn6mxVNL2ZHjE,25852
|
9
9
|
tests/test_solutions.py,sha256=8qntPMu_k278R3ZTxaFXq1N7m9wLnvpXPdw33fobKSU,13045
|
10
|
-
ultralytics/__init__.py,sha256=
|
10
|
+
ultralytics/__init__.py,sha256=T4ynXZmZYPUGqZx8ZNeiubG6VRJpCbJSj5EVAnFqGtg,730
|
11
11
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
12
12
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
13
|
-
ultralytics/cfg/__init__.py,sha256=
|
13
|
+
ultralytics/cfg/__init__.py,sha256=nDPCpYipxJ5XLjwwaoB5DNbovbOH-GM26_e2G5jDQ28,39580
|
14
14
|
ultralytics/cfg/default.yaml,sha256=oFG6llJO-Py5H-cR9qs-7FieJamroDLwpbrkhmfROOM,8307
|
15
15
|
ultralytics/cfg/datasets/Argoverse.yaml,sha256=_xlEDIJ9XkUo0v_iNL7FW079BoSeZtKSuLteKTtGbA8,3275
|
16
16
|
ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=SHND_CFkojxw5iQD5Mcgju2kCZIl0gW2ajuzv1cqoL0,1224
|
@@ -121,7 +121,7 @@ ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QU
|
|
121
121
|
ultralytics/engine/exporter.py,sha256=BZWa7Mnl1BPvbPiD-RJs6M5Bca4sm3_MQgjoHesvXEs,70949
|
122
122
|
ultralytics/engine/model.py,sha256=6AhrrcuLOQk_JuOAPQt3uNktAhEBWcBBh_AP2DGEbAs,53147
|
123
123
|
ultralytics/engine/predictor.py,sha256=rZ5mIPeejkxUerpTfUf_1rSAklOR3THqoejlil4C04w,21651
|
124
|
-
ultralytics/engine/results.py,sha256=
|
124
|
+
ultralytics/engine/results.py,sha256=BOpn7RihPt8OUpdklWs1iL3LCxVXOiynPGpaR_MPToQ,70036
|
125
125
|
ultralytics/engine/trainer.py,sha256=xdgNAgq6umJ6915tiCK3U22NeY7w1HnvmAhXlwS_hYI,38955
|
126
126
|
ultralytics/engine/tuner.py,sha256=zEW1UpLlZ6N4xbvS7MxICkshRlaFgLNfuADA0VfRpao,12629
|
127
127
|
ultralytics/engine/validator.py,sha256=f9UUv3QqQStLrO1nojrHkdS58qYQxKXaoIQQria6WyA,17054
|
@@ -207,11 +207,11 @@ ultralytics/solutions/__init__.py,sha256=ZoeAQavTLp8aClnhZ9tbl6lxy86GxofyGvZWTx2
|
|
207
207
|
ultralytics/solutions/ai_gym.py,sha256=QRTFwuD0g9KJgAjqdww4OeitXm-hsyXL1pJlrAhTyqA,5347
|
208
208
|
ultralytics/solutions/analytics.py,sha256=u-khRAViGupjq9mkuAFCl9G3yE8hXfXASfKZd_SQZ-8,12111
|
209
209
|
ultralytics/solutions/config.py,sha256=TLxQuZjqW-vhbS2OFmTT188-31ukHg1XP7l-BeOmqbU,5427
|
210
|
-
ultralytics/solutions/distance_calculation.py,sha256=
|
210
|
+
ultralytics/solutions/distance_calculation.py,sha256=JyB1KC1WihwGLFX2R2kk4QEvo8Qm0f3CD8fYqchzmfU,5807
|
211
211
|
ultralytics/solutions/heatmap.py,sha256=0Hw2Vhg4heglpnbNkM-RiGrQOkvgYbPRf4x8x4-zTjg,5418
|
212
212
|
ultralytics/solutions/instance_segmentation.py,sha256=IuAxxEkKrbTPHmD0jV3VEjNWpBc78o8exg00nE0ldeQ,3558
|
213
213
|
ultralytics/solutions/object_blurrer.py,sha256=-wXOdqqZisVhxLutZz7JvZmdgVGmsN7Ymary0JHc2qo,3946
|
214
|
-
ultralytics/solutions/object_counter.py,sha256=
|
214
|
+
ultralytics/solutions/object_counter.py,sha256=iNy4D1VUNYZ1JzMa8RUqQq5RBPcpSIuG60Qe3hsfZiw,9534
|
215
215
|
ultralytics/solutions/object_cropper.py,sha256=L6QZC5as_cUT42TMzeyXmkHa7vBi2UpNFf_-Jc7C1G0,3316
|
216
216
|
ultralytics/solutions/parking_management.py,sha256=BV-2lpSfgmK7fib3DnPSZ5rtLdy11c8pBQm-72iTetc,13289
|
217
217
|
ultralytics/solutions/queue_management.py,sha256=p1-cuI_rs4ygtlBryXjE65NYG2bnZXhp3ylggFnWcRs,4344
|
@@ -248,7 +248,7 @@ ultralytics/utils/loss.py,sha256=KMug5vHESghC3B3V5Vi-fhGVDdTjG9nGkGJmgO_WnPI,375
|
|
248
248
|
ultralytics/utils/metrics.py,sha256=8x4S7y-rBKRkM47f_o7jfMHA1Bz8SDq3t-R1FXlQNEM,59267
|
249
249
|
ultralytics/utils/ops.py,sha256=YFwPrKlPcgEmgAWqnJVR0Ccx5NQgp5e3P-YYHwVSP0k,34779
|
250
250
|
ultralytics/utils/patches.py,sha256=_dhIU_eDklQE-aWIjpyjPHl_wOwZoGuIUQnXgdSwk_A,5020
|
251
|
-
ultralytics/utils/plotting.py,sha256=
|
251
|
+
ultralytics/utils/plotting.py,sha256=WAWTGQAsM-cWy08QmcYOXrzFMHd24i8deYTed_u4kbg,47027
|
252
252
|
ultralytics/utils/tal.py,sha256=fkOdogPqPBUN07ThixpI8X7hea-oEfTIaaBLc26_O2s,20610
|
253
253
|
ultralytics/utils/torch_utils.py,sha256=WGNxGocstHD6ljhvujSCWjsYd4xWjNIXk_pq53zcKCc,39675
|
254
254
|
ultralytics/utils/triton.py,sha256=9P2rlQcGCTMFVKLA5S5mTYzU9cKbR5HF9ruVkPpVBE8,5307
|
@@ -264,9 +264,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=yYUgEgSv6L39sSev6vjwhAWU3DlPDsbSDV
|
|
264
264
|
ultralytics/utils/callbacks/raytune.py,sha256=A8amUGpux7dYES-L1iSeMoMXBySGWCD1aUqT7vcG-pU,1284
|
265
265
|
ultralytics/utils/callbacks/tensorboard.py,sha256=jgYnym3cUQFAgN1GzTyO7l3jINtfAh8zhrllDvnLuVQ,5339
|
266
266
|
ultralytics/utils/callbacks/wb.py,sha256=iDRFXI4IIDm8R5OI89DMTmjs8aHLo1HRCLkOFKdaMG4,7507
|
267
|
-
ultralytics-8.3.
|
268
|
-
ultralytics-8.3.
|
269
|
-
ultralytics-8.3.
|
270
|
-
ultralytics-8.3.
|
271
|
-
ultralytics-8.3.
|
272
|
-
ultralytics-8.3.
|
267
|
+
ultralytics-8.3.142.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
268
|
+
ultralytics-8.3.142.dist-info/METADATA,sha256=7W-oMpyVcu-nwCAur5sQWeVc38sKhvf3T0gpZw_WOwE,37200
|
269
|
+
ultralytics-8.3.142.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
270
|
+
ultralytics-8.3.142.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
271
|
+
ultralytics-8.3.142.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
272
|
+
ultralytics-8.3.142.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|