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实现人脸识别算法

相关内容

热门资讯

盘点开挂"wepok... 盘点开挂"wepoker有辅助功能吗"德州局怎么透视(透视)开挂辅助平台(有挂存在)【无需打开直接搜...
透视辅助!aapoker插件下... 透视辅助!aapoker插件下载,wepoker怎么下载游戏,盘点开挂辅助插件(透视果真有挂);亲,...
一分钟揭秘“WePOker有没... 是一款可以让一直输的玩家,快速成为一个“必胜”的ai辅助神器,有需要的用户可以加我微信(136704...
透视辅助!hhpoker可以控... 您好:这款wepoker怎么设置房间游戏是可以开挂的,确实是有挂的,很多玩家在这款wepoker怎么...
通报透视"hhpok... 通报透视"hhpoker有后台操控吗"wepoker底牌透视脚本(透视)开挂辅助软件(有挂讲解)>>...
玩家攻略推荐“wepoker正... 玩家攻略推荐“wepoker正确养号方法”开挂(透视)辅助软件(教你教程真实有挂)1、下载安装好,进...
透视辅助!wepoker底牌透... 透视辅助!wepoker底牌透视,wepoker辅助器软件下载,细节开挂辅助安装(透视有挂分享)1、...
曝光透视"We po... 曝光透视"We poker辅助器下载"德州透视是真的吗(透视)开挂辅助插件(有挂方式) >>您好:软...
技术分享“pokerrrr2辅... 技术分享“pokerrrr2辅助”开挂(透视)辅助插件(透牌教程新版有挂);无需打开直接搜索打开薇:...
透视辅助!大菠萝免费辅助器,德... 透视辅助!大菠萝免费辅助器,德扑圈有透视吗,细节开挂辅助平台(透视有挂解密);大菠萝免费辅助器免费下...