当前位置:网站首页>Face based_ Recognition for face key point detection (1)
Face based_ Recognition for face key point detection (1)
2022-07-08 02:21:00 【So come on】
1. face_recognition Use the simplest face recognition tool in the world , It USES dlib The most advanced face recognition technology , And it has the function of deep learning .
(1)Github Address :https://github.com/ageitgey/face_recognition
(2) Official Guide :https://face-recognition.readthedocs.io/en/latest/readme.html
(3) The source code to achieve :https://face-recognition.readthedocs.io/en/latest/face_recognition.html
# 1 Add to Library
import face_recognition
import cv2
import matplotlib.pyplot as plt
# 2 Method : display picture
def show_image(image, title):
plt.title(title)
plt.imshow(image)
plt.axis("off")
# 3 Method : draw Landmars Key points
def show_landmarks(image, landmarks):
for landmarks_dict in landmarks: # Take a dictionary from the list
for landmarks_key in landmarks_dict.keys(): # Get the key in the dictionary
for point in landmarks_dict[landmarks_key]: # Get the value of each key / spot
cv2.circle(image, point, 2, (0,0,255), -1) # Draw a point
return image
# 4 The main function
def main():
# 5 Read the picture
image = cv2.imread("Tom.jpeg")
# 6 Image grayscale conversion
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# 7 call face_recognition Methods in the library :face_landmarks() Detect the key points in the face
face_marks = face_recognition.face_landmarks(gray, None, "large")
# none It means that you are not sure where the face is , Autofind .
# large Express 68,small Express 5
print(face_marks) # Output a list , Inside is a dictionary , Each point to describe
# 8 Draw key points
img_result = show_landmarks(image.copy(), face_marks)
# 9 Create a canvas
plt.figure(figsize=(9,6))
plt.suptitle("Face Landmarks with face_recognition", fontsize=14, fontweight="bold")
# 10 Show the overall effect
show_image(img_result, "landmarks")
plt.show()
if __name__ == '__main__':
main()
2. The installation of the library
Be sure to ask dlib 19.7.0, Not based on what we have dlib Version to install the corresponding face_recognition. So that you can install face_recognition1.3.0, It's just pycharm Install in .
边栏推荐
- Random walk reasoning and learning in large-scale knowledge base
- Semantic segmentation | learning record (1) semantic segmentation Preface
- XXL job of distributed timed tasks
- JVM memory and garbage collection-3-object instantiation and memory layout
- Semantic segmentation | learning record (4) expansion convolution (void convolution)
- 直接加比较合适
- PHP calculates personal income tax
- In depth analysis of ArrayList source code, from the most basic capacity expansion principle, to the magic iterator and fast fail mechanism, you have everything you want!!!
- Popular science | what is soul binding token SBT? What is the value?
- Thread deadlock -- conditions for deadlock generation
猜你喜欢
The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service
[knowledge map paper] Devine: a generative anti imitation learning framework for knowledge map reasoning
非分区表转换成分区表以及注意事项
Dnn+yolo+flask reasoning (raspberry pie real-time streaming - including Yolo family bucket Series)
银行需要搭建智能客服模块的中台能力,驱动全场景智能客服务升级
image enhancement
th:include的使用
入侵检测——Uniscan
Learn CV one from scratch activation function
JVM memory and garbage collection-3-object instantiation and memory layout
随机推荐
Learn CV two loss function from scratch (3)
How to use diffusion models for interpolation—— Principle analysis and code practice
mysql报错ORDER BY clause is not in SELECT list, references column ‘‘which is not in SELECT list解决方案
力争做到国内赛事应办尽办,国家体育总局明确安全有序恢复线下体育赛事
VIM use
Unity 射线与碰撞范围检测【踩坑记录】
Leetcode question brushing record | 27_ Removing Elements
Talk about the cloud deployment of local projects created by SAP IRPA studio
入侵检测——Uniscan
Learn face detection from scratch: retinaface (including magic modified ghostnet+mbv2)
CBAM for in-depth understanding of the attention mechanism in CV
Xiaobai tutorial: Raspberry pie 3b+onnxruntime+scrfd+flask to realize public face detection system
Nanny level tutorial: Azkaban executes jar package (with test samples and results)
Discrimination gradient descent
leetcode 865. Smallest Subtree with all the Deepest Nodes | 865.具有所有最深节点的最小子树(树的BFS,parent反向索引map)
Learn CV two loss function from scratch (1)
Spock单元测试框架介绍及在美团优选的实践_第三章(void无返回值方法mock方式)
Deeppath: a reinforcement learning method of knowledge graph reasoning
In depth understanding of the se module of the attention mechanism in CV
Clickhouse principle analysis and application practice "reading notes (8)