Update app.py
This commit is contained in:
parent
c2bca54fca
commit
d067ba3ac8
|
@ -3,6 +3,7 @@ import json
|
||||||
import cv2
|
import cv2
|
||||||
import base64
|
import base64
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from deepface import DeepFace
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -18,9 +19,8 @@ def process_image():
|
||||||
request_data = json.loads(request.data.decode("utf-8"))
|
request_data = json.loads(request.data.decode("utf-8"))
|
||||||
img_nparr = np.frombuffer(base64.b64decode(request_data['image']), np.uint8)
|
img_nparr = np.frombuffer(base64.b64decode(request_data['image']), np.uint8)
|
||||||
img = cv2.imdecode(img_nparr,cv2.IMREAD_COLOR)
|
img = cv2.imdecode(img_nparr,cv2.IMREAD_COLOR)
|
||||||
cv2.imwrite("retrieved_img.jpg",img)
|
racist_detector = DeepFace.analyze(img)
|
||||||
print(request_data)
|
return racist_detector
|
||||||
return "Bing Bong!"
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue