Created
April 21, 2017 18:39
-
-
Save besirkurtulmus/d2297475e96733f8b641f4abc4bfc8c7 to your computer and use it in GitHub Desktop.
How to get direct links to images on 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_GOES_HERE") | |
# this is an example image dataURL you get from: https://algorithmia.com/algorithms/deeplearning/DeepFilter | |
imageDataUrl = "data://.algo/deeplearning/DeepFilter/temp/filtered_image.jpg" | |
# this is the file handler for the image | |
fileHandler = client.file(imageDataUrl).getFile() | |
# this is the absolute file location for the image eg: /tmp/adsAD13b | |
print fileHandler.name | |
# you can upload the file to your image host to get a direct link | |
# Note: upload function here refers to whatever image hosting provider you use | |
uploadFunction(fileHandler.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment