当前位置:网站首页>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.
边栏推荐
- Pointer -- eliminate all numbers in the string
- Statistics 8th Edition Jia Junping Chapter 4 Summary and after class exercise answers
- 函数:求1-1/2+1/3-1/4+1/5-1/6+1/7-…+1/n
- 数据库多表链接的查询方式
- 《统计学》第八版贾俊平第五章概率与概率分布
- C language learning summary (I) (under update)
- What is an index in MySQL? What kinds of indexes are commonly used? Under what circumstances will the index fail?
- 浙大版《C语言程序设计实验与习题指导(第3版)》题目集
- [issue 18] share a Netease go experience
- 数字电路基础(五)算术运算电路
猜你喜欢
Statistics 8th Edition Jia Junping Chapter 14 summary of index knowledge points and answers to exercises after class
关于超星脚本出现乱码问题
王爽汇编语言详细学习笔记二:寄存器
How to transform functional testing into automated testing?
Wu Enda's latest interview! Data centric reasons
四元数---基本概念(转载)
150 common interview questions for software testing in large factories. Serious thinking is very valuable for your interview
[Ogg III] daily operation and maintenance: clean up archive logs, register Ogg process services, and regularly back up databases
DVWA exercise 05 file upload file upload
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
随机推荐
The four connection methods of JDBC are directly coded
指针--剔除字符串中的所有数字
Statistics 8th Edition Jia Junping Chapter 5 probability and probability distribution
Using flask_ Whooshalchemyplus Jieba realizes global search of flask
Pointers: maximum, minimum, and average
Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
【指针】查找最大的字符串
数字电路基础(四) 数据分配器、数据选择器和数值比较器
Intranet information collection of Intranet penetration (3)
我的第一篇博客
指针:最大值、最小值和平均值
Function: find 1-1/2+1/3-1/4+1/5-1/6+1/7-... +1/n
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
函数:求方程的根
函数:求两个正数的最大公约数和最小公倍
指针 --按字符串相反次序输出其中的所有字符
Cc36 different subsequences
Flash implements forced login
SystemVerilog discusses loop loop structure and built-in loop variable I
Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?