def test_api_init(self): api = ApiClient() if os.environ.get('CLARIFAI_API_KEY'): key = os.environ['CLARIFAI_API_KEY'] api = ApiClient(api_key=key) if os.environ.get('CLARIFAI_API_BASE'): api_base = os.environ['CLARIFAI_API_BASE'] api = ApiClient(api_key=key, base_url=api_base)
def test_shorcut_predict_functions(self): img1 = ClImage(url=urls[0]) api = ApiClient() api.predict_concepts([img1]) api.predict_colors([img1]) api.predict_embed([img1])
from clarifai.rest import ApiClient, Image from flask import Flask, request, redirect, url_for, send_from_directory from clarifai.client import ClarifaiApi import json app_id = "-Vi-qtSkO7YoquYqPUbjR-In9G74Y7TYoAyQsnA5" app_secret = "VaVyBbyvmnpoyvOehbDjsnh284T7Nx751LkSVd5H" ## API Client clarifai_api = ClarifaiApi() #################################################################################################### ## create our endpoint ##Debug: print "Recieving access token:\n " api = ApiClient(client_id=app_id, client_secret=app_secret) ######################################## sample images for debuggin ################################# img1 = Image( url= 'https://www.royalcanin.com/~/media/Royal-Canin/Product-Categories/cat-adult-landing-hero.ashx', labels=['cat']) img2 = Image( url= 'http://static.independent.co.uk/s3fs-public/styles/article_large/public/thumbnails/image/2016/02/25/13/cat-getty_0.jpg', labels=['cat']) img3 = Image(url='http://www.lafayettecountyhealth.org/ThreePeople.jpg') ######################################## images for a programmer ##################################### computer_img1 = Image( url='https://static.pexels.com/photos/6218/desk-laptop-notebook-table.jpg', labels=['computer'])
def setUpClass(cls): cls.api = ApiClient(log_level=logging.WARN) cls.app = ClarifaiApp(log_level=logging.WARN)
def setUpClass(cls): cls.api = ApiClient()
def setUpClass(cls): cls.api = ApiClient(log_level=logging.WARN)