diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-23 13:10:45 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-23 13:10:45 +0200 |
| commit | f5f30912a2efd9c3d47cc9aeaf6a542211b00474 (patch) | |
| tree | 094c4d1e006711b3f7724f2aaf869e21ac5cb406 /check/app/server/api.py | |
| parent | 79f0e696f3f6067a0841a37404fb546dedaa07cb (diff) | |
edits
Diffstat (limited to 'check/app/server/api.py')
| -rw-r--r-- | check/app/server/api.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/check/app/server/api.py b/check/app/server/api.py index 1b17a1e..c4f9f80 100644 --- a/check/app/server/api.py +++ b/check/app/server/api.py @@ -5,7 +5,6 @@ import numpy as np 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 from app.utils.im_utils import pil2np @@ -42,9 +41,10 @@ def upload(): }) im = Image.open(file.stream).convert('RGB') - im_np = pil2np(im) + phash = compute_phash_int(im) - res = search_by_phash(im_np) + threshold = request.args.get('threshold') || 6 + + res = search_by_phash(phash, threshold) - # get threshold return jsonify({ 'res': res }) |
