ybc_face模块(人脸识别模块)

age( filename )

功能

识别图片中人脸的年龄

参数

·filename:人脸图片的文件名

返回值

返回年龄信息(整数)

例子

import ybc_face

res = ybc_face.age('1.jpg')
print(res)

beauty( filename )

功能

识别图片中人脸的颜值

参数

·filename:人脸图片的文件名

返回值

返回颜值(整数)

例子

import ybc_face

res = ybc_face.beauty('1.jpg')
print(res)

compare( image_a, image_b )

功能

对比人脸相似度。

参数

·image_a:待对比图片名 (图片对象,必填)
·image_b:待对比图片名 (图片对象,必填)

返回值

成功: 相似度打分;失败: 提示错误信息

例子

import ybc_face

result = ybc_face.compare('1.jpg','2.jpg')
print(result)

face( filename )

功能

识别图片中的人脸信息(多人脸图片信息排序:从左到右)

参数

·filename:图片的文件名

返回值

图片中的人脸信息(字符串)

例子

import ybc_face

result = ybc_face.face('1.jpg')
print(result)

face_list( filename )

功能

识别图片中的人脸信息(多人脸图片信息排序:从左到右)

参数

·filename:图片的文件名

返回值

图片中的人脸信息(列表)

例子

import ybc_face

result = ybc_face.face_list('1.jpg')
print(result)

gender( filename )

功能

识别图片中人脸的性别

参数

·filename:人脸图片的文件名

返回值

返回性别信息(字符串类型)

例子

import ybc_face

res = ybc_face.gender('1.jpg')
print(res)

magic( filename,model )

功能

对图片中的人脸与古装角色及场景进行魔法融合

参数

·filename:图片文件名 (字符串,必填)
·model:融合类型 (整数1-14,必填)

返回值

返回魔法融合后的图片的文件名(字符串类型)

例子

import ybc_face

result = ybc_face.magic('1.jpg',1)
print(result)