diff --git a/IndicoIo/images/facial_features.py b/IndicoIo/images/facial_features.py index e69de29..0ac9775 100644 --- a/IndicoIo/images/facial_features.py +++ b/IndicoIo/images/facial_features.py @@ -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)