iOS SDK update for BUILD 2017 release. (#17)

* Warning fix.

* Initial version for BUILD2017.
This commit is contained in:
Xuan Hu (Sean) 2017-05-08 20:57:26 +08:00 коммит произвёл GitHub
Родитель 2b3f652fa3
Коммит f6ecaf8615
26 изменённых файлов: 805 добавлений и 91 удалений

Просмотреть файл

@ -1,5 +1,5 @@
PODS:
- ProjectOxfordFace (1.2.6)
- ProjectOxfordFace (1.3.0)
DEPENDENCIES:
- ProjectOxfordFace (from `../`)
@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
ProjectOxfordFace: 2117f7465e7a53e3557ad1f9a633d8d2104c9fa8
ProjectOxfordFace: 85f032721e0a4326358b752aebae082b3151a202
PODFILE CHECKSUM: a5d2c084667aa893cf7f8e0a5e76252611a40a74

Просмотреть файл

@ -508,7 +508,8 @@
ORGANIZATIONNAME = "David Porter";
TargetAttributes = {
6003F589195388D20070C39A = {
DevelopmentTeam = UBF8T346G9;
DevelopmentTeam = 5VZ53ZWHKU;
ProvisioningStyle = Automatic;
};
6003F5AD195388D20070C39A = {
DevelopmentTeam = 86C6K78PD9;
@ -834,7 +835,7 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = UBF8T346G9;
DEVELOPMENT_TEAM = 5VZ53ZWHKU;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ProjectOxfordFace/ProjectOxfordFace-Prefix.pch";
@ -842,7 +843,7 @@
INFOPLIST_FILE = "ProjectOxfordFace/ProjectOxfordFace-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.Pods-ProjectOxfordFace-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
@ -857,7 +858,7 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = UBF8T346G9;
DEVELOPMENT_TEAM = 5VZ53ZWHKU;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ProjectOxfordFace/ProjectOxfordFace-Prefix.pch";
@ -865,7 +866,7 @@
INFOPLIST_FILE = "ProjectOxfordFace/ProjectOxfordFace-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.Pods-ProjectOxfordFace-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;

Просмотреть файл

@ -33,13 +33,16 @@
@interface MPODetectionCell : UITableViewCell
@property (nonatomic, retain) NSString *ageText;
@property (nonatomic, retain) NSString *genderText;
@property (nonatomic, retain) NSString *smileText;
@property (nonatomic, retain) NSString *glassesText;
@property (nonatomic, retain) NSString *ageText;
@property (nonatomic, retain) NSString *hairText;
@property (nonatomic, retain) NSString *facialHairText;
@property (nonatomic, retain) NSString *headPoseText;
@property (nonatomic, retain) NSString *makeupText;
@property (nonatomic, retain) NSString *emotionText;
@property (nonatomic, retain) NSString *occlusionText;
@property (nonatomic, retain) NSString *exposureText;
@property (nonatomic, retain) NSString *headPoseText;
@property (nonatomic, retain) NSString *accessoriesText;
@property (nonatomic, retain) UIImage *faceImage;
@end

Просмотреть файл

@ -32,60 +32,78 @@
#import "MPODetectionCell.h"
@implementation MPODetectionCell {
UILabel * ageLabel;
UILabel * genderLabel;
UILabel * smileLabel;
UILabel * glassesLabel;
UILabel * ageLabel;
UILabel * hairLabel;
UILabel * facialHairLabel;
UILabel * makeupLabel;
UILabel * emotionLabel;
UILabel * moustacheLabel;
UILabel * occlusionLabel;
UILabel * exposureLabel;
UILabel * headPoseLabel;
UILabel * accessoriesLabel;
UIImageView * faceImageView;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
ageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
ageLabel.textColor = [UIColor grayColor];
ageLabel.textAlignment = NSTextAlignmentLeft;
ageLabel.font = [UIFont systemFontOfSize:14];
genderLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
genderLabel.textColor = [UIColor grayColor];
genderLabel.textAlignment = NSTextAlignmentLeft;
genderLabel.font = [UIFont systemFontOfSize:14];
smileLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
smileLabel.textColor = [UIColor grayColor];
smileLabel.textAlignment = NSTextAlignmentLeft;
smileLabel.font = [UIFont systemFontOfSize:14];
glassesLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
glassesLabel.textColor = [UIColor grayColor];
glassesLabel.textAlignment = NSTextAlignmentLeft;
glassesLabel.font = [UIFont systemFontOfSize:14];
genderLabel.font = [UIFont systemFontOfSize:12];
ageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
ageLabel.textColor = [UIColor grayColor];
ageLabel.textAlignment = NSTextAlignmentLeft;
ageLabel.font = [UIFont systemFontOfSize:12];
hairLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
hairLabel.textColor = [UIColor grayColor];
hairLabel.textAlignment = NSTextAlignmentLeft;
hairLabel.font = [UIFont systemFontOfSize:12];
facialHairLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
facialHairLabel.textColor = [UIColor grayColor];
facialHairLabel.textAlignment = NSTextAlignmentLeft;
facialHairLabel.font = [UIFont systemFontOfSize:12];
makeupLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
makeupLabel.textColor = [UIColor grayColor];
makeupLabel.textAlignment = NSTextAlignmentLeft;
makeupLabel.font = [UIFont systemFontOfSize:12];
emotionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
emotionLabel.textColor = [UIColor grayColor];
emotionLabel.textAlignment = NSTextAlignmentLeft;
emotionLabel.font = [UIFont systemFontOfSize:14];
moustacheLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
moustacheLabel.textColor = [UIColor grayColor];
moustacheLabel.textAlignment = NSTextAlignmentLeft;
moustacheLabel.font = [UIFont systemFontOfSize:14];
emotionLabel.font = [UIFont systemFontOfSize:12];
occlusionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
occlusionLabel.textColor = [UIColor grayColor];
occlusionLabel.textAlignment = NSTextAlignmentLeft;
occlusionLabel.font = [UIFont systemFontOfSize:12];
exposureLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
exposureLabel.textColor = [UIColor grayColor];
exposureLabel.textAlignment = NSTextAlignmentLeft;
exposureLabel.font = [UIFont systemFontOfSize:12];
headPoseLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
headPoseLabel.textColor = [UIColor grayColor];
headPoseLabel.textAlignment = NSTextAlignmentLeft;
headPoseLabel.font = [UIFont systemFontOfSize:12];
accessoriesLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
accessoriesLabel.textColor = [UIColor grayColor];
accessoriesLabel.textAlignment = NSTextAlignmentLeft;
accessoriesLabel.font = [UIFont systemFontOfSize:12];
faceImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 45, 45)];
faceImageView.center = self.center;
faceImageView.top = 10;
faceImageView.left = 10;
faceImageView.clipsToBounds = YES;
faceImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:ageLabel];
[self.contentView addSubview:genderLabel];
[self.contentView addSubview:smileLabel];
[self.contentView addSubview:glassesLabel];
[self.contentView addSubview:ageLabel];
[self.contentView addSubview:hairLabel];
[self.contentView addSubview:facialHairLabel];
[self.contentView addSubview:makeupLabel];
[self.contentView addSubview:emotionLabel];
[self.contentView addSubview:moustacheLabel];
[self.contentView addSubview:occlusionLabel];
[self.contentView addSubview:exposureLabel];
[self.contentView addSubview:headPoseLabel];
[self.contentView addSubview:accessoriesLabel];
[self.contentView addSubview:faceImageView];
self.backgroundColor = [UIColor clearColor];
}
@ -94,48 +112,68 @@
-(void)layoutSubviews{
[super layoutSubviews];
if (_ageText) {
ageLabel.text = _ageText;
}
[ageLabel sizeToFit];
ageLabel.left = faceImageView.right + 20;
ageLabel.top = 10;
if (_genderText) {
genderLabel.text = _genderText;
}
[genderLabel sizeToFit];
genderLabel.left = faceImageView.right + 20;
genderLabel.top = ageLabel.bottom + 5;
if (_smileText) {
smileLabel.text = _smileText;
genderLabel.top = 10;
if (_ageText) {
ageLabel.text = _ageText;
}
[smileLabel sizeToFit];
smileLabel.left = faceImageView.right + 20;
smileLabel.top = genderLabel.bottom + 5;
if (_glassesText) {
glassesLabel.text = _glassesText;
[ageLabel sizeToFit];
ageLabel.left = genderLabel.right + 10;
ageLabel.top = 10;
if (_hairText) {
hairLabel.text = _hairText;
}
[glassesLabel sizeToFit];
glassesLabel.left = faceImageView.right + 20;
glassesLabel.top = smileLabel.bottom + 5;
[hairLabel sizeToFit];
hairLabel.left = faceImageView.right + 20;
hairLabel.top = ageLabel.bottom + 5;
if (_facialHairText) {
facialHairLabel.text = _facialHairText;
}
[facialHairLabel sizeToFit];
facialHairLabel.left = hairLabel.right + 10;
facialHairLabel.top = ageLabel.bottom + 5;
if (_makeupText) {
makeupLabel.text = _makeupText;
}
[makeupLabel sizeToFit];
makeupLabel.left = faceImageView.right + 20;
makeupLabel.top = hairLabel.bottom + 5;
if (_emotionText) {
emotionLabel.text = _emotionText;
}
[emotionLabel sizeToFit];
emotionLabel.left = faceImageView.right + 20;
emotionLabel.top = glassesLabel.bottom + 5;
if (_facialHairText) {
moustacheLabel.text = _facialHairText;
emotionLabel.left = makeupLabel.right + 10;
emotionLabel.top = hairLabel.bottom + 5;
if (_occlusionText)
{
occlusionLabel.text = _occlusionText;
}
[moustacheLabel sizeToFit];
moustacheLabel.left = faceImageView.right + 20;
moustacheLabel.top = emotionLabel.bottom + 5;
[occlusionLabel sizeToFit];
occlusionLabel.left = faceImageView.right + 20;
occlusionLabel.top = makeupLabel.bottom + 5;
if (_exposureText)
{
exposureLabel.text = _exposureText;
}
[exposureLabel sizeToFit];
exposureLabel.left = occlusionLabel.right + 10;
exposureLabel.top = makeupLabel.bottom + 5;
if (_headPoseText) {
headPoseLabel.text = _headPoseText;
}
[headPoseLabel sizeToFit];
headPoseLabel.left = faceImageView.right + 20;
headPoseLabel.top = moustacheLabel.bottom + 5;
headPoseLabel.top = occlusionLabel.bottom + 5;
if (_accessoriesText) {
accessoriesLabel.text = _accessoriesText;
}
[accessoriesLabel sizeToFit];
accessoriesLabel.left = faceImageView.right + 20;
accessoriesLabel.top = headPoseLabel.bottom + 5;
if (_faceImage) {
faceImageView.image = _faceImage;
}

Просмотреть файл

@ -41,13 +41,16 @@
@interface MPODetectionFaceObject : NSObject
@property (nonatomic, strong) UIImage *croppedFaceImage;
@property (nonatomic, strong) NSString *ageText;
@property (nonatomic, strong) NSString *genderText;
@property (nonatomic, strong) NSString *smileText;
@property (nonatomic, strong) NSString *glassesText;
@property (nonatomic, strong) NSString *ageText;
@property (nonatomic, strong) NSString *hairText;
@property (nonatomic, strong) NSString *facialHairText;
@property (nonatomic, strong) NSString *headPoseText;
@property (nonatomic, strong) NSString *makeupText;
@property (nonatomic, strong) NSString *emotionText;
@property (nonatomic, strong) NSString *occlusionText;
@property (nonatomic, strong) NSString *exposureText;
@property (nonatomic, strong) NSString *headPoseText;
@property (nonatomic, strong) NSString *accessoriesText;
@end
@implementation MPODetectionFaceObject
@ -111,7 +114,7 @@
HUD.labelText = @"deteting faces";
[HUD show: YES];
[client detectWithData:data returnFaceId:YES returnFaceLandmarks:YES returnFaceAttributes:@[@(MPOFaceAttributeTypeAge), @(MPOFaceAttributeTypeGender), @(MPOFaceAttributeTypeSmile), @(MPOFaceAttributeTypeGlasses), @(MPOFaceAttributeTypeFacialHair), @(MPOFaceAttributeTypeHeadPose), @(MPOFaceAttributeTypeEmotion)] completionBlock:^(NSArray<MPOFace *> *collection, NSError *error) {
[client detectWithData:data returnFaceId:YES returnFaceLandmarks:YES returnFaceAttributes:@[@(MPOFaceAttributeTypeGender), @(MPOFaceAttributeTypeAge), @(MPOFaceAttributeTypeHair), @(MPOFaceAttributeTypeFacialHair), @(MPOFaceAttributeTypeMakeup), @(MPOFaceAttributeTypeEmotion), @(MPOFaceAttributeTypeOcclusion), @(MPOFaceAttributeTypeExposure), @(MPOFaceAttributeTypeHeadPose), @(MPOFaceAttributeTypeAccessories)] completionBlock:^(NSArray<MPOFace *> *collection, NSError *error) {
[HUD removeFromSuperview];
if (error) {
[CommonUtil showSimpleHUD:@"detection failed" forController:self.navigationController];
@ -123,13 +126,16 @@
UIImage *croppedImage = [_selectedImage crop:CGRectMake(face.faceRectangle.left.floatValue, face.faceRectangle.top.floatValue, face.faceRectangle.width.floatValue, face.faceRectangle.height.floatValue)];
MPODetectionFaceObject *obj = [[MPODetectionFaceObject alloc] init];
obj.croppedFaceImage = croppedImage;
obj.ageText = [NSString stringWithFormat:@"Age: %@", face.attributes.age.stringValue];
obj.genderText = [NSString stringWithFormat:@"Gender: %@", face.attributes.gender];
obj.smileText = [NSString stringWithFormat:@"Smile: %@", face.attributes.smile];
obj.glassesText = [NSString stringWithFormat:@"Glasses: %@", face.attributes.glasses];
obj.emotionText = [NSString stringWithFormat:@"Emotion: %@: %@", face.attributes.emotion.mostEmotion, face.attributes.emotion.mostEmotionValue];
obj.facialHairText = [NSString stringWithFormat:@"Moustache: %@, Beard: %@", face.attributes.facialHair.mustache.stringValue, face.attributes.facialHair.beard.stringValue];
obj.headPoseText = [NSString stringWithFormat:@"headPose: roll(%@), yaw(%@)", face.attributes.headPose.roll.stringValue, face.attributes.headPose.yaw.stringValue];
obj.ageText = [NSString stringWithFormat:@"Age: %@", face.attributes.age.stringValue];
obj.hairText = [NSString stringWithFormat:@"Hair: %@", face.attributes.hair.hair];
obj.facialHairText = [NSString stringWithFormat:@"Facial Hair: %@", face.attributes.facialHair.mustache.doubleValue + face.attributes.facialHair.beard.doubleValue + face.attributes.facialHair.sideburns.doubleValue > 0.0 ? @"Yes" : @"No"];
obj.makeupText = [NSString stringWithFormat:@"Makeup: %@", face.attributes.makeup.eyeMakeup.boolValue || face.attributes.makeup.lipMakeup.boolValue ? @"Yes" : @"No"];
obj.emotionText = [NSString stringWithFormat:@"Emotion: %@", face.attributes.emotion.mostEmotion];
obj.occlusionText = [NSString stringWithFormat:@"Occlusion: %@", face.attributes.occlusion.foreheadOccluded || face.attributes.occlusion.eyeOccluded || face.attributes.occlusion.mouthOccluded ? @"Yes" : @"No"];
obj.exposureText = [NSString stringWithFormat:@"Exposure: %@", face.attributes.exposure.exposureLevel];
obj.headPoseText = [NSString stringWithFormat:@"HeadPose: roll(%@), yaw(%@)", face.attributes.headPose.roll.stringValue, face.attributes.headPose.yaw.stringValue];
obj.accessoriesText = [NSString stringWithFormat:@"Accessories: %@", face.attributes.accessories.accessoriesString];
[_detectionFaces addObject:obj];
}
[_resultTableView reloadData];
@ -282,13 +288,16 @@
}
MPODetectionFaceObject * obj = _detectionFaces[indexPath.row];
cell.ageText = obj.ageText;
cell.genderText = obj.genderText;
cell.smileText = obj.smileText;
cell.glassesText = obj.glassesText;
cell.ageText = obj.ageText;
cell.hairText = obj.hairText;
cell.facialHairText = obj.facialHairText;
cell.headPoseText = obj.headPoseText;
cell.makeupText = obj.makeupText;
cell.emotionText = obj.emotionText;
cell.occlusionText = obj.occlusionText;
cell.exposureText = obj.exposureText;
cell.headPoseText = obj.headPoseText;
cell.accessoriesText = obj.accessoriesText;
cell.faceImage = obj.croppedFaceImage;
return cell;
}

Просмотреть файл

@ -325,7 +325,7 @@
_findBtn.enabled = NO;
_selectedTargetIndex = -1;
}
_imageCountLabel.text = [NSString stringWithFormat:@"%ld faces in total", _selectedFaces.count];
_imageCountLabel.text = [NSString stringWithFormat:@"%d faces in total", (int32_t)_selectedFaces.count];
[_imageContainer0 reloadData];
[_imageContainer1 reloadData];
if (collection.count == 0) {

Просмотреть файл

@ -17,13 +17,17 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>iOS SDK Sample for the Microsoft Face API requires access to the Camera for functionality.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>iOS SDK Sample for the Microsoft Face API requires access to the Photo Library for functionality.</string>
<key>UILaunchStoryboardName</key>
<string>Main</string>
<key>UIMainStoryboardFile</key>
@ -36,10 +40,6 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>NSCameraUsageDescription</key>
<string>iOS SDK Sample for the Microsoft Face API requires access to the Camera for functionality.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>iOS SDK Sample for the Microsoft Face API requires access to the Photo Library for functionality.</string>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>

Просмотреть файл

@ -0,0 +1,39 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface MPOAccessories : NSObject
@property NSArray *accessories;
@property NSMutableArray *accessoriesArray;
@property NSString *accessoriesString;
-(instancetype)initWithArray:(NSArray *)array;
@end

Просмотреть файл

@ -0,0 +1,56 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "MPOAccessories.h"
@implementation MPOAccessories
-(instancetype)initWithArray:(NSArray *)array {
self = [super init];
if (self) {
self.accessories = array;
if (self.accessories.count > 0)
{
self.accessoriesArray = [[NSMutableArray alloc] init];
for (NSDictionary *accessory in self.accessories)
{
[self.accessoriesArray addObject:accessory[@"type"]];
}
self.accessoriesString = [self.accessoriesArray componentsJoinedByString:@","];
}
else
{
self.accessoriesString = @"NoAccessories";
}
}
return self;
}
@end

38
Pod/Classes/MPOBlur.h Normal file
Просмотреть файл

@ -0,0 +1,38 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface MPOBlur : NSObject
@property NSString *blurLevel;
@property NSNumber *value;
-(instancetype)initWithDictionary:(NSDictionary *)dict;
@end

43
Pod/Classes/MPOBlur.m Normal file
Просмотреть файл

@ -0,0 +1,43 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "MPOBlur.h"
@implementation MPOBlur
-(instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (self) {
self.blurLevel = dict[@"blurLevel"];
self.value = dict[@"value"];
}
return self;
}
@end

38
Pod/Classes/MPOExposure.h Normal file
Просмотреть файл

@ -0,0 +1,38 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface MPOExposure : NSObject
@property NSString *exposureLevel;
@property NSNumber *value;
-(instancetype)initWithDictionary:(NSDictionary *)dict;
@end

43
Pod/Classes/MPOExposure.m Normal file
Просмотреть файл

@ -0,0 +1,43 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "MPOExposure.h"
@implementation MPOExposure
-(instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (self) {
self.exposureLevel = dict[@"exposureLevel"];
self.value = dict[@"value"];
}
return self;
}
@end

Просмотреть файл

@ -33,6 +33,13 @@
#import "MPOFacialHair.h"
#import "MPOFaceHeadPose.h"
#import "MPOFaceEmotion.h"
#import "MPOHair.h"
#import "MPOMakeup.h"
#import "MPOOcclusion.h"
#import "MPOAccessories.h"
#import "MPOBlur.h"
#import "MPOExposure.h"
#import "MPONoise.h"
@interface MPOFaceAttributes : NSObject
@property NSNumber *age;
@ -42,5 +49,12 @@
@property MPOFacialHair *facialHair;
@property MPOFaceHeadPose *headPose;
@property MPOFaceEmotion *emotion;
@property MPOHair *hair;
@property MPOMakeup *makeup;
@property MPOOcclusion *occlusion;
@property MPOAccessories *accessories;
@property MPOBlur *blur;
@property MPOExposure *exposure;
@property MPONoise *noise;
-(instancetype)initWithDictionary:(NSDictionary *)dict;
@end

Просмотреть файл

@ -41,6 +41,13 @@
self.facialHair = [[MPOFacialHair alloc] initWithDictionary:dict[@"facialHair"]];
self.emotion = [[MPOFaceEmotion alloc] initWithDictionary:dict[@"emotion"]];
self.headPose = [[MPOFaceHeadPose alloc] initWithDictionary:dict[@"headPose"]];
self.hair = [[MPOHair alloc] initWithDictionary:dict[@"hair"]];
self.makeup = [[MPOMakeup alloc] initWithDictionary:dict[@"makeup"]];
self.occlusion = [[MPOOcclusion alloc] initWithDictionary:dict[@"occlusion"]];
self.accessories = [[MPOAccessories alloc] initWithArray:dict[@"accessories"]];
self.blur = [[MPOBlur alloc] initWithDictionary:dict[@"blur"]];
self.exposure = [[MPOExposure alloc] initWithDictionary:dict[@"exposure"]];
self.noise = [[MPONoise alloc] initWithDictionary:dict[@"noise"]];
}
return self;
}

Просмотреть файл

@ -48,6 +48,13 @@ typedef enum {
MPOFaceAttributeTypeFacialHair,
MPOFaceAttributeTypeHeadPose,
MPOFaceAttributeTypeEmotion,
MPOFaceAttributeTypeHair,
MPOFaceAttributeTypeMakeup,
MPOFaceAttributeTypeOcclusion,
MPOFaceAttributeTypeAccessories,
MPOFaceAttributeTypeBlur,
MPOFaceAttributeTypeExposure,
MPOFaceAttributeTypeNoise,
} MPOFaceAttributeType;
typedef enum {

Просмотреть файл

@ -64,7 +64,6 @@ typedef void(^PORequestCompletionBlock)(NSURLResponse *response, id responseObje
if ([number isEqualToNumber:@(MPOFaceAttributeTypeAge)]) {
[faceAttributesStringArray addObject:@"age"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeGender)]) {
[faceAttributesStringArray addObject:@"gender"];
}
@ -83,6 +82,27 @@ typedef void(^PORequestCompletionBlock)(NSURLResponse *response, id responseObje
if ([number isEqualToNumber:@(MPOFaceAttributeTypeEmotion)]) {
[faceAttributesStringArray addObject:@"emotion"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeHair)]) {
[faceAttributesStringArray addObject:@"hair"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeMakeup)]) {
[faceAttributesStringArray addObject:@"makeup"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeOcclusion)]) {
[faceAttributesStringArray addObject:@"occlusion"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeAccessories)]) {
[faceAttributesStringArray addObject:@"accessories"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeBlur)]) {
[faceAttributesStringArray addObject:@"blur"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeExposure)]) {
[faceAttributesStringArray addObject:@"exposure"];
}
if ([number isEqualToNumber:@(MPOFaceAttributeTypeNoise)]) {
[faceAttributesStringArray addObject:@"noise"];
}
}
NSString *joinedComponents = [faceAttributesStringArray componentsJoinedByString:@","];
@ -416,13 +436,20 @@ typedef void(^PORequestCompletionBlock)(NSURLResponse *response, id responseObje
- (NSURLSessionDataTask *)getPersonsWithPersonGroupId:(NSString *)personGroupId completionBlock:(MPOPersonArrayCompletionBlock)completion {
return [self listPersonsWithPersonGroupId:personGroupId completionBlock:completion];
return [self listPersonsWithPersonGroupIdAndStart:personGroupId start:nil top:1000 completionBlock:completion];
}
- (NSURLSessionDataTask *)listPersonsWithPersonGroupId:(NSString *)personGroupId completionBlock:(MPOPersonArrayCompletionBlock)completion {
return [self startTaskWithHttpMethod:@"GET" path:[NSString stringWithFormat:@"persongroups/%@/persons", personGroupId] parameters:nil urlParams:nil bodyData:nil completion:^(NSURLResponse *response, id responseObject, NSError *error) {
return [self listPersonsWithPersonGroupIdAndStart:personGroupId start:nil top:1000 completionBlock:completion];
}
- (NSURLSessionDataTask *)listPersonsWithPersonGroupIdAndStart:(NSString *)personGroupId start:(NSString *)start top:(NSInteger)top completionBlock:(MPOPersonArrayCompletionBlock)completion {
NSString * url = [NSString stringWithFormat:@"persongroups/%@/persons?top=%ld", personGroupId, (long)top];
if (start != nil) {
url = [url stringByAppendingString:[NSString stringWithFormat:@"&start=%@", start]];
}
return [self startTaskWithHttpMethod:@"GET" path:url parameters:nil urlParams:nil bodyData:nil completion:^(NSURLResponse *response, id responseObject, NSError *error) {
NSMutableArray *personCollection = [[NSMutableArray alloc] init];
@ -436,7 +463,6 @@ typedef void(^PORequestCompletionBlock)(NSURLResponse *response, id responseObje
[self runCompletionOnMainQueueWithBlock:completion object:personCollection error:error];
}];
}
- (NSURLSessionDataTask *)getPersonFaceWithPersonGroupId:(NSString *)personGroupId personId:(NSString *)personId persistedFaceId:(NSString *)persistedFaceId completionBlock:(void (^) (MPOPersonFace *personFace, NSError *error))completion {

40
Pod/Classes/MPOHair.h Normal file
Просмотреть файл

@ -0,0 +1,40 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface MPOHair : NSObject
@property NSNumber *bald;
@property NSNumber *invisible;
@property NSArray *hairColor;
@property NSString *hair;
-(instancetype)initWithDictionary:(NSDictionary *)dict;
@end

67
Pod/Classes/MPOHair.m Normal file
Просмотреть файл

@ -0,0 +1,67 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "MPOHair.h"
@implementation MPOHair
-(instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (self) {
self.bald = dict[@"bald"];
self.invisible = dict[@"invisible"];
self.hairColor = dict[@"hairColor"];
if (self.hairColor.count == 0){
if ([self.invisible boolValue])
{
self.hair = @"Invisible";
}
else
{
self.hair = @"bald";
}
}
else {
self.hair = @"";
double hairMaxConfidence = 0.0;
for (NSDictionary *hairColor in self.hairColor)
{
if ([hairColor[@"confidence"] doubleValue] > hairMaxConfidence)
{
self.hair = hairColor[@"color"];
hairMaxConfidence = [hairColor[@"confidence"] doubleValue];
}
}
}
}
return self;
}
@end

38
Pod/Classes/MPOMakeup.h Normal file
Просмотреть файл

@ -0,0 +1,38 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface MPOMakeup : NSObject
@property NSNumber *eyeMakeup;
@property NSNumber *lipMakeup;
-(instancetype)initWithDictionary:(NSDictionary *)dict;
@end

43
Pod/Classes/MPOMakeup.m Normal file
Просмотреть файл

@ -0,0 +1,43 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "MPOMakeup.h"
@implementation MPOMakeup
-(instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (self) {
self.lipMakeup = dict[@"lipMakeup"];
self.eyeMakeup = dict[@"eyeMakeup"];
}
return self;
}
@end

38
Pod/Classes/MPONoise.h Normal file
Просмотреть файл

@ -0,0 +1,38 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface MPONoise : NSObject
@property NSString *noiseLevel;
@property NSNumber *value;
-(instancetype)initWithDictionary:(NSDictionary *)dict;
@end

43
Pod/Classes/MPONoise.m Normal file
Просмотреть файл

@ -0,0 +1,43 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "MPONoise.h"
@implementation MPONoise
-(instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (self) {
self.noiseLevel = dict[@"noiseLevel"];
self.value = dict[@"value"];
}
return self;
}
@end

Просмотреть файл

@ -0,0 +1,39 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface MPOOcclusion : NSObject
@property NSNumber *foreheadOccluded;
@property NSNumber *eyeOccluded;
@property NSNumber *mouthOccluded;
-(instancetype)initWithDictionary:(NSDictionary *)dict;
@end

Просмотреть файл

@ -0,0 +1,44 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services
//
// Microsoft Cognitive Services (formerly Project Oxford) GitHub:
// https://github.com/Microsoft/Cognitive-Face-iOS
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "MPOOcclusion.h"
@implementation MPOOcclusion
-(instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (self) {
self.foreheadOccluded = dict[@"foreheadOccluded"];
self.eyeOccluded = dict[@"eyeOccluded"];
self.mouthOccluded = dict[@"mouthOccluded"];
}
return self;
}
@end

Просмотреть файл

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ProjectOxfordFace"
s.version = "1.2.6"
s.version = "1.3.0"
s.summary = "Microsoft Cognitive Services - Face API iOS SDK"
s.description = <<-DESC
@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.screenshots = "https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot1.jpg","https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot2.jpg","https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot3.jpg","https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot4.jpg","https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot5.jpg","https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot6.jpg","https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot7.jpg","https://github.com/Microsoft/Cognitive-Face-iOS/raw/master/SampleScreenshots/SampleScreenshot8.jpg"
s.license = 'MIT'
s.author = { "Microsoft Cognitive Services SDK" => "oxfordGithub@microsoft.com" }
s.source = { :git => "https://github.com/Microsoft/Cognitive-Face-iOS.git", :branch => "master", :tag => '1.2.6' }
s.source = { :git => "https://github.com/Microsoft/Cognitive-Face-iOS.git", :branch => "master", :tag => '1.3.0' }
s.platform = :ios, '8.0'
s.requires_arc = true