当前位置:网站首页>Opencv recognition of face in image
Opencv recognition of face in image
2022-07-06 14:53:00 【gmHappy】
#!/usr/bin/python
#coding=utf-8
# Recognize faces in pictures
import face_recognition
jobs_image = face_recognition.load_image_file("C:/rlsb/jobs.jpg");
obama_image = face_recognition.load_image_file("C:/rlsb/obama.jpg");
unknown_image = face_recognition.load_image_file("C:/rlsb/unknown.jpg");
jobs_encoding = face_recognition.face_encodings(jobs_image)[0]
obama_encoding = face_recognition.face_encodings(obama_image)[0]
unknown_encoding = face_recognition.face_encodings(unknown_image)[0]
results = face_recognition.compare_faces([jobs_encoding, obama_encoding], unknown_encoding )
labels = ['jobs', 'obama']
print('results:'+str(results))
for i in range(0, len(results)):
if results[i] == True:
print('The person is:'+labels[i])
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
test result :
results:[True, False]
The person is:jobs
- 1.
- 2.
边栏推荐
- Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
- Get started with Matplotlib drawing
- Fundamentals of digital circuits (III) encoder and decoder
- 数字电路基础(四) 数据分配器、数据选择器和数值比较器
- {1,2,3,2,5}查重问题
- Don't you even look at such a detailed and comprehensive written software test question?
- Matplotlib绘图快速入门
- Statistics 8th Edition Jia Junping Chapter 3 after class exercises and answer summary
- 《统计学》第八版贾俊平第四章总结及课后习题答案
- Fundamentals of digital circuits (II) logic algebra
猜你喜欢
《统计学》第八版贾俊平第三章课后习题及答案总结
How does SQLite count the data that meets another condition under the data that has been classified once
How to learn automated testing in 2022? This article tells you
"If life is just like the first sight" -- risc-v
About the garbled code problem of superstar script
C language do while loop classic Level 2 questions
关于交换a和b的值的四种方法
《统计学》第八版贾俊平第十一章一元线性回归知识点总结及课后习题答案
Keil5-MDK的格式化代码工具及添加快捷方式
Login the system in the background, connect the database with JDBC, and do small case exercises
随机推荐
数字电路基础(四) 数据分配器、数据选择器和数值比较器
High concurrency programming series: 6 steps of JVM performance tuning and detailed explanation of key tuning parameters
Get started with Matplotlib drawing
Four methods of exchanging the values of a and B
Solutions to common problems in database development such as MySQL
函数:计算字符串中大写字母的个数
指针 --按字符串相反次序输出其中的所有字符
Function: calculates the number of uppercase letters in a string
5 minutes to master machine learning iris logical regression classification
Intranet information collection of Intranet penetration (3)
Login the system in the background, connect the database with JDBC, and do small case exercises
Realize applet payment function with applet cloud development (including source code)
Express
flask实现强制登陆
[pointer] use the insertion sorting method to arrange n numbers from small to large
The four connection methods of JDBC are directly coded
函数:用牛顿迭代法求方程的根
Fundamentals of digital circuit (V) arithmetic operation circuit
Query method of database multi table link
函数:字符串反序存放