label face added

This commit is contained in:
seranus 2021-12-06 23:16:53 +01:00
commit 09126eb3fb

16
utils/label_face.py Normal file
View file

@ -0,0 +1,16 @@
import cv2
from pathlib import Path
import numpy as np
import os
def label_face_filename(face, filename):
text = os.path.splitext(os.path.basename(filename))[0]
font = cv2.FONT_HERSHEY_SIMPLEX
org = (5, face.shape[0] - 10)
thickness = 1
fontScale = 0.5
color = (255, 255, 255)
face = face.copy() # numpy array issue
cv2.putText(face, text, org, font, fontScale, color, thickness, cv2.LINE_AA)
return face