Skip to content

Instantly share code, notes, and snippets.

@kunal732
Created April 8, 2018 07:18
Show Gist options
  • Save kunal732/0560822d3005f1b2578ab8137bb0da52 to your computer and use it in GitHub Desktop.
Save kunal732/0560822d3005f1b2578ab8137bb0da52 to your computer and use it in GitHub Desktop.
Calling the Clarifai Celebrity model.
from clarifai.rest import ClarifaiApp
from clarifai.rest import Image as ClImage
#put api key
app = ClarifaiApp(api_key='')
model = app.models.get('celeb-v1.3')
#put photo url below
image = ClImage(url='')
response = model.predict([image])
celeb_concepts = response['outputs'][0]['data']['regions'][0]['data']['face']['identity']['concepts']
for concept in celeb_concepts:
print(concept['name'], concept['value'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment