import judicious judicious.register("http://127.0.0.1:5000") # judicious.register("https://imprudent.herokuapp.com") src = "https://s3-us-west-1.amazonaws.com/dlgr-faces/a50682accd4d9fb51cf2cbd8f450c0581e471d55d06673d0072c63b8bb3f1ff1.png" description = judicious.describe_face(src=src) print(description)
import judicious as j # BASE_URL = "http://imprudent.herokuapp.com" BASE_URL = "http://127.0.0.1:5000" j.register(BASE_URL) r = j.collect("joke") print(r)
import judicious # judicious.register("http://127.0.0.1:5000") judicious.register("https://imprudent.herokuapp.com") # judicious.seed(2938472374293847239874) src = "https://images.unsplash.com/photo-1489069313310-63735a4f3010" label = judicious.core.post_task("label", parameters={"src": src}) print(label)
import random import time import uuid import requests import judicious # BASE_URL = "http://imprudent.herokuapp.com" BASE_URL = "http://127.0.0.1:5000" judicious.register(BASE_URL) def generate_uuid(): """Generate a UUID from pseudorandom bits.""" return str(uuid.UUID(int=random.getrandbits(128))) def post_task(task_type, task_id=None): """Create a new task.""" if not task_id: task_id = generate_uuid() return requests.post( "{}/tasks/{}".format(BASE_URL, task_id), data={'type': task_type}, ) def get_task(id): """Get the result of an existing task."""