Skip to content

Commit

Permalink
Update test_image_filter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ASEM000 committed Sep 12, 2023
1 parent 4a2a441 commit 70602ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_image_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,10 @@ def test_laplacian():
sk.image.Filter2D(kernel)(x),
atol=1e-5,
)


def test_center_crop():
x = jnp.arange(1, 26).reshape(1, 5, 5)
assert sk.image.CenterCrop2D(3)(x).shape == (1, 3, 3)
assert sk.image.CenterCrop2D(0)(x).shape == (1, 0, 0)
npt.assert_allclose(sk.image.CenterCrop2D(3)(x), x[:, 1:-1, 1:-1])

0 comments on commit 70602ed

Please sign in to comment.