当前位置: 首页 > news >正文

好的网站模板南京高端网站建设公司

好的网站模板,南京高端网站建设公司,今科云平台网站建设,wordpress默认参数简单的人脸识别签到程序 在看完以下代码后#xff0c;略微修改一番#xff0c;你就能够组装出自己的“简单的人脸识别签到程序”了。 请注意库的安装#xff0c;否则会不可用。 你可以通过在cmd中使用#xff1a;pip install来安装。 以下代码运行python 3.8 UI界面 使…简单的人脸识别签到程序 在看完以下代码后略微修改一番你就能够组装出自己的“简单的人脸识别签到程序”了。 请注意库的安装否则会不可用。 你可以通过在cmd中使用pip install来安装。 以下代码运行python 3.8 UI界面 使用前安装PySimpleGUI库 import PySimpleGUI as sg# 创建一个简单的窗口包含一个标签和一个输入框 Layout [[sg.Text(编号: , size(10, 1)), sg.InputText(keyid)],[sg.Text(姓名: , size(10, 1)), sg.InputText(keyname)],[sg.Text(keymsg)],[sg.Button(人脸采集), sg.Button(关闭),sg.Button(签到)]] window sg.Window(人脸识别, Layout,icon./icon.ico) while True:event, values window.read()# 读取窗口事件和输入值print(event, values)if event 人脸采集:id values[id]name values[name]window[msg].update(f编号: {id}, 姓名: {name})# 更新消息框内容sg.popup(人脸采集)elif event 签到:id values[id]name values[name]window[msg].update(f编号: {id}, 姓名: {name})if id 1 and name 1:sg.popup(签到成功)print(签到成功)else:sg.popup(签到失败)print(签到失败)elif event 关闭 or event sg.WIN_CLOSED:print(退出)sg.popup_timed(退出)# 弹出提示信息break数据库 使用前请安装好MySQL和图形化界面。 CREATE TABLE tu (user_id INT AUTO_INCREMENT PRIMARY KEY,user_name VARCHAR(255) NOT NULL,user_num INT NOT NULL );数据库操作 使用前安装pymysql库 import pymysql# 数据库配置 db_config {host: localhost,user: root,password: 123456,port: 3306,database: name,charset: utf8 }# 增 def connect_mysql(name, num):con pymysql.connect(**db_config)cur con.cursor()sql insert into tu (user_name,user_num) values(%s,%s)cur.execute(sql, (name, num))con.commit()if cur.rowcount 0:print(数据库添加成功)else:print(数据库添加失败)cur.close()con.close()# 改 def update_mysql(name, num):con pymysql.connect(**db_config)cur con.cursor()sql UPDATE tu SET user_num %s WHERE user_name %saffected_rows cur.execute(sql, (num, name))con.commit()if affected_rows 0:print(更新成功)else:print(更新失败或未找到对应的记录)cur.close()con.close()# 删 def delete_mysql(name):con pymysql.connect(**db_config)cur con.cursor()sql DELETE FROM tu WHERE user_name %saffected_rows cur.execute(sql, (name,))con.commit()if affected_rows 0:print(删除成功)else:print(删除失败或未找到对应的记录)cur.close()con.close()# 查 def num_to_name(user_num):con pymysql.connect(**db_config)cur con.cursor()sql SELECT user_name FROM tu WHERE user_num %scur.execute(sql, (user_num,))result cur.fetchone()cur.close()con.close()return result[0] if result else None人脸识别 使用前安装配置好cv2opencv-pythonface_recognitionnumpy import cv2 import face_recognition import os import numpy as np #开启摄像头 c cv2.VideoCapture(0, cv2.CAP_DSHOW) #文件路径 file_path D:\work\python\open\lianwhile True:ret,frame c.read()if ret:#显示图cv2.imshow(a,frame)if cv2.waitKey(20) 27:breakif cv2.waitKey(20) 113:# 检测人脸face_list face_recognition.face_locations(frame)if len(face_list) 0:print(视频检测到人脸)# 遍历目录path os.listdir(file_path)# print(path)for i in path:#获取人脸特征img cv2.imread(f{file_path}\\{i})encodings face_recognition.face_encodings(img)if len(encodings) 0:continueelse:en1 face_recognition.face_encodings(img)[0]en2 face_recognition.face_encodings(frame)[0]iss np.linalg.norm(en1-en2)# print(iss)if iss 0.5:print(与图像,i,中欧几里得距离,round(iss,2),是同一个人)else:print(与图像,i,欧几里得距离为 ,round(iss,2),不是同一个人) cv2.destroyAllWindows()好了现在你可以组装自己的简单的签到程序了。
http://www.dnsts.com.cn/news/74347.html

相关文章:

  • 网站开发师是做什么的怎样做让百度收录网站域名
  • 泉州网站建设公司首选公司网页制做
  • 如何做网站认证iis网站物理路径
  • 同主机网站查询云建站管理区
  • 用vs做网站在安装时要勾选新任上海市领导调整公示
  • 健康私人定制网站怎么做网站开发技术人员
  • 网站有哪些内容html5 动态效果 手机网站
  • 品牌网站建设新闻wordpress 显示指定文章
  • 怎样做网站 网页网页设计与制作教程第二版张晓蕾课后答案
  • 网站如何做外链2018建模网站
  • godaddy主机到网站软件技术ui设计专业怎么样
  • 群晖做网站网站项目计划书范文
  • 和动物做的网站大连网站建设连城传媒
  • 建设网站怎么查明细温室网站建设
  • 怎么做服装外贸网站网站登录系统制作
  • 在线免费看电视剧的网站四川门户网站建设
  • 哪个网站能在线做司考题目天津市最新消息今天
  • 做地坪网站wordpress php那个版本号
  • 有做义工的相亲网站吗手游折扣平台最新排名
  • 织梦响应式网站湘潭网站建设多少钱
  • 农林网站建设全球搜是什么公司
  • 怎样开电商内蒙古seo公司
  • 深圳公明做网站苏州网站建设kgu
  • 惠州网站建设方案推广百度网盘下载
  • 青岛网站网站建设不需要流量的地图导航软件
  • 网站支付宝支付接口申请建设好网站如何上传百度
  • 如何优化网站关键词排名网站注册怎么注销
  • 博客的网站页面设计建设公司加盟
  • wordpress 多站点 无法访问概念网站源码
  • 网站建设相关新闻公司建网站多少钱一年