Run pre-commit and fix issues

This commit is contained in:
Eric Criteser
2024-07-11 14:42:13 -05:00
parent 60d5660286
commit 7fa7907219
2 changed files with 7 additions and 3 deletions
@@ -28,8 +28,10 @@ def move_detections(
(sv.Detections) repositioned Detections object.
"""
detections.xyxy = move_boxes(xyxy=detections.xyxy, offset=offset)
if 'xyxyxyxy' in detections:
detections.xyxyxyxy = move_obb_boxes(xyxyxyxy = detections.xyxyxyxy, offset = offset)
if "xyxyxyxy" in detections:
detections.xyxyxyxy = move_obb_boxes(
xyxyxyxy=detections.xyxyxyxy, offset=offset
)
if detections.mask is not None:
if resolution_wh is None:
raise ValueError(
+3 -1
View File
@@ -595,6 +595,7 @@ def move_boxes(
"""
return xyxy + np.hstack([offset, offset])
def move_obb_boxes(xyxyxyxy, offset):
"""
Parameters:
@@ -604,7 +605,7 @@ def move_obb_boxes(xyxyxyxy, offset):
is `[dx, dy]`.
Returns:
npt.NDArray[np.float64]: Repositioned oriented bounding boxes.
npt.NDArray[np.float64]: Repositioned oriented bounding boxes.
Examples:
```python
@@ -623,6 +624,7 @@ def move_obb_boxes(xyxyxyxy, offset):
return xyxyxyxy + np.hstack([offset, offset, offset, offset])
def move_masks(
masks: npt.NDArray[np.bool_],
offset: npt.NDArray[np.int32],