Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added longest max size augmentation #44

Merged
merged 2 commits into from
Aug 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
pep fixes
  • Loading branch information
ternaus committed Aug 13, 2018
commit af6bf39b296ee3d9c222f3211198c3fd37356375
7 changes: 3 additions & 4 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,16 +624,15 @@ def test_longest_max_size(target):
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]], dtype=np.uint8)
expected = np.array([[ 2, 3],
[ 6, 7],
[10, 11]], dtype=np.uint8)
expected = np.array([[2, 3],
[6, 7],
[10, 11]], dtype=np.uint8)

img, expected = convert_2d_to_target_format([img, expected], target=target)
scaled = F.longest_max_size(img, longest_max_size=3, interpolation=cv2.INTER_LINEAR)
assert np.array_equal(scaled, expected)



def test_from_float_unknown_dtype():
img = np.ones((100, 100, 3), dtype=np.float32)
with pytest.raises(RuntimeError) as exc_info:
Expand Down