Skip to content

Instantly share code, notes, and snippets.

@jerbly
Created February 27, 2021 21:56
f,p = plt.subplots(1,1)
show_img(draw_pred(samples[0]["img"], preds[0], class_map=class_map, denormalize_fn=denormalize_imagenet), ax=p)
img_bytes = io.BytesIO()
f.savefig(img_bytes, format='png', bbox_inches="tight")
img_b64 = base64.b64encode(img_bytes.getvalue()).decode("utf-8").replace("\n", "")
img_b64 = f'data:image/png;base64,{img_b64}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment