Skip to content

Instantly share code, notes, and snippets.

@NickEngmann NickEngmann/
Created Aug 22, 2018

What would you like to do?
Snapshop code changes for Major League Hacking
from import ClarifaiApp
from import Image as ClImage
app = ClarifaiApp(api_key='YOUR_API_KEY')
# import a few labelled images
def main():
app = ClarifaiApp(api_key='YOUR_API_KEY')
def get_tags(image_url):
model = app.models.get('general-v1.3')
image = ClImage(url=image_url)
response = model.predict([image])
concepts = response['outputs'][0]['data']['concepts']
model = app.models.get('laptops')
model.model_version = 'MODEL_VERSION_ID'
custom_response = model.predict([image])
custom_concepts = custom_response['outputs'][0]['data']['concepts']
concepts = custom_concepts + concepts
return concepts;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.