@Rookie
2019-02-15T10:51:42.000000Z
字数 1220
阅读 972
panda
typedef void(^PandaFaceCallback)(BOOL success, NSDictionary *result, NSError *error);
/** 进行人脸检测
* image 人脸图片
*/
-(void)monitorIsFaceWithImage:(UIImage *)image
completion:(PandaFaceCallback)completion;
[[PandaFaceManager defaultManager] monitorIsFaceWithImage:image completion:^(BOOL success, NSDictionary *result, NSError *error) {
if (success) {
// 调用成功
self->_facestr = result[@"facedata"];
}else {
// 调用失败具体看error code
}
}];
/** 上传人脸数据
* faceData 人脸检测返回的数据
* thumbnailUrl 图像缩略图url(小于100k)
* userid 用户userid
*/
-(void)uploadPandaFaceData:(NSString *)faceData
withThumbnailUrl:(NSString *)thumbnailUrl
withUserid:(NSString *)userid
completion:(PandaFaceCallback)completion;
[[PandaFaceManager defaultManager] uploadPandaFaceData:_facestr
withThumbnailUrl:self.upyunImgUrl
withUserid:@"userid"
completion:^(BOOL success, NSDictionary *result, NSError *error) {
if (success) {
NSLog(@"上传成功");
}else {
NSLog(@"%@", error);
}
}];
错误提示 | 错误码 | 说明 |
---|---|---|
ERROE_RESOURCES_EMPTY | 5001 | 图片不能为空! |
ERROE_FACE_EMPTY | 5002 | 未检测到人脸! |
ERROE_FACE_EXTRACT | 5003 | 人脸特征提取失败! |
FACE_SUCESS | 4000 | 人脸识别成功! |
ERROE_UPLOAD_EMPTY | 5005 | 上传数据缺失! |
ERROE_UPLOAD_COMPLETION | 5006 | 上传缩略图过大! |