MCPcopy
hub / github.com/ttengwang/Caption-Anything / get_image_shape

Function get_image_shape

caption_anything/utils/utils.py:61–69  ·  view source on GitHub ↗
(image)

Source from the content-addressed store, hash-verified

59
60
61def get_image_shape(image):
62 if isinstance(image, str):
63 return Image.open(image).size
64 elif isinstance(image, np.ndarray):
65 return image.shape
66 elif isinstance(image, Image.Image):
67 return image.size
68 else:
69 raise NotImplementedError
70
71def is_platform_win():
72 return sys.platform == "win32"

Callers 3

parse_dense_captionMethod · 0.90
parse_ocrMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected