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

相关内容

热门资讯

详细开挂“欢聚水鱼透视插件下载... 详细开挂“欢聚水鱼透视插件下载渠道”附开挂辅助平台(玩家必看科普有挂辅助);无需打开直接搜索打开薇:...
传授透视!哈糖大菠萝攻略,po... 传授透视!哈糖大菠萝攻略,pokernow辅助控制(附辅助开挂下载);哈糖大菠萝攻略软件透视开挂是一...
通报开挂“丽水都莱辅助工具试用... >>您好:丽水都莱辅助工具试用确实是有挂的,很多玩家在这款丽水都莱辅助工具试用游戏中打牌都会发现很多...
正版透视!wepoker有辅助... 正版透视!wepoker有辅助器吗,pokemmo手机版脚本(附开挂辅助脚本),pokemmo手机版...
通报辅助“微信第三方辅助软件”... 通报辅助“微信第三方辅助软件”附开挂辅助安装(一分钟揭秘有挂细节);无需打开直接搜索薇:136704...
细节透视!wepoker脚本下... 细节透视!wepoker脚本下载,哈糖大菠萝怎么开挂(附辅助开挂平台);一、哈糖大菠萝怎么开挂AI软...
实测开挂“功夫川麻小程序辅助”... 【亲,功夫川麻小程序辅助 这款游戏可以开挂的,确实是有挂的,很多玩家在这款功夫川麻小程序辅助中打牌都...
分析透视!wepoker辅助器... 分析透视!wepoker辅助器最新版本更新内容,pokemmo脚本(附辅助开挂脚本);wepoker...
详细开挂“闲来辅助神器”附开挂... 大家好,今天小编来为大家解答闲来辅助神器这个问题咨询软件客服可以免费测试直接加微信(13670430...
科技透视!德州hhpoker是... 科技透视!德州hhpoker是真的吗,wepoker怎么看底牌(附开挂辅助安装);小薇(透视辅助)致...