当前位置:网站首页>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.
边栏推荐
- Function: string storage in reverse order
- 《统计学》第八版贾俊平第三章课后习题及答案总结
- [pointer] the array is stored in reverse order and output
- Pointer -- output all characters in the string in reverse order
- Wang Shuang's detailed notes on assembly language learning I: basic knowledge
- 《统计学》第八版贾俊平第十一章一元线性回归知识点总结及课后习题答案
- 函数:求两个正数的最大公约数和最小公倍
- [pointer] delete all spaces in the string s
- Markdown font color editing teaching
- 【指针】八进制转换为十进制
猜你喜欢

数字电路基础(五)算术运算电路

1.支付系统

The common methods of servlet context, session and request objects and the scope of storing data in servlet.

Statistics 8th Edition Jia Junping Chapter 7 Summary of knowledge points and answers to exercises after class

ES全文索引

JVM memory model concept

四元数---基本概念(转载)

Statistics 8th Edition Jia Junping Chapter 3 after class exercises and answer summary

5 minutes to master machine learning iris logical regression classification

Lintcode logo queries the two nearest saplings
随机推荐
函数:计算字符串中大写字母的个数
Numpy快速上手指南
How to learn automated testing in 2022? This article tells you
Get started with Matplotlib drawing
《统计学》第八版贾俊平第三章课后习题及答案总结
My first blog
【指针】求二维数组中最大元素的值
How does SQLite count the data that meets another condition under the data that has been classified once
关于交换a和b的值的四种方法
Interview Essentials: what is the mysterious framework asking?
Pointers: maximum, minimum, and average
[issue 18] share a Netease go experience
"If life is just like the first sight" -- risc-v
Pointeurs: maximum, minimum et moyenne
Based on authorized access, cross host, and permission allocation under sqlserver
SystemVerilog discusses loop loop structure and built-in loop variable I
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
Summary of thread implementation
函数:字符串反序存放
《统计学》第八版贾俊平第六章统计量及抽样分布知识点总结及课后习题答案