Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smille and eyes issues fixed #13

Open
FawadAhmad007 opened this issue Dec 20, 2024 · 0 comments
Open

smille and eyes issues fixed #13

FawadAhmad007 opened this issue Dec 20, 2024 · 0 comments

Comments

@FawadAhmad007
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-face-detection@0.1.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-face-detection/ios/FaceDetection.m b/node_modules/react-native-face-detection/ios/FaceDetection.m
index 3a44179..efabfc4 100644
--- a/node_modules/react-native-face-detection/ios/FaceDetection.m
+++ b/node_modules/react-native-face-detection/ios/FaceDetection.m
@@ -39,31 +39,31 @@ + (BOOL)requiresMainQueueSetup
         
         MLKFaceDetectorOptions *options = [[MLKFaceDetectorOptions alloc] init];
         
-        NSInteger *classificationMode = [faceDetectorOptions[@"classificationMode"] pointerValue];
-        if (classificationMode == (NSInteger *) 1) {
+        NSInteger *classificationMode = [faceDetectorOptions[@"classificationMode"] integerValue];
+        if (classificationMode == 1) {
           options.classificationMode = MLKFaceDetectorClassificationModeNone;
-        } else if (classificationMode == (NSInteger *) 2) {
+        } else if (classificationMode == 2) {
           options.classificationMode = MLKFaceDetectorClassificationModeAll;
         }
 
-        NSInteger *contourMode = [faceDetectorOptions[@"contourMode"] pointerValue];
-        if (contourMode == (NSInteger *) 1) {
+        NSInteger *contourMode = [faceDetectorOptions[@"contourMode"] integerValue];
+        if (contourMode == 1) {
           options.contourMode = MLKFaceDetectorContourModeNone;
-        } else if (contourMode == (NSInteger *) 2) {
+        } else if (contourMode == 2) {
           options.contourMode = MLKFaceDetectorContourModeAll;
         }
 
-        NSInteger *landmarkMode = [faceDetectorOptions[@"landmarkMode"] pointerValue];
-        if (landmarkMode == (NSInteger *) 1) {
+        NSInteger *landmarkMode = [faceDetectorOptions[@"landmarkMode"] integerValue];
+        if (landmarkMode == 1) {
           options.landmarkMode = MLKFaceDetectorLandmarkModeNone;
-        } else if (landmarkMode == (NSInteger *) 2) {
+        } else if (landmarkMode == 2) {
           options.landmarkMode = MLKFaceDetectorLandmarkModeAll;
         }
 
-        NSInteger *performanceMode = [faceDetectorOptions[@"performanceMode"] pointerValue];
-        if (performanceMode == (NSInteger *) 1) {
+        NSInteger *performanceMode = [faceDetectorOptions[@"performanceMode"] integerValue];
+        if (performanceMode == 1) {
           options.performanceMode = MLKFaceDetectorPerformanceModeFast;
-        } else if (performanceMode == (NSInteger *) 2) {
+        } else if (performanceMode == 2) {
           options.performanceMode = MLKFaceDetectorPerformanceModeAccurate;
         }
 

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant