From f5f30912a2efd9c3d47cc9aeaf6a542211b00474 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 23 Apr 2019 13:10:45 +0200 Subject: edits --- check/app/server/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'check/app') 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 }) -- cgit v1.2.3-70-g09d2