(array_type)
| 117 | |
| 118 | |
| 119 | def gen_fixed_img(array_type): |
| 120 | img = np.array( |
| 121 | [ |
| 122 | [0, 0, 0, 1, 1, 1, 1], |
| 123 | [0, 0, 0, 1, 1, 1, 1], |
| 124 | [0, 0, 1, 1, 1, 1, 1], |
| 125 | [0, 1, 1, 1, 1, 1, 1], |
| 126 | [1, 1, 1, 1, 1, 1, 1], |
| 127 | ], |
| 128 | dtype=np.float32, |
| 129 | ) |
| 130 | batch_size, channels = 10, 6 |
| 131 | img = array_type(np.tile(img, (batch_size, channels, 1, 1))) |
| 132 | expected_output_for_img = array_type( |
| 133 | [ |
| 134 | [0, 0, 0, 1, 1, 1, 1], |
| 135 | [0, 0, 0, 1, 0, 0, 1], |
| 136 | [0, 0, 1, 1, 0, 0, 1], |
| 137 | [0, 1, 1, 0, 0, 0, 1], |
| 138 | [1, 1, 1, 1, 1, 1, 1], |
| 139 | ] |
| 140 | ) |
| 141 | return img, expected_output_for_img |
| 142 | |
| 143 | |
| 144 | class TestContour(unittest.TestCase): |
no test coverage detected
searching dependent graphs…