Skip to content

Instantly share code, notes, and snippets.

@dribnet
Last active August 18, 2017 03:38
Show Gist options
  • Save dribnet/ca82025288d87fa7adcde5a360bd0ca6 to your computer and use it in GitHub Desktop.
Save dribnet/ca82025288d87fa7adcde5a360bd0ca6 to your computer and use it in GitHub Desktop.
Image Exercise MDDN 441 2017
license: mit
downloads
resized
colorgrid
smartgrid
customgrid

Image Exercise MDDN 441 2017

Scrape Montage

Put your own commentary here.

#!/bin/bash
# show commands and stop if there is an error
set -ex
CUDA_VISIBLE_DEVICES="" \
python /usr/local/anaconda/extras/smartgrid.py \
--model color_lab \
--input-glob 'resized/*' \
--aspect-ratio 1.92 \
--drop-to-fit \
--output-path colorgrid
#!/bin/bash
# show commands and stop if there is an error
set -ex
SEARCH_STRING="moon"
# get 5 pages
for PAGE in {1..50}
do
### Uncomment one of the following two (either group or tag)
# this is an example with a group
# URL='https://www.flickr.com/groups/'$SEARCH_STRING'/pool/page'$PAGE
# this is an example with tags
URL='https://www.flickr.com/photos/tags/'$SEARCH_STRING'/page'$PAGE
echo "-------> about to fetch URL: " $URL
sleep 1
# fetch the images
wget --adjust-extension \
--random-wait \
--limit-rate=100k \
--span-hosts \
--convert-links \
--backup-converted \
--no-directories \
--timestamping \
--page-requisites \
--directory-prefix=downloads \
--execute robots=off \
--accept=.jpg \
$URL
# other unused arguments
# --recursive \
# --level 1 \
# --domains en.wikipedia.org \
done
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"></script>
<style>
body {padding: 0; margin: 0;}
#image-map {
width: 960;
height: 500;
border: 1px solid #ccc;
margin-bottom: 10px;
}
</style>
</head>
<body style="background-color:white">
<div id="image-map"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script language="javascript" type="text/javascript" src="settings.js"></script>
<script language="javascript" type="text/javascript" src="zoom_image.js"></script>
<br>
<a href="montage.jpg">full size montage</a><br>
<a href="z_colorgrid.jpg">full size colorgrid</a><br>
<a href="smartgrid.jpg">full size smartgrid</a><br>
</body>
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment