MCPcopy Create free account
hub / github.com/modelscope/modelscope / decode_base64_to_image

Function decode_base64_to_image

modelscope/utils/service_utils.py:90–94  ·  view source on GitHub ↗
(encoding)

Source from the content-addressed store, hash-verified

88
89
90def decode_base64_to_image(encoding):
91 from PIL import Image
92 content = encoding.split(';')[1]
93 image_encoded = content.split(',')[1]
94 return Image.open(BytesIO(base64.b64decode(image_encoded)))
95
96
97def encode_array_to_img_base64(image_array):

Callers 2

ExampleDecoderFunction · 0.70
service_data_decoderFunction · 0.70

Calls 1

openMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…