File size: 458 Bytes
be6c755
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import Algorithmia

with open("algo.txt", "r") as infile:
   client_key = infile.read()

client = Algorithmia.client(client_key)
algo = client.algo('tjdevworks/cartoonizer/2.2.2')
algo.set_options(timeout=300)

def api_request(input_file_uri):
    # API call for cartoonization.
    input = {"data_uri": input_file_uri,
            "data_type": 1,
            "datastore": ""
            }
    
    response = algo.pipe(input).result
    
    return response