react-native-vision-camera-spoof-detector 1.0.23 → 1.0.24

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.
@@ -0,0 +1,42 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import <objc/runtime.h>
3
+ #import <objc/message.h>
4
+
5
+ // At load time, attempt to register the Swift FrameProcessor plugin with VisionCamera
6
+ __attribute__((constructor)) static void register_face_anti_spoof_plugin(void) {
7
+ @autoreleasepool {
8
+ Class registry = NSClassFromString(@"FrameProcessorPluginRegistry");
9
+
10
+ if (registry == Nil) {
11
+ return; // VisionCamera not available yet
12
+ }
13
+
14
+ SEL selector = NSSelectorFromString(@"addFrameProcessorPlugin:withInitializer:");
15
+ if (![registry respondsToSelector:selector]) {
16
+ return;
17
+ }
18
+
19
+ // Create initializer block using objc_msgSend to avoid compile-time selector checks
20
+ id initializer = ^id(id proxy, id options) {
21
+ Class dynClass = NSClassFromString(@"FaceAntiSpoofFrameProcessor");
22
+ if (dynClass == Nil) {
23
+ return nil;
24
+ }
25
+ SEL allocSel = sel_registerName("alloc");
26
+ id alloced = ((id (*)(id, SEL))objc_msgSend)((id)dynClass, allocSel);
27
+
28
+ // Swift's exported Objective-C initializer name is `initWithProxy:options:`
29
+ SEL initSel = sel_registerName("initWithProxy:options:");
30
+ if (![alloced respondsToSelector:initSel]) {
31
+ return nil;
32
+ }
33
+ id instance = ((id (*)(id, SEL, id, id))objc_msgSend)(alloced, initSel, proxy, options);
34
+ return instance;
35
+ };
36
+
37
+ // Call +addFrameProcessorPlugin:name with the block
38
+ // We use objc_msgSend to avoid compile-time dependency on the header signature
39
+ void (*msgSend)(id, SEL, id, id) = (void (*)(id, SEL, id, id))objc_msgSend;
40
+ msgSend((id)registry, selector, @"faceAntiSpoof", initializer);
41
+ }
42
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "model_file": "FaceAntiSpoofing.tflite",
3
+ "input": {
4
+ "shape": [1, 256, 256, 3],
5
+ "dtype": "float32",
6
+ "normalization": {"scale": 255.0}
7
+ },
8
+ "outputs": {
9
+ "Identity": {"shape": [1,8], "dtype": "float32", "description": "class predictions (clss_pred)"},
10
+ "Identity_1": {"shape": [1,8], "dtype": "float32", "description": "leaf node mask (leaf_node_mask)"}
11
+ },
12
+ "post_processing": {
13
+ "leafScore": "sum(abs(clss_pred[i]) * leaf_node_mask[i]) for i in 0..7",
14
+ "combinedScore": "calculated from neural and laplacian scores as in Android implementation"
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-vision-camera-spoof-detector",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "High-performance face anti-spoofing and liveness detection module for React Native Vision Camera. Uses TensorFlow Lite with GPU acceleration and optimized YUV processing.",
5
5
  "homepage": "https://github.com/dpraful/react-native-vision-camera-spoof-detector",
6
6
  "repository": {
@@ -28,6 +28,7 @@
28
28
  "types": "index.d.ts",
29
29
  "files": [
30
30
  "android/",
31
+ "ios/",
31
32
  ".gitattributes",
32
33
  ".gitignore",
33
34
  ".npmignore",
package/.gitignore DELETED
@@ -1,27 +0,0 @@
1
- # Compiled class file
2
- *.class
3
-
4
- # Log file
5
- *.log
6
-
7
- # BlueJ files
8
- *.ctxt
9
-
10
- # Mobile Tools for Java (J2ME)
11
- .mtj.tmp/
12
-
13
- # Package Files #
14
- *.jar
15
- *.war
16
- *.nar
17
- *.ear
18
- *.zip
19
- *.tar.gz
20
- *.rar
21
-
22
- # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23
- hs_err_pid*
24
- replay_pid*
25
-
26
- # Kotlin Gradle plugin data, see https://kotlinlang.org/docs/whatsnew20.html#new-directory-for-kotlin-data-in-gradle-projects
27
- .kotlin/