Add coordinates generation implementation
This commit is contained in:
@@ -21,6 +21,24 @@ class MyTestCase(unittest.TestCase):
|
||||
|
||||
# TODO: Element-wise checks...
|
||||
|
||||
def test_coordinates(self):
|
||||
height = 1000
|
||||
width = 2000
|
||||
coords = warp.image_coordinate(8, height, width)
|
||||
|
||||
self.assertEqual(coords.shape, [8, height, width, 3])
|
||||
self.assertEqual(coords[0, 0, 0, 0], 0)
|
||||
self.assertEqual(coords[0, 0, 0, 1], 0)
|
||||
self.assertEqual(coords[0, 0, 0, 2], 1)
|
||||
|
||||
self.assertEqual(coords[0, height - 1, 0, 0], 0)
|
||||
self.assertEqual(coords[0, height - 1, 0, 1], height - 1)
|
||||
self.assertEqual(coords[0, height - 1, 0, 2], 1)
|
||||
|
||||
self.assertEqual(coords[0, height - 1, width - 1, 0], width - 1)
|
||||
self.assertEqual(coords[0, height - 1, width - 1, 1], height - 1)
|
||||
self.assertEqual(coords[0, height - 1, width - 1, 2], 1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user