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

相关内容

热门资讯

关于“德州辅助器免费版2024... 关于“德州辅助器免费版2024”(透视)详细开挂辅助方法在 中合理运用透视功能,可以显著提升个人竞技...
第九分钟黑科技!红龙poker... 第九分钟黑科技!红龙poker脚本,wpk透视脚本视频(透视)扑克教程(有挂存在)1、操作简单,无需...
黑科技app!wopoker辅... 黑科技app!wopoker辅助软件,德州ai辅助神器软件可以使用,必赢方法(有挂规律)-哔哩哔哩,...
第7分钟透视挂!西兵辅助器,悠... 第7分钟透视挂!西兵辅助器,悠悠辅助(微信链接金花辅助开挂方法)1.西兵辅助器 ai辅助创建新账号,...
黑科技辅助(线上wpk德州ai... 黑科技辅助(线上wpk德州ai)外挂软件透明挂智能ai辅助神器(透视)技巧教程(2022已更新)(哔...
黑科技最新!wepoke软件透... 黑科技最新!wepoke软件透明挂(透视辅助挂),wepokeai代打逻辑真的有挂(2026);亲,...
技术分享“德扑之星辅助挂透视教... 技术分享“德扑之星辅助挂透视教程”(透视)详细开挂辅助技巧在中使用透视需注意以下几点:确保透视软件的...
第三分钟透视挂!枫叶辅助官网,... 第三分钟透视挂!枫叶辅助官网,九游辅助工具(微信链接炸金花辅助开挂工具)小薇(透视辅助)致您一封信;...
第5分钟理解!hhpoker免... 第5分钟理解!hhpoker免费透视脚本,哈糖大菠萝能开挂吗(透视)可靠教程(有挂方法)1、哈糖大菠...
教程攻略!微扑克ai会被检测到... 教程攻略!微扑克ai会被检测到,德州ai辅助器,我来教教你(有挂教程)-哔哩哔哩;超受欢迎的微扑克a...