(image)
| 132 | |
| 133 | |
| 134 | def create_binary_mask(image): |
| 135 | if image.mode == 'RGBA' and image.getextrema()[-1] != (255, 255): |
| 136 | image = image.split()[-1].convert("L").point(lambda x: 255 if x > 128 else 0) |
| 137 | else: |
| 138 | image = image.convert('L') |
| 139 | return image |
| 140 | |
| 141 | |
| 142 | def images_tensor_to_samples(image, approximation=None, model=None): # pylint: disable=unused-argument |
no test coverage detected