(img_path)
| 4 | Image.MAX_IMAGE_PIXELS = None |
| 5 | |
| 6 | def read_img_general(img_path): |
| 7 | if "s3://" in img_path: |
| 8 | init_ceph_client_if_needed() |
| 9 | img_bytes = client.get(img_path) |
| 10 | image = Image.open(BytesIO(img_bytes)).convert('RGB') |
| 11 | return image |
| 12 | else: |
| 13 | return Image.open(img_path).convert('RGB') |
| 14 | |
| 15 | def init_ceph_client_if_needed(): |
| 16 | global client |
no test coverage detected