Skip to content

Instantly share code, notes, and snippets.

View arquolo's full-sized avatar

Paul Maevskikh arquolo

  • PathVision.ai
  • Planet Earth
View GitHub Profile
@kylemcdonald
kylemcdonald / notebook_images.py
Created December 12, 2016 02:04
Some tools for drawing pixel-accurate images in Jupyter notebooks with Python.
from cStringIO import StringIO
import numpy as np
import math
import PIL.Image
import IPython.display
import shutil
def show_array(a, fmt='png', filename=None):
a = np.uint8(np.clip(a, 0, 255))
image_data = StringIO()