react-native-vision-camera-spoof-detector 1.0.10 → 1.0.11
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/.cxx/Debug/2a1it684/arm64-v8a/.ninja_deps +0 -0
- package/android/.cxx/Debug/2a1it684/arm64-v8a/.ninja_log +63 -125
- package/android/.cxx/Debug/2a1it684/arm64-v8a/CMakeFiles/CMakeOutput.log +22 -22
- package/android/.cxx/Debug/2a1it684/arm64-v8a/configure_fingerprint.bin +15 -15
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/.cmake/api/v1/reply/{codemodel-v2-053850119b681f93cecc.json → codemodel-v2-52ac1d8b40b69596389b.json} +2 -2
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/.cmake/api/v1/reply/{index-2025-11-28T05-47-43-0297.json → index-2025-11-28T10-11-49-0251.json} +2 -2
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/.cmake/api/v1/reply/{target-yuv-Debug-a12ad49ff79080871bce.json → target-yuv-Debug-97f9e822dbd84a186d44.json} +2 -2
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/.cmake/api/v1/reply/{target-yuv_shared-Debug-2b00e64621a56b8dd632.json → target-yuv_shared-Debug-3730d20e27c3481c06b2.json} +2 -2
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/.ninja_deps +0 -0
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/.ninja_log +118 -118
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/CMakeFiles/CMakeOutput.log +20 -20
- package/android/.cxx/Debug/2a1it684/armeabi-v7a/configure_fingerprint.bin +15 -15
- package/android/.cxx/Debug/2a1it684/x86/.ninja_deps +0 -0
- package/android/.cxx/Debug/2a1it684/x86/.ninja_log +110 -110
- package/android/.cxx/Debug/2a1it684/x86/CMakeFiles/CMakeOutput.log +20 -20
- package/android/.cxx/Debug/2a1it684/x86/configure_fingerprint.bin +15 -15
- package/android/.cxx/Debug/2a1it684/x86_64/.ninja_deps +0 -0
- package/android/.cxx/Debug/2a1it684/x86_64/.ninja_log +55 -109
- package/android/.cxx/Debug/2a1it684/x86_64/CMakeFiles/CMakeOutput.log +20 -20
- package/android/.cxx/Debug/2a1it684/x86_64/configure_fingerprint.bin +15 -15
- package/android/.cxx/RelWithDebInfo/4j18496e/arm64-v8a/.cmake/api/v1/reply/{cache-v2-6623bfcc99de2cc494ef.json → cache-v2-713bdb62a69e904e7a40.json} +0 -32
- package/android/.cxx/RelWithDebInfo/4j18496e/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-cd34d86bd6491de94aff.json +242 -0
- package/android/.cxx/RelWithDebInfo/4j18496e/arm64-v8a/.cmake/api/v1/reply/{index-2025-11-28T06-24-02-0919.json → index-2025-11-28T10-31-16-0807.json} +4 -4
- package/android/.cxx/RelWithDebInfo/4j18496e/arm64-v8a/.ninja_log +30 -26
- package/android/.cxx/RelWithDebInfo/4j18496e/arm64-v8a/build.ninja +9 -126
- package/android/.cxx/RelWithDebInfo/4j18496e/armeabi-v7a/.cmake/api/v1/reply/{cache-v2-8dbd652239f8f876061c.json → cache-v2-2d1ffe11487c93774ec8.json} +0 -32
- package/android/.cxx/RelWithDebInfo/4j18496e/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-add1fe675e54139ba31d.json +242 -0
- package/android/.cxx/RelWithDebInfo/4j18496e/armeabi-v7a/.cmake/api/v1/reply/{index-2025-11-28T06-24-04-0739.json → index-2025-11-28T10-31-15-0830.json} +4 -4
- package/android/.cxx/RelWithDebInfo/4j18496e/armeabi-v7a/.ninja_log +29 -25
- package/android/.cxx/RelWithDebInfo/4j18496e/armeabi-v7a/build.ninja +9 -118
- package/android/.cxx/RelWithDebInfo/4j18496e/x86/.cmake/api/v1/reply/{cache-v2-a231ab394224ff7786ac.json → cache-v2-0d273fdde7ef8023cff3.json} +0 -32
- package/android/.cxx/RelWithDebInfo/4j18496e/x86/.cmake/api/v1/reply/cmakeFiles-v1-b5eb1b67ae71b7871ac6.json +242 -0
- package/android/.cxx/RelWithDebInfo/4j18496e/x86/.cmake/api/v1/reply/{index-2025-11-28T06-24-25-0724.json → index-2025-11-28T10-31-17-0373.json} +4 -4
- package/android/.cxx/RelWithDebInfo/4j18496e/x86/.ninja_log +27 -23
- package/android/.cxx/RelWithDebInfo/4j18496e/x86/build.ninja +9 -110
- package/android/.cxx/RelWithDebInfo/4j18496e/x86_64/.cmake/api/v1/reply/{cache-v2-9ee538105c735fb117da.json → cache-v2-dc05d184ae0d43117f44.json} +0 -32
- package/android/.cxx/RelWithDebInfo/4j18496e/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-30b2c98f8b47b6cd442b.json +242 -0
- package/android/.cxx/RelWithDebInfo/4j18496e/x86_64/.cmake/api/v1/reply/{index-2025-11-28T06-24-36-0773.json → index-2025-11-28T10-31-17-0962.json} +4 -4
- package/android/.cxx/RelWithDebInfo/4j18496e/x86_64/.ninja_log +24 -20
- package/android/.cxx/RelWithDebInfo/4j18496e/x86_64/build.ninja +9 -110
- package/android/build/.transforms/4ebf3dd0dca4f83fe1776360e21ded81/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/AntiSpoofingResult.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofFrameProcessor.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofingAdvanced$Companion.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofingAdvanced$SpoofDetectionResult.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofingAdvanced.dex +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/arm64-v8a/build_stdout_targets.txt +1 -62
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/arm64-v8a/generate_cxx_metadata_1929_timing.txt +11 -0
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/arm64-v8a/generate_cxx_metadata_2140_timing.txt +9 -0
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/armeabi-v7a/build_stdout_targets.txt +1 -58
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/{x86/generate_cxx_metadata_709_timing.txt → armeabi-v7a/generate_cxx_metadata_2140_timing.txt} +1 -1
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/x86/build_stdout_targets.txt +1 -54
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/x86/generate_cxx_metadata_1929_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/x86/generate_cxx_metadata_2140_timing.txt +3 -0
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/x86_64/build_stdout_targets.txt +1 -54
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/x86_64/generate_cxx_metadata_1929_timing.txt +9 -0
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/x86_64/generate_cxx_metadata_2140_timing.txt +9 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/AntiSpoofingResult.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofFrameProcessor.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofingAdvanced$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofingAdvanced$SpoofDetectionResult.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofingAdvanced.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/AntiSpoofingResult.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofFrameProcessor.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofingAdvanced$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofingAdvanced$SpoofDetectionResult.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofingAdvanced.class +0 -0
- package/android/src/main/java/com/faceantispoof/FaceAntiSpoofFrameProcessor.kt +1 -7
- package/android/src/main/java/com/faceantispoof/FaceAntiSpoofingAdvanced.kt +12 -274
- package/index.js +34 -5
- package/package.json +1 -1
- package/android/.cxx/RelWithDebInfo/4j18496e/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-55b275e149a5fd56941d.json +0 -857
- package/android/.cxx/RelWithDebInfo/4j18496e/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-1807188101b481e0cb6e.json +0 -857
- package/android/.cxx/RelWithDebInfo/4j18496e/x86/.cmake/api/v1/reply/cmakeFiles-v1-c1b964e67354b2182b02.json +0 -857
- package/android/.cxx/RelWithDebInfo/4j18496e/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-e1bbc53ef79693fbefba.json +0 -857
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/FaceAntiSpoofingAdvanced$EnvironmentAssessment.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/ImageFormatEncoder$ImageFormat.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/ImageFormatEncoder$WhenMappings.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/ImageFormatEncoder.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/JpegEncoder$Companion.dex +0 -0
- package/android/build/.transforms/c0a07cd9442d741ad3cef3760159211f/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/faceantispoof/JpegEncoder.dex +0 -0
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/arm64-v8a/generate_cxx_metadata_709_timing.txt +0 -9
- package/android/build/intermediates/cxx/Debug/2a1it684/logs/x86_64/generate_cxx_metadata_709_timing.txt +0 -9
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/FaceAntiSpoofingAdvanced$EnvironmentAssessment.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/ImageFormatEncoder$ImageFormat.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/ImageFormatEncoder$WhenMappings.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/ImageFormatEncoder.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/JpegEncoder$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/faceantispoof/JpegEncoder.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/FaceAntiSpoofingAdvanced$EnvironmentAssessment.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/ImageFormatEncoder$ImageFormat.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/ImageFormatEncoder$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/ImageFormatEncoder.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/JpegEncoder$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/faceantispoof/JpegEncoder.class +0 -0
- package/android/src/main/java/com/faceantispoof/ImageFormatEncoder.kt +0 -519
- package/android/src/main/java/com/faceantispoof/JpegEncoder.kt +0 -245
- /package/android/.cxx/Debug/2a1it684/arm64-v8a/.cmake/api/v1/reply/{index-2025-11-28T07-46-12-0329.json → index-2025-11-28T11-07-00-0336.json} +0 -0
- /package/android/.cxx/Debug/2a1it684/x86/.cmake/api/v1/reply/{index-2025-11-28T05-47-50-0796.json → index-2025-11-28T10-11-55-0886.json} +0 -0
- /package/android/.cxx/Debug/2a1it684/x86_64/.cmake/api/v1/reply/{index-2025-11-28T07-46-59-0151.json → index-2025-11-28T11-07-01-0193.json} +0 -0
- /package/android/build/intermediates/cxx/Debug/2a1it684/logs/armeabi-v7a/{generate_cxx_metadata_709_timing.txt → generate_cxx_metadata_1929_timing.txt} +0 -0
|
@@ -14,10 +14,6 @@ import java.nio.ByteOrder
|
|
|
14
14
|
import java.util.*
|
|
15
15
|
import android.util.Log
|
|
16
16
|
import kotlin.collections.ArrayList
|
|
17
|
-
import android.util.Base64
|
|
18
|
-
import com.faceantispoof.ImageFormatEncoder
|
|
19
|
-
import com.faceantispoof.ImageFormatEncoder.ImageFormat
|
|
20
|
-
|
|
21
17
|
class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
22
18
|
|
|
23
19
|
companion object {
|
|
@@ -34,12 +30,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
34
30
|
const val ACCELERATOR_GPU = "GPU"
|
|
35
31
|
const val ACCELERATOR_NNAPI = "NNAPI"
|
|
36
32
|
|
|
37
|
-
// ENHANCED IMAGE FORMAT CONFIGURATION FOR FACE RECOGNITION
|
|
38
|
-
// Optimized for maximum quality for face detection APIs
|
|
39
|
-
const val DEFAULT_IMAGE_FORMAT = "JPEG" // Options: "JPEG", "PNG", "BMP"
|
|
40
|
-
const val DEFAULT_JPEG_QUALITY = 92 // Increased from 85 to 92 for better quality
|
|
41
|
-
const val DEFAULT_OUTPUT_RESOLUTION = 640 // 640×640 for face recognition
|
|
42
|
-
|
|
43
33
|
// Advanced spoof detection constants
|
|
44
34
|
private const val HISTORY_SIZE = 10
|
|
45
35
|
private const val TEMPORAL_CONSISTENCY_THRESHOLD = 0.12f // More lenient for slightly moving faces
|
|
@@ -50,10 +40,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
50
40
|
private const val COLOR_SATURATION_THRESHOLD = 0.4f
|
|
51
41
|
private const val DEPTH_VARIATION_THRESHOLD = 0.1f
|
|
52
42
|
|
|
53
|
-
// STABILITY ENHANCEMENT CONSTANTS
|
|
54
|
-
private const val BLUR_DETECTION_THRESHOLD = 100 // Laplacian score threshold
|
|
55
|
-
private const val MIN_STABLE_FRAMES = 3 // Require stable frames before generating base64
|
|
56
|
-
private const val MOTION_THRESHOLD = 0.1f // Limit motion/instability
|
|
57
43
|
}
|
|
58
44
|
|
|
59
45
|
private var interpreter: Interpreter? = null
|
|
@@ -61,11 +47,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
61
47
|
private var gpuDelegate: GpuDelegate? = null
|
|
62
48
|
private var currentAccelerator: String = ACCELERATOR_CPU
|
|
63
49
|
|
|
64
|
-
// Image format configuration for face recognition
|
|
65
|
-
private var outputImageFormat: String = DEFAULT_IMAGE_FORMAT
|
|
66
|
-
private var outputImageQuality: Int = DEFAULT_JPEG_QUALITY
|
|
67
|
-
private var outputImageResolution: Int = DEFAULT_OUTPUT_RESOLUTION
|
|
68
|
-
|
|
69
50
|
// Reusable buffers to avoid per-frame allocations
|
|
70
51
|
private val inputImageSize = INPUT_IMAGE_SIZE
|
|
71
52
|
private val inputBuffer: ByteBuffer = ByteBuffer.allocateDirect(4 * inputImageSize * inputImageSize * 3).order(ByteOrder.nativeOrder())
|
|
@@ -83,21 +64,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
83
64
|
private val laplacianHistory = LinkedList<Int>()
|
|
84
65
|
private var frameCount = 0
|
|
85
66
|
private var adaptiveThreshold = BASE_THRESHOLD
|
|
86
|
-
private var environmentAssessment = EnvironmentAssessment()
|
|
87
|
-
|
|
88
|
-
// STABILITY AND QUALITY TRACKING
|
|
89
|
-
private var consecutiveQualityFrames = 0 // Track consecutive high-quality frames
|
|
90
|
-
private var lastStableFrameTime = System.currentTimeMillis()
|
|
91
|
-
private var lastProcessedBlurScore = 0
|
|
92
|
-
private var frameStabilityScore = 0f
|
|
93
|
-
|
|
94
|
-
data class EnvironmentAssessment(
|
|
95
|
-
var avgBrightness: Float = 0f,
|
|
96
|
-
var brightnessVariance: Float = 0f,
|
|
97
|
-
var estimatedDistance: Float = 0f,
|
|
98
|
-
var lightingConsistency: Float = 0f,
|
|
99
|
-
var lastAssessmentTime: Long = 0
|
|
100
|
-
)
|
|
101
67
|
|
|
102
68
|
init {
|
|
103
69
|
initializeInterpreter()
|
|
@@ -114,7 +80,7 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
114
80
|
options.setNumThreads(optimalThreads)
|
|
115
81
|
|
|
116
82
|
currentAccelerator = ACCELERATOR_CPU
|
|
117
|
-
Log.i(TAG, "
|
|
83
|
+
Log.i(TAG, "FORCED CPU-ONLY MODE - Bypassing GPU/NNAPI")
|
|
118
84
|
Log.i(TAG, "Using $optimalThreads threads for CPU inference")
|
|
119
85
|
|
|
120
86
|
interpreter = Interpreter(modelBuffer, options)
|
|
@@ -130,9 +96,9 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
130
96
|
outputs[outputIndex0] = clssPred
|
|
131
97
|
outputs[outputIndex1] = leafNodeMask
|
|
132
98
|
isInitialized = true
|
|
133
|
-
Log.i(TAG, "
|
|
99
|
+
Log.i(TAG, "Face Anti-Spoof initialized | CPU-ONLY MODE | Threads: $optimalThreads")
|
|
134
100
|
} catch (e: Exception) {
|
|
135
|
-
Log.e(TAG, "
|
|
101
|
+
Log.e(TAG, "FAILED to load TFLite model: ${e.message}", e)
|
|
136
102
|
isInitialized = false
|
|
137
103
|
currentAccelerator = ACCELERATOR_CPU
|
|
138
104
|
}
|
|
@@ -177,57 +143,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
177
143
|
|
|
178
144
|
fun getAccelerator(): String = currentAccelerator
|
|
179
145
|
|
|
180
|
-
/**
|
|
181
|
-
* Configure output image format for face recognition system.
|
|
182
|
-
* Supports JPEG (compressed), PNG (lossless), or BMP (uncompressed).
|
|
183
|
-
*
|
|
184
|
-
* @param format Image format: "JPEG" (default), "PNG", or "BMP"
|
|
185
|
-
* @param quality JPEG quality 0-100 (only applies to JPEG, ignored for PNG/BMP)
|
|
186
|
-
* @param resolution Output resolution in pixels (640 for 640×640, etc.)
|
|
187
|
-
*/
|
|
188
|
-
fun setImageFormatConfig(
|
|
189
|
-
format: String = "JPEG",
|
|
190
|
-
quality: Int = 85,
|
|
191
|
-
resolution: Int = 640
|
|
192
|
-
) {
|
|
193
|
-
val uppercaseFormat = format.uppercase()
|
|
194
|
-
outputImageFormat = if (uppercaseFormat in listOf("JPEG", "PNG", "BMP")) {
|
|
195
|
-
uppercaseFormat
|
|
196
|
-
} else {
|
|
197
|
-
"JPEG"
|
|
198
|
-
}
|
|
199
|
-
outputImageQuality = quality.coerceIn(1, 100)
|
|
200
|
-
outputImageResolution = resolution.coerceIn(64, 2048)
|
|
201
|
-
Log.d(TAG, "Image format config: $outputImageFormat quality=$outputImageQuality resolution=${outputImageResolution}×${outputImageResolution}")
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Get current image format configuration.
|
|
206
|
-
* @return Map containing format, quality, and resolution
|
|
207
|
-
*/
|
|
208
|
-
fun getImageFormatConfig(): Map<String, Any> {
|
|
209
|
-
return mapOf(
|
|
210
|
-
"format" to outputImageFormat,
|
|
211
|
-
"quality" to outputImageQuality,
|
|
212
|
-
"resolution" to outputImageResolution,
|
|
213
|
-
"estimatedSize" to estimateImageSize()
|
|
214
|
-
)
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Estimate output image size for current format configuration.
|
|
219
|
-
* Useful for memory and network planning.
|
|
220
|
-
*/
|
|
221
|
-
private fun estimateImageSize(): Long {
|
|
222
|
-
val pixelCount = outputImageResolution.toLong() * outputImageResolution
|
|
223
|
-
return when (outputImageFormat) {
|
|
224
|
-
"JPEG" -> (pixelCount * (100 - outputImageQuality) * 0.0012).toLong() // Quality-based estimation
|
|
225
|
-
"PNG" -> (pixelCount * 0.5).toLong() // PNG typically 2-4x larger than JPEG
|
|
226
|
-
"BMP" -> pixelCount * 3 // Uncompressed RGB
|
|
227
|
-
else -> (pixelCount * 0.12).toLong()
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
146
|
fun advancedAntiSpoofing(nv21: ByteArray, width: Int, height: Int): AntiSpoofingResult {
|
|
232
147
|
if (!isInitialized) {
|
|
233
148
|
return AntiSpoofingResult(
|
|
@@ -240,23 +155,20 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
240
155
|
isLive = false,
|
|
241
156
|
confidence = 0f,
|
|
242
157
|
label = "Not Initialized",
|
|
243
|
-
spoofType = "UNKNOWN"
|
|
244
|
-
imageFormat = outputImageFormat,
|
|
245
|
-
imageResolution = outputImageResolution,
|
|
246
|
-
imageQuality = outputImageQuality
|
|
158
|
+
spoofType = "UNKNOWN"
|
|
247
159
|
)
|
|
248
160
|
}
|
|
249
161
|
|
|
250
162
|
// Enhanced input validation
|
|
251
|
-
if (nv21.isEmpty()) {
|
|
252
|
-
|
|
253
|
-
|
|
163
|
+
if (nv21.isEmpty() || width <= 0 || height <= 0) {
|
|
164
|
+
Log.w(TAG, "Invalid input: nv21 empty=${nv21.isEmpty()}, width=$width, height=$height")
|
|
165
|
+
return AntiSpoofingResult(0f, 0, 0, 0f, 0f, 0f, false, 0f, "Invalid input parameters", "INVALID_INPUT")
|
|
254
166
|
}
|
|
255
167
|
|
|
256
168
|
val expectedSize = width * height + (width * height) / 2
|
|
257
169
|
if (nv21.size < expectedSize) {
|
|
258
|
-
|
|
259
|
-
|
|
170
|
+
Log.w(TAG, "Buffer size mismatch: expected $expectedSize, got ${nv21.size}")
|
|
171
|
+
return AntiSpoofingResult(0f, 0, 0, 0f, 0f, 0f, false, 0f, "Buffer size mismatch", "INVALID_INPUT")
|
|
260
172
|
}
|
|
261
173
|
|
|
262
174
|
return try {
|
|
@@ -267,9 +179,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
267
179
|
val colorSat = calculateColorSaturation(nv21, width, height)
|
|
268
180
|
val temporalConsistency = calculateTemporalConsistency(nnScore)
|
|
269
181
|
|
|
270
|
-
// Update adaptive threshold based on environment
|
|
271
|
-
updateAdaptiveThreshold(nv21, width, height)
|
|
272
|
-
|
|
273
182
|
// Multi-factor spoof detection
|
|
274
183
|
val spoofDetection = detectSpoofType(
|
|
275
184
|
nnScore,
|
|
@@ -292,53 +201,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
292
201
|
spoofDetection
|
|
293
202
|
)
|
|
294
203
|
|
|
295
|
-
// Generate recognition image (JPEG/PNG/BMP) Base64 when face is live
|
|
296
|
-
var recognitionImageBase64: String? = null
|
|
297
|
-
val DEBUG_FORCE_BASE64 = false // Set to true to force Base64 generation for testing
|
|
298
|
-
|
|
299
|
-
// STABILITY CHECK: Only generate base64 for high-quality, stable frames
|
|
300
|
-
val isQualityFrame = laplacianScore > BLUR_DETECTION_THRESHOLD &&
|
|
301
|
-
temporalConsistency < MOTION_THRESHOLD &&
|
|
302
|
-
textureScore > TEXTURE_COMPLEXITY_THRESHOLD / 2
|
|
303
|
-
|
|
304
|
-
if (isQualityFrame) {
|
|
305
|
-
consecutiveQualityFrames++
|
|
306
|
-
frameStabilityScore = (laplacianScore.toFloat() / 1000f).coerceIn(0f, 1f)
|
|
307
|
-
} else {
|
|
308
|
-
consecutiveQualityFrames = 0
|
|
309
|
-
frameStabilityScore = 0f
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// Only generate base64 after collecting stable frames
|
|
313
|
-
val shouldGenerateBase64 = (isLive && (consecutiveQualityFrames >= MIN_STABLE_FRAMES || DEBUG_FORCE_BASE64)) ||
|
|
314
|
-
DEBUG_FORCE_BASE64
|
|
315
|
-
|
|
316
|
-
if (shouldGenerateBase64) {
|
|
317
|
-
Log.d(TAG, "🔍 Quality Frame Detected - Stability Score: $frameStabilityScore (${consecutiveQualityFrames}/$MIN_STABLE_FRAMES frames)")
|
|
318
|
-
Log.d(TAG, " Blur Score: $laplacianScore (threshold: $BLUR_DETECTION_THRESHOLD)")
|
|
319
|
-
Log.d(TAG, " Motion: $temporalConsistency (threshold: $MOTION_THRESHOLD)")
|
|
320
|
-
Log.d(TAG, " Texture: $textureScore (min: ${TEXTURE_COMPLEXITY_THRESHOLD / 2})")
|
|
321
|
-
|
|
322
|
-
try {
|
|
323
|
-
recognitionImageBase64 = generateRecognitionImageBase64(nv21, width, height)
|
|
324
|
-
if (recognitionImageBase64 != null) {
|
|
325
|
-
Log.d(TAG, "✅ Generated 640x640 JPEG Base64 for recognition API (size: ${recognitionImageBase64.length} bytes)")
|
|
326
|
-
} else {
|
|
327
|
-
Log.w(TAG, "⚠️ generateRecognitionImageBase64 returned null")
|
|
328
|
-
}
|
|
329
|
-
} catch (e: Exception) {
|
|
330
|
-
Log.w(TAG, "❌ Failed to generate Base64: ${e.message}", e)
|
|
331
|
-
// Continue without the image - it's not critical
|
|
332
|
-
}
|
|
333
|
-
} else {
|
|
334
|
-
if (!isLive) {
|
|
335
|
-
Log.d(TAG, "🚫 Not generating Base64 - Spoof detected (${spoofDetection.type})")
|
|
336
|
-
} else {
|
|
337
|
-
Log.d(TAG, "🚫 Waiting for stable frames... (${consecutiveQualityFrames}/$MIN_STABLE_FRAMES)")
|
|
338
|
-
Log.d(TAG, " Quality Score: $frameStabilityScore | Blur: $laplacianScore | Motion: $temporalConsistency")
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
204
|
AntiSpoofingResult(
|
|
343
205
|
neuralNetworkScore = nnScore,
|
|
344
206
|
laplacianScore = laplacianScore,
|
|
@@ -349,16 +211,11 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
349
211
|
isLive = isLive,
|
|
350
212
|
confidence = confidence,
|
|
351
213
|
label = if (isLive) "Live Face" else "Spoof Face: ${spoofDetection.type}",
|
|
352
|
-
spoofType = spoofDetection.type
|
|
353
|
-
recognitionImageBase64 = recognitionImageBase64,
|
|
354
|
-
imageFormat = outputImageFormat,
|
|
355
|
-
imageResolution = outputImageResolution,
|
|
356
|
-
imageQuality = outputImageQuality
|
|
214
|
+
spoofType = spoofDetection.type
|
|
357
215
|
)
|
|
358
216
|
} catch (e: Exception) {
|
|
359
217
|
Log.e(TAG, "Error in advancedAntiSpoofing", e)
|
|
360
|
-
AntiSpoofingResult(0f, 0, 0, 0f, 0f, 0f, false, 0f, "Error: ${e.message}", "PROCESSING_ERROR"
|
|
361
|
-
imageFormat = outputImageFormat, imageResolution = outputImageResolution, imageQuality = outputImageQuality)
|
|
218
|
+
AntiSpoofingResult(0f, 0, 0, 0f, 0f, 0f, false, 0f, "Error: ${e.message}", "PROCESSING_ERROR")
|
|
362
219
|
}
|
|
363
220
|
}
|
|
364
221
|
|
|
@@ -449,91 +306,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
449
306
|
* @param height Original frame height
|
|
450
307
|
* @return Base64 encoded image string, or null if generation fails
|
|
451
308
|
*/
|
|
452
|
-
private fun generateRecognitionImageBase64(nv21: ByteArray, width: Int, height: Int): String? {
|
|
453
|
-
return try {
|
|
454
|
-
Log.d(TAG, "Starting HIGH-QUALITY ${outputImageResolution}×${outputImageResolution} $outputImageFormat generation...")
|
|
455
|
-
Log.d(TAG, "Input: ${width}x${height}, JPEG Quality: $outputImageQuality (optimized for face detection)")
|
|
456
|
-
|
|
457
|
-
// Convert NV21 to RGB byte array using HIGH-QUALITY BILINEAR interpolation
|
|
458
|
-
val rgbBytes = ByteArray(outputImageResolution * outputImageResolution * 3)
|
|
459
|
-
Log.d(TAG, "Allocated RGB buffer: ${rgbBytes.size} bytes")
|
|
460
|
-
|
|
461
|
-
val startConvert = System.currentTimeMillis()
|
|
462
|
-
val convertedRgb = yuvConverter.nv21ToRgbByteArray(
|
|
463
|
-
nv21, width, height,
|
|
464
|
-
outputImageResolution, outputImageResolution,
|
|
465
|
-
rgbBytes
|
|
466
|
-
)
|
|
467
|
-
val convertTime = System.currentTimeMillis() - startConvert
|
|
468
|
-
Log.d(TAG, "✓ YUV→RGB conversion (bilinear): ${convertTime}ms | ${convertedRgb.size} bytes")
|
|
469
|
-
|
|
470
|
-
// Encode RGB to target format with sharpening
|
|
471
|
-
// NOTE: ImageFormatEncoder.rgbToBase64() automatically:
|
|
472
|
-
// - Applies unsharp masking for edge enhancement
|
|
473
|
-
// - Converts RGB→BGR for OpenCV compatibility
|
|
474
|
-
// - Uses optimized JPEG quality
|
|
475
|
-
val startEncode = System.currentTimeMillis()
|
|
476
|
-
val format = when (outputImageFormat) {
|
|
477
|
-
"PNG" -> ImageFormatEncoder.ImageFormat.PNG
|
|
478
|
-
"BMP" -> ImageFormatEncoder.ImageFormat.BMP
|
|
479
|
-
else -> ImageFormatEncoder.ImageFormat.JPEG
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
val base64Result = ImageFormatEncoder.rgbToBase64(
|
|
483
|
-
convertedRgb,
|
|
484
|
-
outputImageResolution,
|
|
485
|
-
outputImageResolution,
|
|
486
|
-
format,
|
|
487
|
-
outputImageQuality // Using quality 92 for better face detection
|
|
488
|
-
)
|
|
489
|
-
val encodeTime = System.currentTimeMillis() - startEncode
|
|
490
|
-
|
|
491
|
-
if (base64Result != null) {
|
|
492
|
-
Log.d(TAG, "✓ $outputImageFormat encoding (with sharpening): ${encodeTime}ms")
|
|
493
|
-
Log.d(TAG, "✅ HIGH-QUALITY Base64 Generated:")
|
|
494
|
-
Log.d(TAG, " Resolution: ${outputImageResolution}×${outputImageResolution}")
|
|
495
|
-
Log.d(TAG, " Format: $outputImageFormat (BGR for OpenCV)")
|
|
496
|
-
Log.d(TAG, " Quality: $outputImageQuality (enhanced for face recognition)")
|
|
497
|
-
Log.d(TAG, " Size: ${base64Result.length} chars (est. ${base64Result.length * 0.75 / 1024}KB)")
|
|
498
|
-
Log.d(TAG, " Total Time: ${convertTime + encodeTime}ms")
|
|
499
|
-
val estSize = estimateImageSize()
|
|
500
|
-
Log.d(TAG, " Estimated: ${estSize / 1024}KB")
|
|
501
|
-
} else {
|
|
502
|
-
Log.w(TAG, "⚠️ ImageFormatEncoder returned null")
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
base64Result
|
|
506
|
-
} catch (e: Exception) {
|
|
507
|
-
Log.e(TAG, "❌ Error generating ${outputImageResolution}×${outputImageResolution} $outputImageFormat Base64 (BGR format): ${e.message}", e)
|
|
508
|
-
e.printStackTrace()
|
|
509
|
-
null
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Legacy method: Generate 640×640 JPEG image as Base64 string.
|
|
515
|
-
* Kept for backward compatibility. Use generateRecognitionImageBase64() for new code.
|
|
516
|
-
*/
|
|
517
|
-
@Deprecated("Use generateRecognitionImageBase64() instead", ReplaceWith("generateRecognitionImageBase64(nv21, width, height)"))
|
|
518
|
-
private fun generate640x640JpegBase64(nv21: ByteArray, width: Int, height: Int): String? {
|
|
519
|
-
// Temporarily set format to JPEG for backward compatibility
|
|
520
|
-
val savedFormat = outputImageFormat
|
|
521
|
-
outputImageFormat = "JPEG"
|
|
522
|
-
val savedQuality = outputImageQuality
|
|
523
|
-
outputImageQuality = 85
|
|
524
|
-
val savedResolution = outputImageResolution
|
|
525
|
-
outputImageResolution = 640
|
|
526
|
-
|
|
527
|
-
val result = generateRecognitionImageBase64(nv21, width, height)
|
|
528
|
-
|
|
529
|
-
// Restore original config
|
|
530
|
-
outputImageFormat = savedFormat
|
|
531
|
-
outputImageQuality = savedQuality
|
|
532
|
-
outputImageResolution = savedResolution
|
|
533
|
-
|
|
534
|
-
return result
|
|
535
|
-
}
|
|
536
|
-
|
|
537
309
|
private fun leafScore1(clssPred: Array<FloatArray>, leafNodeMask: Array<FloatArray>): Float {
|
|
538
310
|
if (clssPred.isEmpty() || clssPred[0].isEmpty()) {
|
|
539
311
|
Log.e(TAG, "clssPred array is empty or null")
|
|
@@ -678,35 +450,6 @@ class FaceAntiSpoofingAdvanced(private val assetManager: AssetManager) {
|
|
|
678
450
|
return max(0f, 1.0f - (variance / SCORE_VARIANCE_THRESHOLD))
|
|
679
451
|
}
|
|
680
452
|
|
|
681
|
-
private fun updateAdaptiveThreshold(nv21: ByteArray, width: Int, height: Int) {
|
|
682
|
-
// Adjust threshold based on environmental factors
|
|
683
|
-
val brightness = calculateBrightness(nv21, width, height)
|
|
684
|
-
val currentTime = System.currentTimeMillis()
|
|
685
|
-
|
|
686
|
-
if (currentTime - environmentAssessment.lastAssessmentTime > 1000) { // Assess every second
|
|
687
|
-
environmentAssessment.avgBrightness = brightness
|
|
688
|
-
environmentAssessment.lastAssessmentTime = currentTime
|
|
689
|
-
|
|
690
|
-
// Make threshold more strict in good lighting conditions
|
|
691
|
-
adaptiveThreshold = if (brightness > 0.6f) {
|
|
692
|
-
BASE_THRESHOLD * 0.8f // Stricter in good light
|
|
693
|
-
} else if (brightness < 0.3f) {
|
|
694
|
-
BASE_THRESHOLD * 1.2f // Slightly more lenient in poor light
|
|
695
|
-
} else {
|
|
696
|
-
BASE_THRESHOLD
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
private fun calculateBrightness(nv21: ByteArray, width: Int, height: Int): Float {
|
|
702
|
-
// Calculate average brightness from Y channel
|
|
703
|
-
var totalLuma = 0f
|
|
704
|
-
for (i in 0 until width * height) {
|
|
705
|
-
totalLuma += (nv21[i].toInt() and 0xFF) / 255.0f
|
|
706
|
-
}
|
|
707
|
-
return totalLuma / (width * height)
|
|
708
|
-
}
|
|
709
|
-
|
|
710
453
|
data class SpoofDetectionResult(
|
|
711
454
|
val type: String,
|
|
712
455
|
val confidence: Float
|
|
@@ -931,10 +674,5 @@ data class AntiSpoofingResult(
|
|
|
931
674
|
val isLive: Boolean,
|
|
932
675
|
val confidence: Float,
|
|
933
676
|
val label: String,
|
|
934
|
-
val spoofType: String
|
|
935
|
-
val recognitionImageBase64: String? = null,
|
|
936
|
-
// Image format metadata
|
|
937
|
-
val imageFormat: String = "JPEG", // Format: JPEG, PNG, BMP
|
|
938
|
-
val imageResolution: Int = 640, // 640×640, 1280×720, etc.
|
|
939
|
-
val imageQuality: Int = 85 // Quality for JPEG (0-100)
|
|
677
|
+
val spoofType: String
|
|
940
678
|
)
|
package/index.js
CHANGED
|
@@ -9,12 +9,31 @@ const _faceAntiSpoofPlugin = VisionCameraProxy.initFrameProcessorPlugin('faceAnt
|
|
|
9
9
|
export const faceAntiSpoofFrameProcessor = function (frame) {
|
|
10
10
|
'worklet';
|
|
11
11
|
try {
|
|
12
|
-
if (_faceAntiSpoofPlugin
|
|
13
|
-
|
|
12
|
+
if (!_faceAntiSpoofPlugin) {
|
|
13
|
+
console.warn('[FaceAntiSpoof] Plugin not initialized');
|
|
14
|
+
return null;
|
|
14
15
|
}
|
|
16
|
+
|
|
17
|
+
if (typeof _faceAntiSpoofPlugin.call !== 'function') {
|
|
18
|
+
console.warn('[FaceAntiSpoof] Plugin call method not available');
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (!frame) {
|
|
23
|
+
console.warn('[FaceAntiSpoof] Frame is null or undefined');
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const result = _faceAntiSpoofPlugin.call(frame);
|
|
28
|
+
|
|
29
|
+
// Validate result structure
|
|
30
|
+
if (result && typeof result === 'object') {
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
|
|
15
34
|
return null;
|
|
16
35
|
} catch (err) {
|
|
17
|
-
console.error('[FaceAntiSpoof] Error in frame processor
|
|
36
|
+
console.error('[FaceAntiSpoof] Error in frame processor:', err);
|
|
18
37
|
return null;
|
|
19
38
|
}
|
|
20
39
|
};
|
|
@@ -28,18 +47,28 @@ export const isFaceAntiSpoofAvailable = () => {
|
|
|
28
47
|
|
|
29
48
|
export const initializeFaceAntiSpoof = async () => {
|
|
30
49
|
try {
|
|
50
|
+
if (!FaceAntiSpoof) {
|
|
51
|
+
throw new Error('FaceAntiSpoof module not available on this platform');
|
|
52
|
+
}
|
|
53
|
+
|
|
31
54
|
const result = await FaceAntiSpoof.initialize();
|
|
32
55
|
const status = await FaceAntiSpoof.checkModelStatus();
|
|
33
56
|
|
|
57
|
+
if (!result || !status) {
|
|
58
|
+
throw new Error('Initialization returned empty result');
|
|
59
|
+
}
|
|
60
|
+
|
|
34
61
|
try {
|
|
35
62
|
if (typeof FaceAntiSpoof.install === 'function') {
|
|
36
63
|
await FaceAntiSpoof.install();
|
|
37
64
|
}
|
|
38
65
|
} catch (e) {
|
|
39
|
-
console.
|
|
66
|
+
console.warn('[FaceAntiSpoof] install() failed:', e);
|
|
40
67
|
}
|
|
41
68
|
|
|
42
|
-
|
|
69
|
+
const isSuccess = result && status.pluginAvailable;
|
|
70
|
+
console.log('[FaceAntiSpoof] Initialization result:', isSuccess);
|
|
71
|
+
return isSuccess;
|
|
43
72
|
} catch (error) {
|
|
44
73
|
console.error('[FaceAntiSpoof] Initialization failed:', error);
|
|
45
74
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-vision-camera-spoof-detector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
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/jescon-tech/react-native-vision-camera-spoof-detector",
|
|
6
6
|
"repository": {
|