Created
October 25, 2018 08:32
-
-
Save everling-prime/b57d1987c8f0e7011610bc0669ec49cf to your computer and use it in GitHub Desktop.
This function takes an image (URL) and returns a string list of tags predicted by Clarifai
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
from clarifai.rest import ClarifaiApp | |
app = ClarifaiApp() | |
def get_concept_tags(image_url): | |
response_data = app.tag_urls([image_url]) | |
tags = [] | |
for concept in response_data['outputs'][0]['data']['concepts']: | |
tags.append(concept['name']) | |
return tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment