Skip to content

Instantly share code, notes, and snippets.

@awesomebytes
Last active May 1, 2019 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awesomebytes/51a607a8ce4ae195bd106a65941bd188 to your computer and use it in GitHub Desktop.
Save awesomebytes/51a607a8ce4ae195bd106a65941bd188 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import numpy as np
height = 100
width = 100
blank_image = np.zeros((height, width, 3), np.uint8)
from IPython import embed; embed()
# Check what variables are around
dir()
# Print anything
blank_image
print(blank_image)
import pprint
pprint(blank_image)
# Show an image maybe? (1)
from matplotlib import pyplot as plt
plt.imshow(blank_image)
plt.show()
# Show an image maybe? (2)
import cv2
cv2.imshow('test', blank_image)
cv2.waitKey(5)
cv2.destroyAllWindows()
# Dump data to debug in isolation
import cPickle
cPickle.dump(blank_image, open("blank_image.pickle", 'w'))
# Load some data you know it's correct/conflicting into the running process
import cPickle
debug_image = cPickle.load(open("blank_image.pickle", 'r'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment