Skip to content

Commit

Permalink
Add test for scale_shape.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Morariu committed Aug 24, 2017
1 parent 9a97b76 commit c99abf3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/preprocessing/test_object_detection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import keras_rcnn.preprocessing._object_detection
import numpy


def test_scale_shape():
min_size = 200
max_size = 300
shape = (600, 1000, 3)

shape, scale = keras_rcnn.preprocessing._object_detection.scale_shape(shape, min_size, max_size)

expected = (180, 300, 3)
numpy.testing.assert_equal(shape, expected)

expected = 0.3
assert numpy.isclose(scale, expected)

0 comments on commit c99abf3

Please sign in to comment.