fix(pre_commit): 🎨 auto format pre-commit hooks
This commit is contained in:
1 parent
6387513805
commit
ec0add34ee
1 file changed
+28
-11
@@ -1411,23 +1411,40 @@ def test_xyxy_to_xywh(xyxy: np.ndarray, expected_result: np.ndarray) -> None:
|
||||
[
|
||||
# Empty and zero cases
|
||||
(np.array([]).reshape(0, 4), np.array([]).reshape(0, 4)), # empty array
|
||||
(np.array([[0, 0, 0, 0]]), np.array([[0, 0, 0.0, 0]])), # zero size bounding box
|
||||
(np.array([[10, 10, 10, 10]]), np.array([[10, 10, 0.0, 0]])), # point (x1=x2, y1=y2)
|
||||
|
||||
(
|
||||
np.array([[0, 0, 0, 0]]),
|
||||
np.array([[0, 0, 0.0, 0]]),
|
||||
), # zero size bounding box
|
||||
(
|
||||
np.array([[10, 10, 10, 10]]),
|
||||
np.array([[10, 10, 0.0, 0]]),
|
||||
), # point (x1=x2, y1=y2)
|
||||
# Zero width/height cases
|
||||
(np.array([[50, 50, 80, 50]]), np.array([[65, 50, 0.0, 0]])), # zero height
|
||||
(np.array([[50, 50, 50, 80]]), np.array([[50, 65, 0.0, 30]])), # zero width
|
||||
|
||||
# Standard cases
|
||||
(np.array([[10, 20, 40, 60]]), np.array([[25, 40, 0.75, 40]])), # standard case
|
||||
(np.array([[-30, -40, -10, -20]]), np.array([[-20, -30, 1.0, 20]])), # all negative values
|
||||
(np.array([[0.1, 0.2, 0.4, 0.6]]), np.array([[0.25, 0.4, 0.75, 0.4]])), # values between 0-1
|
||||
|
||||
(
|
||||
np.array([[-30, -40, -10, -20]]),
|
||||
np.array([[-20, -30, 1.0, 20]]),
|
||||
), # all negative values
|
||||
(
|
||||
np.array([[0.1, 0.2, 0.4, 0.6]]),
|
||||
np.array([[0.25, 0.4, 0.75, 0.4]]),
|
||||
), # values between 0-1
|
||||
# Different aspect ratios
|
||||
(np.array([[10, 20, 50, 100]]), np.array([[30, 60, 0.5, 80]])), # tall rectangle (height > width)
|
||||
(np.array([[20, 10, 100, 50]]), np.array([[60, 30, 2.0, 40]])), # wide rectangle (width > height)
|
||||
(np.array([[50, 50, 150, 150]]), np.array([[100, 100, 1.0, 100]])), # height == width
|
||||
|
||||
(
|
||||
np.array([[10, 20, 50, 100]]),
|
||||
np.array([[30, 60, 0.5, 80]]),
|
||||
), # tall rectangle (height > width)
|
||||
(
|
||||
np.array([[20, 10, 100, 50]]),
|
||||
np.array([[60, 30, 2.0, 40]]),
|
||||
), # wide rectangle (width > height)
|
||||
(
|
||||
np.array([[50, 50, 150, 150]]),
|
||||
np.array([[100, 100, 1.0, 100]]),
|
||||
), # height == width
|
||||
# Multiple boxes in one array
|
||||
(
|
||||
np.array([[0, 0, 0, 0], [10, 20, 40, 60]]),
|
||||
|
||||
Reference in new issue
Block a user