Graduate

Update flask

......@@ -11,6 +11,7 @@ import tensorflow as tf
import base64
import pymysql
import configparser
import uuid
from PIL import Image
config = configparser.ConfigParser()
......@@ -74,8 +75,8 @@ def register():
image = base64.b64decode(request.form['image'])
image_np = np.frombuffer(image, dtype=np.uint8)
image_np = cv2.imdecode(image_np, cv2.IMREAD_UNCHANGED)
image_np = resize(image_np)
image_np = prewhiten(image_np)
image_np = resize(image_np)
image_np = image_np.reshape(-1, image_size, image_size, 3)
# get embedding
feed_dict = {input_placeholder:image_np, phase_train_placeholder:False }
......@@ -100,8 +101,8 @@ def verify():
image = base64.b64decode(request.form['image'])
image_np = np.frombuffer(image, dtype=np.uint8)
image_np = cv2.imdecode(image_np, cv2.IMREAD_UNCHANGED)
image_np = resize(image_np)
image_np = prewhiten(image_np)
image_np = resize(image_np)
image_np = image_np.reshape(-1, image_size, image_size, 3)
# get embedding
feed_dict = {input_placeholder:image_np, phase_train_placeholder:False }
......
......@@ -127,7 +127,7 @@ function processVideo() {
let point2 = new cv.Point(face.x + face.width, face.y + face.height);
cv.rectangle(dst, point1, point2, [255, 0, 0, 255], 8);
let cropped = new cv.Mat();
let rect = new cv.Rect(Math.max(face.x-face.width/4, 0), Math.max(face.y-face.height/2, 0), Math.min(face.width+face.width/2, src.cols), Math.min(face.height*2, src.rows));
let rect = new cv.Rect(Math.max(face.x-22, 0), Math.max(face.y-44, 0), Math.min(face.width+44, src.cols), Math.min(face.height+66, src.rows));
cropped = src.roi(rect);
let tempCanvas = document.createElement("canvas");
cv.imshow(tempCanvas,cropped);
......
......@@ -61,7 +61,7 @@ function detect_face()
let point1 = new cv.Point(face.x, face.y);
let point2 = new cv.Point(face.x + face.width, face.y + face.height);
cv.rectangle(dst, point1, point2, [255, 0, 0, 255], 8);
let rect = new cv.Rect(Math.max(face.x-face.width/4, 0), Math.max(face.y-face.height/2, 0), Math.min(face.width+face.width/2, src.cols), Math.min(face.height*2, src.rows));
let rect = new cv.Rect(Math.max(face.x-22, 0), Math.max(face.y-44, 0), Math.min(face.width+44, src.cols), Math.min(face.height+66, src.rows));
let cropped = src.roi(rect);
cv.imshow(tempCanvas,cropped);
}
......