vision-camera-face-detection 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +4 -3
- package/android/gradle.properties +0 -1
- package/android/src/main/java/com/visioncamerafacedetection/VisionCameraFaceDetectionModule.kt +6 -0
- package/ios/VisionCameraFaceDetectionModule.swift +9 -0
- package/lib/typescript/commonjs/src/Tensor.d.ts +3 -0
- package/lib/typescript/commonjs/src/Tensor.d.ts.map +1 -1
- package/lib/typescript/module/src/Tensor.d.ts +3 -0
- package/lib/typescript/module/src/Tensor.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/Tensor.ts +3 -0
package/android/build.gradle
CHANGED
|
@@ -80,7 +80,6 @@ repositories {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
83
|
-
def tensor_version = getExtOrDefault("tensorVersion")
|
|
84
83
|
|
|
85
84
|
dependencies {
|
|
86
85
|
implementation "com.facebook.react:react-android"
|
|
@@ -89,7 +88,9 @@ dependencies {
|
|
|
89
88
|
implementation "androidx.annotation:annotation:1.8.2"
|
|
90
89
|
implementation "androidx.camera:camera-core:1.3.4"
|
|
91
90
|
implementation "com.google.mlkit:face-detection:16.1.7"
|
|
92
|
-
implementation
|
|
93
|
-
implementation '
|
|
91
|
+
implementation 'com.google.ai.edge.litert:litert:1.4.0'
|
|
92
|
+
implementation 'com.google.ai.edge.litert:litert-api:1.4.0'
|
|
93
|
+
implementation 'com.google.ai.edge.litert:litert-support:1.4.0'
|
|
94
|
+
implementation 'com.google.ai.edge.litert:litert-metadata:1.4.0'
|
|
94
95
|
}
|
|
95
96
|
|
package/android/src/main/java/com/visioncamerafacedetection/VisionCameraFaceDetectionModule.kt
CHANGED
|
@@ -95,11 +95,17 @@ class VisionCameraFaceDetectionModule(private val reactContext: ReactApplication
|
|
|
95
95
|
map.putString("message", "Successfully Get Face")
|
|
96
96
|
map.putArray("data", arrayData)
|
|
97
97
|
map.putString("base64", FaceHelper().getBase64Image(bmpFaceStorage))
|
|
98
|
+
map.putDouble("leftEyeOpenProbability", face.leftEyeOpenProbability?.toDouble() ?: 0.0)
|
|
99
|
+
map.putDouble("rightEyeOpenProbability", face.rightEyeOpenProbability?.toDouble() ?: 0.0)
|
|
100
|
+
map.putDouble("smilingProbability", face.smilingProbability?.toDouble() ?: 0.0)
|
|
98
101
|
promise.resolve(map)
|
|
99
102
|
} else {
|
|
100
103
|
map.putString("message", "No Face")
|
|
101
104
|
map.putArray("data", Arguments.createArray())
|
|
102
105
|
map.putString("base64", "")
|
|
106
|
+
map.putDouble("leftEyeOpenProbability", 0.0)
|
|
107
|
+
map.putDouble("rightEyeOpenProbability", 0.0)
|
|
108
|
+
map.putDouble("smilingProbability", 0.0)
|
|
103
109
|
promise.resolve(map)
|
|
104
110
|
}
|
|
105
111
|
} catch (e: Exception) {
|
|
@@ -79,17 +79,26 @@ class VisionCameraFaceDetectionModule: NSObject {
|
|
|
79
79
|
map["message"] = "Successfully Get Face"
|
|
80
80
|
map["data"] = result
|
|
81
81
|
map["base64"] = FaceHelper.convertImageToBase64(image: imageCrop)
|
|
82
|
+
map["leftEyeOpenProbability"] = face?.leftEyeOpenProbability ?? 0.0
|
|
83
|
+
map["rightEyeOpenProbability"] = face?.rightEyeOpenProbability ?? 0.0
|
|
84
|
+
map["smilingProbability"] = face?.smilingProbability ?? 0.0
|
|
82
85
|
resolve(map)
|
|
83
86
|
} else {
|
|
84
87
|
map["message"] = "No Face"
|
|
85
88
|
map["data"] = []
|
|
86
89
|
map["base64"] = ""
|
|
90
|
+
map["leftEyeOpenProbability"] = 0.0
|
|
91
|
+
map["rightEyeOpenProbability"] = 0.0
|
|
92
|
+
map["smilingProbability"] = 0.0
|
|
87
93
|
resolve(map)
|
|
88
94
|
}
|
|
89
95
|
} else {
|
|
90
96
|
map["message"] = "No Face"
|
|
91
97
|
map["data"] = []
|
|
92
98
|
map["base64"] = ""
|
|
99
|
+
map["leftEyeOpenProbability"] = 0.0
|
|
100
|
+
map["rightEyeOpenProbability"] = 0.0
|
|
101
|
+
map["smilingProbability"] = 0.0
|
|
93
102
|
resolve(map)
|
|
94
103
|
}
|
|
95
104
|
} catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tensor.d.ts","sourceRoot":"","sources":["../../../../src/Tensor.ts"],"names":[],"mappings":"AAoBA,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Tensor.d.ts","sourceRoot":"","sources":["../../../../src/Tensor.ts"],"names":[],"mappings":"AAoBA,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tensor.d.ts","sourceRoot":"","sources":["../../../../src/Tensor.ts"],"names":[],"mappings":"AAoBA,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Tensor.d.ts","sourceRoot":"","sources":["../../../../src/Tensor.ts"],"names":[],"mappings":"AAoBA,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7E;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vision-camera-face-detection",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "Plugin Face Detection for Vision Camera 4",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"react": "19.0.0",
|
|
81
81
|
"react-native": "0.78.3",
|
|
82
82
|
"react-native-builder-bob": "^0.36.0",
|
|
83
|
-
"react-native-vision-camera": "^4.7.
|
|
84
|
-
"react-native-worklets-core": "^1.6.
|
|
83
|
+
"react-native-vision-camera": "^4.7.1",
|
|
84
|
+
"react-native-worklets-core": "^1.6.2",
|
|
85
85
|
"release-it": "^17.10.0",
|
|
86
86
|
"turbo": "^1.10.7",
|
|
87
87
|
"typescript": "^5.2.2"
|