Created
May 30, 2019 08:48
-
-
Save peune/ad9b7aa6668527867aa36412fb576543 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
def _image_url(img): | |
retval, buffer = cv2.imencode('.jpg', img) | |
base64_byte_string = base64.b64encode(buffer).decode('utf-8') | |
return "data:image/JPEG;base64," + base64_byte_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment