Skip to content

Instantly share code, notes, and snippets.

@davidbrough1
Last active August 29, 2015 14:06
Show Gist options
  • Save davidbrough1/65fbce77bef5501fb85e to your computer and use it in GitHub Desktop.
Save davidbrough1/65fbce77bef5501fb85e to your computer and use it in GitHub Desktop.
'''
The code takes the url of an image and converts it into a numpy array.
'''
import matplotlib.pylab as plt
import numpy as np
import cStringIO
import Image
import urllib
file = cStringIO.StringIO(urllib.urlopen(url_sim_data).read())
url_sim_data = 'https://farm4.staticflickr.com/<the_rest_of_the_url>.jpg'
img = Image.open(file)
data = np.asarray(img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment