mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-19 13:09:56 -07:00
label face added
This commit is contained in:
parent
6aee9030d2
commit
09126eb3fb
1 changed files with 16 additions and 0 deletions
16
utils/label_face.py
Normal file
16
utils/label_face.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue