MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / read_img_general

Function read_img_general

accessory/data/data_reader.py:6–13  ·  view source on GitHub ↗
(img_path)

Source from the content-addressed store, hash-verified

4Image.MAX_IMAGE_PIXELS = None
5
6def 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
15def init_ceph_client_if_needed():
16 global client

Callers 1

get_item_funcMethod · 0.85

Calls 1

Tested by

no test coverage detected