Skip to content

Commit

Permalink
fix(ml-vision): convert options to correct type (#3694)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley authored Jun 22, 2020
1 parent dc7f921 commit b462be5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,35 @@ @implementation RNFBMLVisionFaceDetectorModule

FIRVisionFaceDetectorOptions *options = [[FIRVisionFaceDetectorOptions alloc] init];

NSInteger *classificationMode = [faceDetectorOptions[@"classificationMode"] pointerValue];
if (classificationMode == (NSInteger *) 1) {
NSInteger *classificationMode = [faceDetectorOptions[@"classificationMode"] integerValue];
if (classificationMode == 1) {
options.classificationMode = FIRVisionFaceDetectorClassificationModeNone;
} else if (classificationMode == (NSInteger *) 2) {
} else if (classificationMode == 2) {
options.classificationMode = FIRVisionFaceDetectorClassificationModeAll;
}

NSInteger *contourMode = [faceDetectorOptions[@"contourMode"] pointerValue];
if (contourMode == (NSInteger *) 1) {
NSInteger *contourMode = [faceDetectorOptions[@"contourMode"] integerValue];
if (contourMode == 1) {
options.contourMode = FIRVisionFaceDetectorContourModeNone;
} else if (contourMode == (NSInteger *) 2) {
} else if (contourMode == 2) {
options.contourMode = FIRVisionFaceDetectorContourModeAll;
}

NSInteger *landmarkMode = [faceDetectorOptions[@"landmarkMode"] pointerValue];
if (landmarkMode == (NSInteger *) 1) {
NSInteger *landmarkMode = [faceDetectorOptions[@"landmarkMode"] integerValue];
if (landmarkMode == 1) {
options.landmarkMode = FIRVisionFaceDetectorLandmarkModeNone;
} else if (landmarkMode == (NSInteger *) 2) {
} else if (landmarkMode == 2) {
options.landmarkMode = FIRVisionFaceDetectorLandmarkModeAll;
}

NSInteger *performanceMode = [faceDetectorOptions[@"performanceMode"] pointerValue];
if (performanceMode == (NSInteger *) 1) {
NSInteger *performanceMode = [faceDetectorOptions[@"performanceMode"] integerValue];
if (performanceMode == 1) {
options.performanceMode = FIRVisionFaceDetectorPerformanceModeFast;
} else if (performanceMode == (NSInteger *) 2) {
} else if (performanceMode == 2) {
options.performanceMode = FIRVisionFaceDetectorPerformanceModeAccurate;
}

options.minFaceSize = (CGFloat) [faceDetectorOptions[@"minFaceSize"] doubleValue];
options.minFaceSize = [faceDetectorOptions[@"minFaceSize"] doubleValue];

FIRVisionFaceDetector *faceDetector = [vision faceDetectorWithOptions:options];
[faceDetector processImage:visionImage completion:^(NSArray<FIRVisionFace *> *faces, NSError *error) {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/mocha.opts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
../packages/ml-natural-language/e2e/*.e2e.js

# TODO - ci crashing ios
# ../packages/ml-vision/e2e/*.e2e.js
../packages/ml-vision/e2e/*.e2e.js

../packages/in-app-messaging/e2e/*.e2e.js

Expand Down

0 comments on commit b462be5

Please sign in to comment.