当前位置:网站首页>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.
边栏推荐
- Keil5 MDK's formatting code tool and adding shortcuts
- Oracle foundation and system table
- 《统计学》第八版贾俊平第三章课后习题及答案总结
- Fundamentals of digital circuit (IV) data distributor, data selector and numerical comparator
- Proceedingjoinpoint API use
- servlet中 servlet context与 session与 request三个对象的常用方法和存放数据的作用域。
- 《统计学》第八版贾俊平第四章总结及课后习题答案
- Database monitoring SQL execution
- 四元数---基本概念(转载)
- What is an index in MySQL? What kinds of indexes are commonly used? Under what circumstances will the index fail?
猜你喜欢
Résumé des points de connaissance et des réponses aux exercices après la classe du chapitre 7 de Jia junping dans la huitième édition des statistiques
《统计学》第八版贾俊平第三章课后习题及答案总结
《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
Express
Logstack introduction and deployment -- elasticstack (elk) work notes 019
Intranet information collection of Intranet penetration (3)
150 common interview questions for software testing in large factories. Serious thinking is very valuable for your interview
Proceedingjoinpoint API use
数字电路基础(三)编码器和译码器
Fundamentals of digital circuit (IV) data distributor, data selector and numerical comparator
随机推荐
Database monitoring SQL execution
Sentinel overall workflow
Matplotlib绘图快速入门
Want to learn how to get started and learn software testing? I'll give you a good chat today
Wang Shuang's detailed notes on assembly language learning I: basic knowledge
[pointer] find the length of the string
Fundamentals of digital circuit (V) arithmetic operation circuit
5 minutes to master machine learning iris logical regression classification
Cadence physical library lef file syntax learning [continuous update]
New version of postman flows [introductory teaching chapter 01 send request]
To brush the video, it's better to see if you have mastered these interview questions. Slowly accumulating a monthly income of more than 10000 is not a dream.
[pointer] counts the number of times one string appears in another string
四元数---基本概念(转载)
My first blog
数字电路基础(一)数制与码制
Soft exam information system project manager_ Project set project portfolio management --- Senior Information System Project Manager of soft exam 025
Transplant hummingbird e203 core to Da Vinci pro35t [Jichuang xinlai risc-v Cup] (I)
Why can swing implement a form program by inheriting the JFrame class?
关于超星脚本出现乱码问题
Keil5 MDK's formatting code tool and adding shortcuts