Last active
August 1, 2017 18:08
-
-
Save besirkurtulmus/21d7c6ac2771f84411fe5150d8faecb5 to your computer and use it in GitHub Desktop.
Getting an Image from Algorithmia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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