From b462be542a41a4e37a201146642f1b9fd4c6a74f Mon Sep 17 00:00:00 2001 From: Russell Wheatley Date: Mon, 22 Jun 2020 12:59:38 +0100 Subject: [PATCH] fix(ml-vision): convert options to correct type (#3694) --- .../RNFBMLVisionFaceDetectorModule.m | 28 +++++++++---------- tests/e2e/mocha.opts | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/ml-vision/ios/RNFBMLVision/RNFBMLVisionFaceDetectorModule.m b/packages/ml-vision/ios/RNFBMLVision/RNFBMLVisionFaceDetectorModule.m index 68ac79bcb4..891c3d334e 100644 --- a/packages/ml-vision/ios/RNFBMLVision/RNFBMLVisionFaceDetectorModule.m +++ b/packages/ml-vision/ios/RNFBMLVision/RNFBMLVisionFaceDetectorModule.m @@ -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 *faces, NSError *error) { diff --git a/tests/e2e/mocha.opts b/tests/e2e/mocha.opts index 23592e0f10..e6cf508a0c 100644 --- a/tests/e2e/mocha.opts +++ b/tests/e2e/mocha.opts @@ -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