Skip to content

Commit

Permalink
fixing some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JSabadin committed Oct 4, 2024
1 parent 20f788b commit 62b64c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_augmentations/test_mosaic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

def test_mosaic4():
img = (np.random.rand(HEIGHT, WIDTH, 3) * 255).astype(np.uint8)
mosaic = mosaic4([img, img, img, img], HEIGHT, WIDTH)
mosaic = mosaic4([img, img, img, img], HEIGHT, WIDTH, 0, 0, 0)
assert mosaic.shape == (HEIGHT, WIDTH, 3)


def test_bbox_mosaic4():
bbox = (0, 0, WIDTH, HEIGHT)
for i in range(4):
mosaic_bbox = bbox_mosaic4(
bbox, HEIGHT // 2, WIDTH // 2, i, HEIGHT, WIDTH
bbox, HEIGHT // 2, WIDTH // 2, i, HEIGHT, WIDTH, 0, 0
)
assert pytest.approx(mosaic_bbox, abs=0.5) == (
0,
Expand All @@ -45,7 +45,7 @@ def test_keypoint_mosaic4():
]
):
mosaic_keypoint = keypoint_mosaic4(
keypoint, HEIGHT // 2, WIDTH // 2, i, HEIGHT, WIDTH
keypoint, HEIGHT // 2, WIDTH // 2, i, HEIGHT, WIDTH, 0, 0
)
assert pytest.approx(mosaic_keypoint, abs=0.25) == (w, h, 0, 0)

Expand Down

0 comments on commit 62b64c6

Please sign in to comment.