MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / base64_decode_image

Function base64_decode_image

imutils/encodings.py:14–27  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

12 a.shape])
13
14def base64_decode_image(a):
15 # grab the array, data type, and shape from the JSON-decoded object
16 (a, dtype, shape) = json.loads(a)
17
18 # if this is Python 3, then we need the extra step of encoding the
19 # string as byte object
20 if sys.version_info.major == 3:
21 a = bytes(a, encoding="utf-8")
22
23 # set the correct data type and reshape the matrix into an image
24 a = base64_decode_array(a, dtype).reshape(shape)
25
26 # return the loaded image
27 return a
28
29def base64_encode_array(a):
30 # return the base64 encoded array

Callers

nothing calls this directly

Calls 1

base64_decode_arrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…