Create a mask. Args: image (`PIL.Image.Image`): The image input, should be a PIL image. Returns: `PIL.Image.Image`: The binarized image. Values less than 0.5 are set to 0, values greater than 0.5 are set to 1.
(self, image: PIL.Image.Image)
| 384 | return image |
| 385 | |
| 386 | def binarize(self, image: PIL.Image.Image) -> PIL.Image.Image: |
| 387 | """ |
| 388 | Create a mask. |
| 389 | |
| 390 | Args: |
| 391 | image (`PIL.Image.Image`): |
| 392 | The image input, should be a PIL image. |
| 393 | |
| 394 | Returns: |
| 395 | `PIL.Image.Image`: |
| 396 | The binarized image. Values less than 0.5 are set to 0, values greater than 0.5 are set to 1. |
| 397 | """ |
| 398 | image[image < 0.5] = 0 |
| 399 | image[image >= 0.5] = 1 |
| 400 | |
| 401 | return image |
| 402 | |
| 403 | def get_default_height_width( |
| 404 | self, |
no outgoing calls
no test coverage detected