Skip to content

Instantly share code, notes, and snippets.

@dbuscombe-usgs
Last active December 20, 2015 06:19
Show Gist options
  • Save dbuscombe-usgs/6085352 to your computer and use it in GitHub Desktop.
Save dbuscombe-usgs/6085352 to your computer and use it in GitHub Desktop.
Auto-Classify images, part 1. First, import the libraries you'll need. Then interrogates the website and downloads the images.
try: import simplejson as json
except ImportError: import json
import os
import urllib, urlparse
import glob
import numpy as np
import Image
from itertools import combinations
import simplejson as json
import pylab as mpl
c = urllib.urlopen(url)
j =json.loads(c.read())
imurls=[]
for im in j['photos']:
imurls.append(im['photo_file_url'])
for url in imurls:
image = urllib.URLopener()
image.retrieve(url,os.path.basename(urlparse.urlparse(url).path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment