ultralytics 8.1.9__py3-none-any.whl → 8.1.10__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/nn/modules/head.py +11 -10
- ultralytics/trackers/utils/gmc.py +8 -8
- ultralytics/utils/callbacks/mlflow.py +6 -2
- {ultralytics-8.1.9.dist-info → ultralytics-8.1.10.dist-info}/METADATA +2 -2
- {ultralytics-8.1.9.dist-info → ultralytics-8.1.10.dist-info}/RECORD +10 -10
- {ultralytics-8.1.9.dist-info → ultralytics-8.1.10.dist-info}/LICENSE +0 -0
- {ultralytics-8.1.9.dist-info → ultralytics-8.1.10.dist-info}/WHEEL +0 -0
- {ultralytics-8.1.9.dist-info → ultralytics-8.1.10.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.1.9.dist-info → ultralytics-8.1.10.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/nn/modules/head.py
CHANGED
|
@@ -59,16 +59,17 @@ class Detect(nn.Module):
|
|
|
59
59
|
cls = x_cat[:, self.reg_max * 4 :]
|
|
60
60
|
else:
|
|
61
61
|
box, cls = x_cat.split((self.reg_max * 4, self.nc), 1)
|
|
62
|
-
dbox = self.decode_bboxes(box)
|
|
63
62
|
|
|
64
63
|
if self.export and self.format in ("tflite", "edgetpu"):
|
|
65
64
|
# Precompute normalization factor to increase numerical stability
|
|
66
65
|
# See https://github.com/ultralytics/ultralytics/issues/7371
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
norm = self.strides / (self.stride[0] *
|
|
71
|
-
dbox =
|
|
66
|
+
grid_h = shape[2]
|
|
67
|
+
grid_w = shape[3]
|
|
68
|
+
grid_size = torch.tensor([grid_w, grid_h, grid_w, grid_h], device=box.device).reshape(1, 4, 1)
|
|
69
|
+
norm = self.strides / (self.stride[0] * grid_size)
|
|
70
|
+
dbox = self.decode_bboxes(self.dfl(box) * norm, self.anchors.unsqueeze(0) * norm[:, :2])
|
|
71
|
+
else:
|
|
72
|
+
dbox = self.decode_bboxes(self.dfl(box), self.anchors.unsqueeze(0)) * self.strides
|
|
72
73
|
|
|
73
74
|
y = torch.cat((dbox, cls.sigmoid()), 1)
|
|
74
75
|
return y if self.export else (y, x)
|
|
@@ -82,9 +83,9 @@ class Detect(nn.Module):
|
|
|
82
83
|
a[-1].bias.data[:] = 1.0 # box
|
|
83
84
|
b[-1].bias.data[: m.nc] = math.log(5 / m.nc / (640 / s) ** 2) # cls (.01 objects, 80 classes, 640 img)
|
|
84
85
|
|
|
85
|
-
def decode_bboxes(self, bboxes):
|
|
86
|
+
def decode_bboxes(self, bboxes, anchors):
|
|
86
87
|
"""Decode bounding boxes."""
|
|
87
|
-
return dist2bbox(
|
|
88
|
+
return dist2bbox(bboxes, anchors, xywh=True, dim=1)
|
|
88
89
|
|
|
89
90
|
|
|
90
91
|
class Segment(Detect):
|
|
@@ -139,9 +140,9 @@ class OBB(Detect):
|
|
|
139
140
|
return x, angle
|
|
140
141
|
return torch.cat([x, angle], 1) if self.export else (torch.cat([x[0], angle], 1), (x[1], angle))
|
|
141
142
|
|
|
142
|
-
def decode_bboxes(self, bboxes):
|
|
143
|
+
def decode_bboxes(self, bboxes, anchors):
|
|
143
144
|
"""Decode rotated bounding boxes."""
|
|
144
|
-
return dist2rbox(
|
|
145
|
+
return dist2rbox(bboxes, self.angle, anchors, dim=1)
|
|
145
146
|
|
|
146
147
|
|
|
147
148
|
class Pose(Detect):
|
|
@@ -97,13 +97,13 @@ class GMC:
|
|
|
97
97
|
if self.method in ["orb", "sift"]:
|
|
98
98
|
return self.applyFeatures(raw_frame, detections)
|
|
99
99
|
elif self.method == "ecc":
|
|
100
|
-
return self.applyEcc(raw_frame
|
|
100
|
+
return self.applyEcc(raw_frame)
|
|
101
101
|
elif self.method == "sparseOptFlow":
|
|
102
|
-
return self.applySparseOptFlow(raw_frame
|
|
102
|
+
return self.applySparseOptFlow(raw_frame)
|
|
103
103
|
else:
|
|
104
104
|
return np.eye(2, 3)
|
|
105
105
|
|
|
106
|
-
def applyEcc(self, raw_frame: np.array
|
|
106
|
+
def applyEcc(self, raw_frame: np.array) -> np.array:
|
|
107
107
|
"""
|
|
108
108
|
Apply ECC algorithm to a raw frame.
|
|
109
109
|
|
|
@@ -144,7 +144,7 @@ class GMC:
|
|
|
144
144
|
# Run the ECC algorithm. The results are stored in warp_matrix.
|
|
145
145
|
# (cc, H) = cv2.findTransformECC(self.prevFrame, frame, H, self.warp_mode, self.criteria)
|
|
146
146
|
try:
|
|
147
|
-
(
|
|
147
|
+
(_, H) = cv2.findTransformECC(self.prevFrame, frame, H, self.warp_mode, self.criteria, None, 1)
|
|
148
148
|
except Exception as e:
|
|
149
149
|
LOGGER.warning(f"WARNING: find transform failed. Set warp as identity {e}")
|
|
150
150
|
|
|
@@ -275,7 +275,7 @@ class GMC:
|
|
|
275
275
|
# plt.show()
|
|
276
276
|
|
|
277
277
|
# Find rigid matrix
|
|
278
|
-
if
|
|
278
|
+
if prevPoints.shape[0] > 4:
|
|
279
279
|
H, inliers = cv2.estimateAffinePartial2D(prevPoints, currPoints, cv2.RANSAC)
|
|
280
280
|
|
|
281
281
|
# Handle downscale
|
|
@@ -292,7 +292,7 @@ class GMC:
|
|
|
292
292
|
|
|
293
293
|
return H
|
|
294
294
|
|
|
295
|
-
def applySparseOptFlow(self, raw_frame: np.array
|
|
295
|
+
def applySparseOptFlow(self, raw_frame: np.array) -> np.array:
|
|
296
296
|
"""
|
|
297
297
|
Apply Sparse Optical Flow method to a raw frame.
|
|
298
298
|
|
|
@@ -328,7 +328,7 @@ class GMC:
|
|
|
328
328
|
return H
|
|
329
329
|
|
|
330
330
|
# Find correspondences
|
|
331
|
-
matchedKeypoints, status,
|
|
331
|
+
matchedKeypoints, status, _ = cv2.calcOpticalFlowPyrLK(self.prevFrame, frame, self.prevKeyPoints, None)
|
|
332
332
|
|
|
333
333
|
# Leave good correspondences only
|
|
334
334
|
prevPoints = []
|
|
@@ -344,7 +344,7 @@ class GMC:
|
|
|
344
344
|
|
|
345
345
|
# Find rigid matrix
|
|
346
346
|
if (prevPoints.shape[0] > 4) and (prevPoints.shape[0] == prevPoints.shape[0]):
|
|
347
|
-
H,
|
|
347
|
+
H, _ = cv2.estimateAffinePartial2D(prevPoints, currPoints, cv2.RANSAC)
|
|
348
348
|
|
|
349
349
|
if self.downscale > 1.0:
|
|
350
350
|
H[0, 2] *= self.downscale
|
|
@@ -86,9 +86,12 @@ def on_train_epoch_end(trainer):
|
|
|
86
86
|
"""Log training metrics at the end of each train epoch to MLflow."""
|
|
87
87
|
if mlflow:
|
|
88
88
|
mlflow.log_metrics(
|
|
89
|
-
metrics=
|
|
89
|
+
metrics={
|
|
90
|
+
**SANITIZE(trainer.lr),
|
|
91
|
+
**SANITIZE(trainer.label_loss_items(trainer.tloss, prefix="train")),
|
|
92
|
+
},
|
|
93
|
+
step=trainer.epoch,
|
|
90
94
|
)
|
|
91
|
-
mlflow.log_metrics(metrics=SANITIZE(trainer.lr), step=trainer.epoch)
|
|
92
95
|
|
|
93
96
|
|
|
94
97
|
def on_fit_epoch_end(trainer):
|
|
@@ -115,6 +118,7 @@ def on_train_end(trainer):
|
|
|
115
118
|
callbacks = (
|
|
116
119
|
{
|
|
117
120
|
"on_pretrain_routine_end": on_pretrain_routine_end,
|
|
121
|
+
"on_train_epoch_end": on_train_epoch_end,
|
|
118
122
|
"on_fit_epoch_end": on_fit_epoch_end,
|
|
119
123
|
"on_train_end": on_train_end,
|
|
120
124
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.1.
|
|
3
|
+
Version: 8.1.10
|
|
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
|
|
@@ -55,7 +55,7 @@ Requires-Dist: mkdocs-material ; extra == 'dev'
|
|
|
55
55
|
Requires-Dist: mkdocstrings[python] ; extra == 'dev'
|
|
56
56
|
Requires-Dist: mkdocs-jupyter ; extra == 'dev'
|
|
57
57
|
Requires-Dist: mkdocs-redirects ; extra == 'dev'
|
|
58
|
-
Requires-Dist: mkdocs-ultralytics-plugin >=0.0.
|
|
58
|
+
Requires-Dist: mkdocs-ultralytics-plugin >=0.0.43 ; extra == 'dev'
|
|
59
59
|
Provides-Extra: explorer
|
|
60
60
|
Requires-Dist: lancedb ; extra == 'explorer'
|
|
61
61
|
Requires-Dist: duckdb ; extra == 'explorer'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ultralytics/__init__.py,sha256=
|
|
1
|
+
ultralytics/__init__.py,sha256=Acy7EBxuoFjR4DRjZv-Ou3q8wjwt1bpfECWw2GxLBUU,597
|
|
2
2
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
3
3
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
4
4
|
ultralytics/cfg/__init__.py,sha256=OZe3OfyNAeT1lRI7uJVM_Lla91mxGYgJMxrwyT7VP6o,20768
|
|
@@ -138,7 +138,7 @@ ultralytics/nn/tasks.py,sha256=fgnTEZ4g8jOp2XnvcrSGSDcVh0ifKs-o16Lt-NPCF5Y,38765
|
|
|
138
138
|
ultralytics/nn/modules/__init__.py,sha256=ejmeNK9L-yGUX3pGr_1-HlPcCdrf7XPLFVZ3OR0mmno,1954
|
|
139
139
|
ultralytics/nn/modules/block.py,sha256=1bi5rRzHNTg10VlRdpRP_xjTJHEIfMQ1FY2nIgHKmws,14488
|
|
140
140
|
ultralytics/nn/modules/conv.py,sha256=ndUYNL2f9DK41y1vVbtEusMByXy-LMMsBKlcWjRQ9Z8,12722
|
|
141
|
-
ultralytics/nn/modules/head.py,sha256=
|
|
141
|
+
ultralytics/nn/modules/head.py,sha256=X1xLqdONY-kRkM60WaiYfMZEnRUe6CX_zqtOyAzifmQ,19535
|
|
142
142
|
ultralytics/nn/modules/transformer.py,sha256=TgDpTjSkk1_-9IrIjm8bebcG5fSO9GVb5Onz0cdR21Q,17910
|
|
143
143
|
ultralytics/nn/modules/utils.py,sha256=6CCeDy6GGkDM7XjGm4FCtVpXoEuICIPCsruI8etNS3g,3197
|
|
144
144
|
ultralytics/solutions/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
@@ -153,7 +153,7 @@ ultralytics/trackers/bot_sort.py,sha256=39AvhYVbT7izF3--rX_e6Lhgb5czTA23gw6AgnNc
|
|
|
153
153
|
ultralytics/trackers/byte_tracker.py,sha256=AQWpI-msOewPqPLnhvMTO_8Pk565IEd_ny6VvQQgMwk,18871
|
|
154
154
|
ultralytics/trackers/track.py,sha256=dl4qu2t3f_ZCUJqJqnrxDDXWfbpPdRFZVE8WGkcRFMg,3091
|
|
155
155
|
ultralytics/trackers/utils/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
156
|
-
ultralytics/trackers/utils/gmc.py,sha256=
|
|
156
|
+
ultralytics/trackers/utils/gmc.py,sha256=S3NKaY4X8iM36dViWBuzArJSHtxbGdsNHLvoJUROzVk,13798
|
|
157
157
|
ultralytics/trackers/utils/kalman_filter.py,sha256=JN1sAcfJZy8fTZxc8w3jUJnGQDKtgAL__p4nTR6RM2I,15168
|
|
158
158
|
ultralytics/trackers/utils/matching.py,sha256=c_pthBfu9sWeMVYe-dSecdWcQxUey-mQT2yMVsFH3VQ,5404
|
|
159
159
|
ultralytics/utils/__init__.py,sha256=iCP2iY1J4ZQ15fT6_uMOIWvAf19F1ZWBWlEKXGqSSBA,36882
|
|
@@ -180,14 +180,14 @@ ultralytics/utils/callbacks/clearml.py,sha256=K7bDf5tS8xL4KeFMkoVDL2kKkil3f4qoKy
|
|
|
180
180
|
ultralytics/utils/callbacks/comet.py,sha256=9mLgOprENliphnxfd8iTwtkdhS6eR7J7-q4YWaHL0So,13744
|
|
181
181
|
ultralytics/utils/callbacks/dvc.py,sha256=WIClMsuvhiiyrwRv5BsZLxjsxYNJ3Y8Vq7zN0Bthtro,5045
|
|
182
182
|
ultralytics/utils/callbacks/hub.py,sha256=11L-5KK46HvB8uPouGupzZhwjfTpvKOM3L95zXTAjF0,3402
|
|
183
|
-
ultralytics/utils/callbacks/mlflow.py,sha256=
|
|
183
|
+
ultralytics/utils/callbacks/mlflow.py,sha256=JckTC8e8VPfpJTxNbPWuSINP62Y8VeNlAEn27oOMvFo,4909
|
|
184
184
|
ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyzC5q7p4ipQ,3756
|
|
185
185
|
ultralytics/utils/callbacks/raytune.py,sha256=6OgGNuC35F29lw8Dl_d0lue4-iBR6dqrBVQnIRQDx4E,632
|
|
186
186
|
ultralytics/utils/callbacks/tensorboard.py,sha256=fyhgBgcTmEIifBqxBJkoMZ6yQNBGhSLQBAsy770-RtA,4038
|
|
187
187
|
ultralytics/utils/callbacks/wb.py,sha256=03ACY2YwpTRigD0ZQH7_zlpwMdGw0lt23zX4d5Zaz28,6650
|
|
188
|
-
ultralytics-8.1.
|
|
189
|
-
ultralytics-8.1.
|
|
190
|
-
ultralytics-8.1.
|
|
191
|
-
ultralytics-8.1.
|
|
192
|
-
ultralytics-8.1.
|
|
193
|
-
ultralytics-8.1.
|
|
188
|
+
ultralytics-8.1.10.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
189
|
+
ultralytics-8.1.10.dist-info/METADATA,sha256=5HlHiyGCzzyTtYKRPLmt6egKtVS1lfg7QhpIXH1Ziqo,40205
|
|
190
|
+
ultralytics-8.1.10.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
191
|
+
ultralytics-8.1.10.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
192
|
+
ultralytics-8.1.10.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
193
|
+
ultralytics-8.1.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|