b64_image.py 218 Bytes RawBlameHistoryPermalink 1 2 3 4 5 6 7 8 9 from base64 import b64decode import cv2 import numpy as np def to_img(b64_str: str): binary = b64decode(b64_str) np_array = np.frombuffer(binary, np.uint8) return cv2.imdecode(np_array, cv2.IMREAD_COLOR)