mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-06-27 16:10:34 +08:00
facial features api working
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import json
|
||||
|
||||
import requests
|
||||
import numpy as np
|
||||
|
||||
TEST_GOOD_FACE = np.linspace(0,50,48*48).reshape(48,48).tolist()
|
||||
TEST_BAD_FACE = np.linspace(0,50,56*56).reshape(56,56).tolist()
|
||||
|
||||
base_url = lambda c: "http://localhost/api/features/%s" % c
|
||||
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
||||
|
||||
def facial(face):
|
||||
data_dict = json.dumps({"datums": face})
|
||||
response = requests.post(base_url("facial"), data=data_dict, headers=headers)
|
||||
return response.content
|
||||
|
||||
print facial(TEST_BAD_FACE)
|
||||
|
||||
Reference in New Issue
Block a user