代码拉取完成,页面将自动刷新
import cv2
from src.utils.GlobalVariable import models
from src.model.Face import StudentRgFace
#此用于面部特征计算进程
# 自动进行普通识别=> 消费者模型
def process_student_rg(Q1, Q2, share):
face_rg = StudentRgFace()
while True:
while not Q1.empty():
img = Q1.get()
rgbImage = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
gray = cv2.cvtColor(rgbImage, cv2.COLOR_RGB2GRAY)
location_faces = models.detector(gray)
if len(location_faces) == 1:
raw_face = models.predictor(gray, location_faces[0])
result = face_rg.rg(img, rgbImage, raw_face, share)
Q2.put(result)
#time.sleep(1)
# def process_admin_rg(Q1, share):
# face_rg = AdminRgFace()
# while True:
# while not Q1.empty():
# img = Q1.get()
# rgbImage = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# gray = cv2.cvtColor(rgbImage, cv2.COLOR_RGB2GRAY)
# location_faces = models.detector(gray)
# if len(location_faces) == 1:
# raw_face = models.predictor(gray, location_faces[0])
# result = face_rg.rg_face(img, rgbImage, raw_face,share)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。