Get the spatial shape of image data, it doesn't contain the channel dim. Args: img: a PIL Image object loaded from an image file.
(self, img)
| 1437 | return {"format": img.format, "mode": img.mode, "width": img.width, "height": img.height} |
| 1438 | |
| 1439 | def _get_spatial_shape(self, img): |
| 1440 | """ |
| 1441 | Get the spatial shape of image data, it doesn't contain the channel dim. |
| 1442 | Args: |
| 1443 | img: a PIL Image object loaded from an image file. |
| 1444 | """ |
| 1445 | return np.asarray((img.width, img.height)) |
| 1446 | |
| 1447 | |
| 1448 | @dataclass |