diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 22:47:28 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-15 22:47:28 +0100 |
| commit | a53a598461a25e8bf1d0bd3e63c47642e3213aef (patch) | |
| tree | 25fd8abc3d5ad1bbef9eeb96d86e0170d6f55dc6 /megapixels | |
| parent | f91c6d8e870bd3b2c69a130e4b1ed8f6be250b92 (diff) | |
client stuff
Diffstat (limited to 'megapixels')
| -rw-r--r-- | megapixels/app/server/api.py | 26 | ||||
| -rw-r--r-- | megapixels/cli_flask.py | 1 |
2 files changed, 26 insertions, 1 deletions
diff --git a/megapixels/app/server/api.py b/megapixels/app/server/api.py index c5e27dd2..cd2b950b 100644 --- a/megapixels/app/server/api.py +++ b/megapixels/app/server/api.py @@ -23,8 +23,10 @@ def show(name): else: return jsonify({ 'status': 404 }) -@api.route('/dataset/<dataset>/face', methods=['POST']) +@api.route('/dataset/<name>/face', methods=['POST']) def upload(name): + start = time.time() + dataset = get_dataset(name) file = request.files['query_img'] fn = file.filename if fn.endswith('blob'): @@ -42,6 +44,28 @@ def upload(name): # print(vec.shape) # results = db.search(vec, limit=limit) + # with the result we have an ID + # query the sql dataset for the UUID etc here + + query = { + 'timing': time.time() - start, + } + results = [] + + print(results) + return jsonify({ + 'query': query, + 'results': results, + }) + +@api.route('/dataset/<name>/name', methods=['GET']) +def name_lookup(dataset): + start = time.time() + dataset = get_dataset(name) + + # we have a query from the request query string... + # use this to do a like* query on the identities_meta table + query = { 'timing': time.time() - start, } diff --git a/megapixels/cli_flask.py b/megapixels/cli_flask.py index 369bec01..e80526c6 100644 --- a/megapixels/cli_flask.py +++ b/megapixels/cli_flask.py @@ -1,5 +1,6 @@ # -------------------------------------------------------- # wrapper for flask CLI API +# NB: python cli_flask.py run # -------------------------------------------------------- import click |
