Py之face_alignment:face_alignment库的简介、安装、使用方法之详细攻略

简介: Py之face_alignment:face_alignment库的简介、安装、使用方法之详细攻略

目录

face_alignment库的简介

1、指定在CPU / GPU上运行

2、使用特定的面部检测器检测地标。

3、一次性处理整个目录

face_alignment库的安装

face_alignment库的使用方法

1、检测图像中的二维、三维人脸标志


 

 

face_alignment库的简介

      使用世界上最精确的面部定位网络,从Python中检测面部地标,该网络能够检测二维和三维坐标中的点。它使用了FAN最先进的基于深度学习的面部对齐方法。

Github地址https://github.com/1adrianb/face-alignment

 

1、指定在CPU / GPU上运行

1. import face_alignment
2. 
3. # cuda for CUDA
4. fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device='cpu')

 

2、使用特定的面部检测器检测地标。

默认情况下,该包将使用SFD面部检测器。但是,用户也可以选择使用dlib或预先存在的地面真实边界框。

1. import face_alignment
2. 
3. # sfd for SFD, dlib for Dlib and folder for existing bounding boxes.
4. fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, face_detector='sfd')

 

3、一次性处理整个目录

1. import face_alignment
2. from skimage import io
3. 
4. fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=False)
5. 
6. preds = fa.get_landmarks_from_directory('../test/assets/')

 

 

face_alignment库的安装

pip install face-alignment

 

 

 

face_alignment库的使用方法

1、检测图像中的二维、三维人脸标志

1. import face_alignment
2. from skimage import io
3. 
4. fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=False)
5. 
6. input = io.imread('../test/assets/aflw-test.jpg')
7. preds = fa.get_landmarks(input)
8. 
9. 
10. 
11. 
12. import face_alignment
13. from skimage import io
14. 
15. fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, flip_input=False)
16. 
17. input = io.imread('../test/assets/aflw-test.jpg')
18. preds = fa.get_landmarks(input)
19. 
20. 
21.


相关文章
|
计算机视觉 Python
|
TensorFlow 算法框架/工具
TensorFlow修改图像尺寸:AttributeError: module ‘tensorflow._api.v2.image‘ has no attribute ‘image‘
TensorFlow修改图像尺寸:AttributeError: module ‘tensorflow._api.v2.image‘ has no attribute ‘image‘
98 0
TensorFlow修改图像尺寸:AttributeError: module ‘tensorflow._api.v2.image‘ has no attribute ‘image‘
|
Python
Python中,如何使用ImageDraw在Image上绘制粗线?
Python中,如何使用ImageDraw在Image上绘制粗线?
182 0
Dataset:White Wine Quality白葡萄酒品质数据集的简介、下载、使用方法之详细攻略
Dataset:White Wine Quality白葡萄酒品质数据集的简介、下载、使用方法之详细攻略
|
算法 计算机视觉 Python
OpenCV绘制图像与文字(可作为脚手架代码)(python) Open_CV系列(四)(上)
OpenCV绘制图像与文字(可作为脚手架代码)(python) Open_CV系列(四)
258 0
OpenCV绘制图像与文字(可作为脚手架代码)(python) Open_CV系列(四)(上)
|
算法 计算机视觉 Python
OpenCV绘制图像与文字(可作为脚手架代码)(python) Open_CV系列(四)(下)
OpenCV绘制图像与文字(可作为脚手架代码)(python) Open_CV系列(四)
241 0
OpenCV绘制图像与文字(可作为脚手架代码)(python) Open_CV系列(四)(下)
|
机器学习/深度学习 并行计算 异构计算
Py之face_alignment:face_alignment库的简介、安装、使用方法之详细攻略
Py之face_alignment:face_alignment库的简介、安装、使用方法之详细攻略
|
数据可视化 Python
python可视化进阶---seaborn1.2 调色盘color_palette()
对图表整体颜色、比例进行风格设置,包括颜色色板等 调用系统风格进行数据可视化
967 0
python可视化进阶---seaborn1.2 调色盘color_palette()
|
机器学习/深度学习 计算机视觉 Python
CV之face_recognition:Py之face_recognition库安装、介绍、使用方法详细攻略
CV之face_recognition:Py之face_recognition库安装、介绍、使用方法详细攻略
CV之face_recognition:Py之face_recognition库安装、介绍、使用方法详细攻略
|
机器学习/深度学习 算法 算法框架/工具
CV之IG:图像生成(Image Generation)的简介、使用方法、案例应用之详细攻略
CV之IG:图像生成(Image Generation)的简介、使用方法、案例应用之详细攻略
CV之IG:图像生成(Image Generation)的简介、使用方法、案例应用之详细攻略
http://www.vxiaotou.com