Skip to content

Instantly share code, notes, and snippets.

View cscheid's full-sized avatar

Carlos Scheidegger cscheid

View GitHub Profile
@mrkn
mrkn / rgb2lab.py
Last active March 19, 2018 20:03
color space conversion from RGB to CIELAB in PIL/Pillow (Japanese article) ref: http://qiita.com/mrkn/items/670e1622d41d2dcd26b4
from PIL import Image, ImageCms
im = Image.open(image_path)
if im.mode != "RGB":
im = im.convert("RGB")
srgb_profile = ImageCms.createProfile("sRGB")
lab_profile = ImageCms.createProfile("LAB")
rgb2lab_transform = ImageCms.buildTransformFromOpenProfiles(srgb_profile, lab_profile, "RGB", "LAB")
Q: what book should i use to learn ML?
A: use several, and find the one that speaks to you.
the list below assumes you know a bit of math but
are not very mathematical, and are interested in learning
enough to be practical. that is, it is not at the
mathematical level of MIJ's alleged list
(cf. https://news.ycombinator.com/item?id=1055389 )
@limulus
limulus / tucsonjs-0.md
Last active August 29, 2015 14:06
TucsonJS: JavaScript, SVGs and Cacti – Install Instructions and Links
@cpsievert
cpsievert / osm.R
Created January 15, 2014 19:03
Manipulating XML from Open Street Map with XML2R
setwd("~/Downloads")
obs <- XML2Obs("out.xml", url.map=TRUE)
unique(names(obs)) #you might want to re_name or add_key before collapsing
tables <- collapse(obs)
head(tables[["osm//node//tag"]])
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'