mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +00:00
mood box shape
This commit is contained in:
parent
879592b80d
commit
6482e1b20e
@ -229,8 +229,9 @@ def analysis(db_path, model_name, distance_metric, enable_face_analysis = True):
|
|||||||
if x+w+pivot_img_size < resolution_x:
|
if x+w+pivot_img_size < resolution_x:
|
||||||
#right
|
#right
|
||||||
cv2.rectangle(freeze_img
|
cv2.rectangle(freeze_img
|
||||||
, (x+w,y+20)
|
#, (x+w,y+20)
|
||||||
, (x+w+pivot_img_size, y+180)
|
, (x+w,y)
|
||||||
|
, (x+w+pivot_img_size, y+h)
|
||||||
, (64,64,64),cv2.FILLED)
|
, (64,64,64),cv2.FILLED)
|
||||||
|
|
||||||
cv2.addWeighted(overlay, opacity, freeze_img, 1 - opacity, 0, freeze_img)
|
cv2.addWeighted(overlay, opacity, freeze_img, 1 - opacity, 0, freeze_img)
|
||||||
@ -238,8 +239,9 @@ def analysis(db_path, model_name, distance_metric, enable_face_analysis = True):
|
|||||||
elif x-pivot_img_size > 0:
|
elif x-pivot_img_size > 0:
|
||||||
#left
|
#left
|
||||||
cv2.rectangle(freeze_img
|
cv2.rectangle(freeze_img
|
||||||
, (x-pivot_img_size,y+20)
|
#, (x-pivot_img_size,y+20)
|
||||||
, (x, y+180)
|
, (x-pivot_img_size,y)
|
||||||
|
, (x, y+h)
|
||||||
, (64,64,64),cv2.FILLED)
|
, (64,64,64),cv2.FILLED)
|
||||||
|
|
||||||
cv2.addWeighted(overlay, opacity, freeze_img, 1 - opacity, 0, freeze_img)
|
cv2.addWeighted(overlay, opacity, freeze_img, 1 - opacity, 0, freeze_img)
|
||||||
@ -253,7 +255,11 @@ def analysis(db_path, model_name, distance_metric, enable_face_analysis = True):
|
|||||||
|
|
||||||
if x+w+pivot_img_size < resolution_x:
|
if x+w+pivot_img_size < resolution_x:
|
||||||
|
|
||||||
cv2.putText(freeze_img, emotion_label, (x+w, y + 20 + (index+1) * 20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)
|
text_location_y = y + 20 + (index+1) * 20
|
||||||
|
text_location_x = x+w
|
||||||
|
|
||||||
|
if text_location_y < y + h:
|
||||||
|
cv2.putText(freeze_img, emotion_label, (text_location_x, text_location_y), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)
|
||||||
|
|
||||||
cv2.rectangle(freeze_img
|
cv2.rectangle(freeze_img
|
||||||
, (x+w+70, y + 13 + (index+1) * 20)
|
, (x+w+70, y + 13 + (index+1) * 20)
|
||||||
@ -262,7 +268,11 @@ def analysis(db_path, model_name, distance_metric, enable_face_analysis = True):
|
|||||||
|
|
||||||
elif x-pivot_img_size > 0:
|
elif x-pivot_img_size > 0:
|
||||||
|
|
||||||
cv2.putText(freeze_img, emotion_label, (x-pivot_img_size, y + 20 + (index+1) * 20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)
|
text_location_y = y + 20 + (index+1) * 20
|
||||||
|
text_location_x = x-pivot_img_size
|
||||||
|
|
||||||
|
if text_location_y <= y+h:
|
||||||
|
cv2.putText(freeze_img, emotion_label, (text_location_x, text_location_y), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)
|
||||||
|
|
||||||
cv2.rectangle(freeze_img
|
cv2.rectangle(freeze_img
|
||||||
, (x-pivot_img_size+70, y + 13 + (index+1) * 20)
|
, (x-pivot_img_size+70, y + 13 + (index+1) * 20)
|
||||||
|
2
setup.py
2
setup.py
@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="deepface",
|
name="deepface",
|
||||||
version="0.0.11",
|
version="0.0.12",
|
||||||
author="Sefik Ilkin Serengil",
|
author="Sefik Ilkin Serengil",
|
||||||
author_email="serengil@gmail.com",
|
author_email="serengil@gmail.com",
|
||||||
description="Deep Face Analysis Framework for Face Recognition and Demography",
|
description="Deep Face Analysis Framework for Face Recognition and Demography",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user