Python实现人脸识别
创始人
2025-01-08 21:36:05
0

直接上代码:

import face_recognition import time from PIL import Image, ImageDraw def faceRecognition(fileName):       # 加载图片     image = face_recognition.load_image_file(fileName)      # 人脸定位     beginTime = time.time()     face_locations = face_recognition.face_locations(image)     image2 = Image.open(fileName)     pil_image = ImageDraw.Draw(image2)     for face_location in face_locations:               # 打印位置         top, right, bottom, left = face_location         print("A face is located at pixel location Top: {}, Left: {}, Bottom: {}, Right: {}".format(top, left, bottom, right))               # 红色的边框颜色         red_color =(255, 0, 0)         # 边框的宽度         border_width = 3         # 要画红框的坐标 (x, y, x+width, y+height)         box_coordinates = (left, top, right, bottom)         # 画红框         pil_image.rectangle(box_coordinates, width=border_width, outline=red_color)         # 人脸图         # face_image = image[top:bottom, left:right]         # pil_image = Image.fromarray(face_image)         # pil_image.show()     image2.show()  if __name__ == '__main__':     faceRecognition('10010.jpg')

运行效果为:

完整代码地址:Python实现人脸识别算法

相关内容

热门资讯

透视系统!德普之星透视辅助软件... 透视系统!德普之星透视辅助软件是真的吗,德州透视是真的假的(详细辅助新2025版);玩家必备必赢加哟...
透视app!wpk透视辅助下载... 透视app!wpk透视辅助下载,微信公众号辅助工具(切实有挂);1、很好的工具软件,可以解锁游戏的微...
红龙poker脚本!aapok... 红龙poker脚本!aapoker万能辅助器,wpk透视工作室(详细辅助透牌教程),您好,wpk透视...
透视挂“wepoker辅助器安... 透视挂“wepoker辅助器安装包”一贯真的有挂(辅助挂)详细辅助专业教程辅助器中分为三种模型:软件...
透视教学!wpk透视工作室,w... 这是一款非常优秀的wejoker辅助机器人 ia辅助检测软件,能够让你了解到wejoker辅助机器人...
透视app!wepoker可以... 透视app!wepoker可以开透视吗,指尖四川辅助破解版(一直是有挂)1、上手简单,内置详细流程视...
wepoker底牌透视脚本!w... wepoker底牌透视脚本!wepokerplus作弊,wepoker底牌透视脚本下载(详细辅助新版...
透视挂透视!wepoker底牌... 透视挂透视!wepoker底牌透视脚本http,hhpkoer辅助器视频(详细辅助wpk教程);人气...
透视工具“aapoker辅助插... 透视工具“aapoker辅助插件工具下载”都是是有挂(辅助挂)详细辅助科技教程1、打开软件启动之后找...
透视科技!德普之星辅助器app... 透视科技!德普之星辅助器app,新海王软件辅助(切实有挂)1、新海王软件辅助ai辅助优化,新海王软件...