Skip to content

Instantly share code, notes, and snippets.

@kunal732
Created January 31, 2018 20:42
Show Gist options
  • Save kunal732/952cd01c65754cf6e01fe856ca7205bb to your computer and use it in GitHub Desktop.
Save kunal732/952cd01c65754cf6e01fe856ca7205bb to your computer and use it in GitHub Desktop.
Sample Clarifai App
from clarifai.rest import ClarifaiApp
from clarifai.rest import Image as ClImage
app = ClarifaiApp(api_key='your_api_key')
model = app.models.get('general-v1.3')
image = ClImage(url='https://samples.clarifai.com/metro-north.jpg')
response = model.predict([image])
concepts = response['outputs'][0]['data']['concepts']
for concept in concepts:
print(concept['name'], concept['value'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment