当前位置:网站首页>Face_recognition人脸识别之考勤统计
Face_recognition人脸识别之考勤统计
2022-07-04 15:43:00 【Wu_Candy】
前置条件环境准备如下所示:Pycharm+python3.6+sklearn+face_recognition+dlib
Step1:KNN算法简介
K最近邻(k-Nearest Neighbor,KNN)分类算法的核心思想是如果一个样本在特征空间中的k个最相似(即特征空间中最邻近)的样本中的大多数属于某一个类别,则该样本也属于这个类别。KNN算法可用于多分类,KNN算法不仅可以用于分类,还可以用于回归。通过找出一个样本的k个最近邻居,将这些邻居的属性的平均值赋给该样本,作为预测值。
KNeighborsClassifier在scikit-learn在sklearn.neighbors包之中。
KNeighborsClassifier使用很简单,三步:
1)创建KNeighborsClassifier对象
2)调用fit函数
3)调用predict函数进行预测。
Step2:看看项目的目录结构如下
Step3:看看训练数据
Step4:看看测试数据
Step5:看看模型计算出来的考勤数据
打开后如下图所示:
Step6:两个核心的py文件解析
KNN_Recognition_easy.py 通过模型去统计考勤的py文件。
KNN_Train_easy.py 通过训练数据生成模型的py文件。代码如下:
程序入口:
调用main()
往下依次调用有:
predict()
getvalueToKey()
strTotime()
prase_filename_date()
writeExcel()
边栏推荐
- 码农版隐秘的角落:作为开发者最讨厌的5件
- 智慧物流园区供应链管理系统解决方案:数智化供应链赋能物流运输行业供应链新模式
- What are cache penetration, cache breakdown, and cache avalanche
- 【Unity UGUI】ScrollRect 动态缩放格子大小,自动定位到中间的格子
- [acwing] 58 weeks 4489 Longest subsequence
- It's too convenient. You can complete the code release and approval by nailing it!
- 新享科技发布小程序UniPro小优 满足客户移动办公场景
- 超大规模数仓集群在大型商业银行的落地实践
- S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
- Is it safe to open an account online
猜你喜欢

防火墙基础透明模式部署和双机热备

2022年国内云管平台厂商哪家好?为什么?

【Go ~ 0到1 】 第六天 文件的读写与创建

解读数据安全治理能力评估框架2.0,第四批DSG评估征集中

雨量预警广播自动化数据平台BWII 型广播预警监测仪

go-micro教程 — 第二章 go-micro v3 使用Gin、Etcd

【测试开发】软件测试——基础篇

PingCode 性能测试之负载测试实践

"Cannot initialize Photoshop because the temporary storage disk is full" graphic solution

S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
随机推荐
[Huawei HCIA continuous update] SDN and FVC
curl 命令妙用
To sort out messy header files, I use include what you use
Pytorch deep learning quick start tutorial
完美融入 Win11 风格,微软全新 OneDrive 客户端抢先看
To sort out messy header files, I use include what you use
[HCIA continuous update] WLAN overview and basic concepts
tp配置多数据库
Is it safe for CITIC Securities to open an account online? Is the account opening fee charged
Electronic pet dog - what is the internal structure?
《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
一加10 Pro和iPhone 13怎么选?
Zebras are recognized as dogs, and the reason for AI's mistakes is found by Stanford
MVC模式和三层架构
The test experience "tortured" by the PMP test is worth your review
安信证券属于什么档次 开户安全吗
7 RSA密码体制
detectron2安装方法
【HCIA持续更新】WLAN工作流程概述
太方便了,钉钉上就可完成代码发布审批啦!