diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-14 20:22:19 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-14 20:22:19 +0200 |
| commit | 7a1f5eb87d71acd5466b08a23ee0f98ea7edf28c (patch) | |
| tree | f9bd95006105394469a67af8cfe6db115eba4b7f /check/app/server | |
| parent | 890586175ff054cc01d39f9931ab2e4bae62c1e1 (diff) | |
add phash script
Diffstat (limited to 'check/app/server')
| -rw-r--r-- | check/app/server/api.py | 6 | ||||
| l--------- | check/app/server/static | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/check/app/server/api.py b/check/app/server/api.py index 5c5b4bf..12d955b 100644 --- a/check/app/server/api.py +++ b/check/app/server/api.py @@ -6,6 +6,7 @@ from flask import Blueprint, request, jsonify from PIL import Image # from app.utils.im_utils import pil2np +from app.models.sql_factory import search_by_phash, add_phash sanitize_re = re.compile('[\W]+') valid_exts = ['.gif', '.jpg', '.jpeg', '.png'] @@ -19,8 +20,9 @@ def index(): """API status noop""" return jsonify({ 'status': 'ok' }) -@api.route('/v1/match/') -def match(): +@api.route('/v1/match/', methods=['POST']) +def upload(): """Search by image""" + start = time.time() # get threshold return jsonify({ 'status': 'ok' }) diff --git a/check/app/server/static b/check/app/server/static new file mode 120000 index 0000000..382349a --- /dev/null +++ b/check/app/server/static @@ -0,0 +1 @@ +../../static/
\ No newline at end of file |
