Skip to content

Instantly share code, notes, and snippets.

@symisc
Created October 23, 2017 04:01
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 symisc/1d2434e3d9dec4ee4a4743e4d05d3ec9 to your computer and use it in GitHub Desktop.
Save symisc/1d2434e3d9dec4ee4a4743e4d05d3ec9 to your computer and use it in GitHub Desktop.
Grayscale image colorization using deep learning models via the PixLab /colorize API endpoint. https://pixlab.io/cmd?id=colorize
import requests
import json
# Colorize this 1933 picture of this little girl via: https://pixlab.io/cmd?id=colorize
req = requests.get('https://api.pixlab.io/colorize',params={'img':'https://i.redd.it/7z1q27vaa9tz.png','key':'My_PixLab_Key'})
reply = req.json()
if reply['status'] != 200:
print (reply['error'])
else:
print ("Link to the colorized picture: "+ reply['link'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment