-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Width and height swapped when creating test image in data/synthetic/create_test_image_2d #5373
Description
Describe the bug
When creating a test image with data/synthetic/create_test_image_2d, it looks like the dimensions of the image are defined like (width, height) instead (height, width).
Line 64 in 8aafd88
| image = np.zeros((width, height)) |
This way, it can be a little confusing when creating test images. For example, in NumpyImageTestCase2D, we pass the dimensions as create_test_image_2d(self.im_shape[0], self.im_shape[1]... in
Line 533 in 1516ca7
| self.im_shape[0], self.im_shape[1], num_objs=4, rad_max=20, noise_max=0.0, num_seg_classes=self.num_classes |
and inside create_test_image_2d, self.im_shape[0] is assign as width and self.im_shape[1] as height, because of the ordering that the args are defined in
Line 22 in 8aafd88
| width: int, |
But when we create a test image using NumpyImageTestCase3D, we still pass the dimensions as create_test_image_3d(self.im_shape[0], self.im_shape[1], self.im_shape[2], ... in
Line 557 in 1516ca7
| self.im_shape[0], |
but this time, self.im_shape[0] is assign as height and self.im_shape[1] as width because of the Args ordering in
Line 98 in 8aafd88
| height: int, |
Additional context
It can make a little confusing to interpret tests like these:
Line 65 in 217f6c6
| expected_shape = (1, self.input_channels, self.im_shape[0], self.im_shape[1]) |
Line 79 in 217f6c6
| expected_shape = (1, self.input_channels, self.im_shape[1], self.im_shape[0], self.im_shape[2]) |
or when creating tests to check the shape of the output of the networks.