Skip to content

Instantly share code, notes, and snippets.

@besirkurtulmus
Last active August 1, 2017 18:08
Show Gist options
  • Save besirkurtulmus/21d7c6ac2771f84411fe5150d8faecb5 to your computer and use it in GitHub Desktop.
Save besirkurtulmus/21d7c6ac2771f84411fe5150d8faecb5 to your computer and use it in GitHub Desktop.
Getting an Image from Algorithmia
import Algorithmia
client = Algorithmia.client("YOUR_API_KEY")
# We're going to use the deeplearning/ColorfulImageColorization algorithm as an Example
example_image_url = "https://en.wikipedia.org/wiki/Abraham_Lincoln#/media/File:A%26TLincoln.jpg"
algo_input = {
"image": example_image_url
}
res = client.algo("deeplearning/ColorfulImageColorization").pipe(algo_input).result
colorized_image_dataAPI_url = res["output"]
# Now we want to get the local path to the image.
local_abs_colorized_image_path = client.file(colorized_image_dataAPI_url).getFile().name
# Print the local path to the colorized image
print local_abs_colorized_image_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment