summaryrefslogtreecommitdiff
path: root/check/app
diff options
context:
space:
mode:
Diffstat (limited to 'check/app')
-rw-r--r--check/app/server/api.py8
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 })