diff --git a/FaceLivenessDetection-Bridging-Header.h b/FaceLivenessDetection-Bridging-Header.h new file mode 100644 index 0000000..b23e14c --- /dev/null +++ b/FaceLivenessDetection-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// +#import "facesdk/facesdk.h" diff --git a/FaceLivenessDetection.xcodeproj/project.pbxproj b/FaceLivenessDetection.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f0e04c2 --- /dev/null +++ b/FaceLivenessDetection.xcodeproj/project.pbxproj @@ -0,0 +1,694 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + CE29C4EC29E84471008EDB5A /* UIImageFixedOrientationExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE29C4EB29E84470008EDB5A /* UIImageFixedOrientationExtension.swift */; }; + CE29C4EE29E8503F008EDB5A /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE29C4ED29E8503E008EDB5A /* AboutViewController.swift */; }; + CE29C4F029E865D4008EDB5A /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE29C4EF29E865D4008EDB5A /* SettingsViewController.swift */; }; + CEA38C1329E733A50030D4E5 /* FaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA38C1229E733A50030D4E5 /* FaceView.swift */; }; + CEA38C1F29E79F900030D4E5 /* CameraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA38C1E29E79F900030D4E5 /* CameraViewController.swift */; }; + CEAE555129E6623200DE0DD9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555029E6623200DE0DD9 /* AppDelegate.swift */; }; + CEAE555329E6623200DE0DD9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555229E6623200DE0DD9 /* SceneDelegate.swift */; }; + CEAE555529E6623200DE0DD9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555429E6623200DE0DD9 /* ViewController.swift */; }; + CEAE555829E6623200DE0DD9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEAE555629E6623200DE0DD9 /* Main.storyboard */; }; + CEAE555B29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555929E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld */; }; + CEAE555D29E6625000DE0DD9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CEAE555C29E6625000DE0DD9 /* Assets.xcassets */; }; + CEAE556029E6625000DE0DD9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEAE555E29E6625000DE0DD9 /* LaunchScreen.storyboard */; }; + CEAE556B29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE556A29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift */; }; + CEAE557529E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE557429E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift */; }; + CEAE557729E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE557629E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift */; }; + CEF802D929E70D4700039E96 /* facesdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEF802D829E70D4600039E96 /* facesdk.framework */; }; + CEF802DA29E70D4700039E96 /* facesdk.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CEF802D829E70D4600039E96 /* facesdk.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + CEAE556729E6625100DE0DD9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CEAE554529E6623200DE0DD9 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CEAE554C29E6623200DE0DD9; + remoteInfo = FaceLivenessDetection; + }; + CEAE557129E6625100DE0DD9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CEAE554529E6623200DE0DD9 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CEAE554C29E6623200DE0DD9; + remoteInfo = FaceLivenessDetection; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + CEF802DB29E70D4800039E96 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + CEF802DA29E70D4700039E96 /* facesdk.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + CE29C4EB29E84470008EDB5A /* UIImageFixedOrientationExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImageFixedOrientationExtension.swift; sourceTree = ""; }; + CE29C4ED29E8503E008EDB5A /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; + CE29C4EF29E865D4008EDB5A /* SettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = ""; }; + CEA38C1229E733A50030D4E5 /* FaceView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FaceView.swift; sourceTree = ""; }; + CEA38C1E29E79F900030D4E5 /* CameraViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraViewController.swift; sourceTree = ""; }; + CEAE554D29E6623200DE0DD9 /* FaceLivenessDetection.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FaceLivenessDetection.app; sourceTree = BUILT_PRODUCTS_DIR; }; + CEAE555029E6623200DE0DD9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + CEAE555229E6623200DE0DD9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + CEAE555429E6623200DE0DD9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + CEAE555729E6623200DE0DD9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + CEAE555A29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = FaceLivenessDetection.xcdatamodel; sourceTree = ""; }; + CEAE555C29E6625000DE0DD9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + CEAE555F29E6625000DE0DD9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + CEAE556129E6625000DE0DD9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + CEAE556629E6625100DE0DD9 /* FaceLivenessDetectionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FaceLivenessDetectionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CEAE556A29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceLivenessDetectionTests.swift; sourceTree = ""; }; + CEAE557029E6625100DE0DD9 /* FaceLivenessDetectionUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FaceLivenessDetectionUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + CEAE557429E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceLivenessDetectionUITests.swift; sourceTree = ""; }; + CEAE557629E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceLivenessDetectionUITestsLaunchTests.swift; sourceTree = ""; }; + CEF802D829E70D4600039E96 /* facesdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = facesdk.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CEAE554A29E6623200DE0DD9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CEF802D929E70D4700039E96 /* facesdk.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEAE556329E6625100DE0DD9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEAE556D29E6625100DE0DD9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CEAE554429E6623200DE0DD9 = { + isa = PBXGroup; + children = ( + CEAE554F29E6623200DE0DD9 /* FaceLivenessDetection */, + CEAE556929E6625100DE0DD9 /* FaceLivenessDetectionTests */, + CEAE557329E6625100DE0DD9 /* FaceLivenessDetectionUITests */, + CEAE554E29E6623200DE0DD9 /* Products */, + CEF802D729E70D4000039E96 /* Frameworks */, + ); + sourceTree = ""; + }; + CEAE554E29E6623200DE0DD9 /* Products */ = { + isa = PBXGroup; + children = ( + CEAE554D29E6623200DE0DD9 /* FaceLivenessDetection.app */, + CEAE556629E6625100DE0DD9 /* FaceLivenessDetectionTests.xctest */, + CEAE557029E6625100DE0DD9 /* FaceLivenessDetectionUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + CEAE554F29E6623200DE0DD9 /* FaceLivenessDetection */ = { + isa = PBXGroup; + children = ( + CEAE555029E6623200DE0DD9 /* AppDelegate.swift */, + CE29C4ED29E8503E008EDB5A /* AboutViewController.swift */, + CEAE555229E6623200DE0DD9 /* SceneDelegate.swift */, + CEAE555429E6623200DE0DD9 /* ViewController.swift */, + CEA38C1E29E79F900030D4E5 /* CameraViewController.swift */, + CE29C4EB29E84470008EDB5A /* UIImageFixedOrientationExtension.swift */, + CE29C4EF29E865D4008EDB5A /* SettingsViewController.swift */, + CEA38C1229E733A50030D4E5 /* FaceView.swift */, + CEAE555629E6623200DE0DD9 /* Main.storyboard */, + CEAE555C29E6625000DE0DD9 /* Assets.xcassets */, + CEAE555E29E6625000DE0DD9 /* LaunchScreen.storyboard */, + CEAE556129E6625000DE0DD9 /* Info.plist */, + CEAE555929E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld */, + ); + path = FaceLivenessDetection; + sourceTree = ""; + }; + CEAE556929E6625100DE0DD9 /* FaceLivenessDetectionTests */ = { + isa = PBXGroup; + children = ( + CEAE556A29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift */, + ); + path = FaceLivenessDetectionTests; + sourceTree = ""; + }; + CEAE557329E6625100DE0DD9 /* FaceLivenessDetectionUITests */ = { + isa = PBXGroup; + children = ( + CEAE557429E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift */, + CEAE557629E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift */, + ); + path = FaceLivenessDetectionUITests; + sourceTree = ""; + }; + CEF802D729E70D4000039E96 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CEF802D829E70D4600039E96 /* facesdk.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */ = { + isa = PBXNativeTarget; + buildConfigurationList = CEAE557A29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetection" */; + buildPhases = ( + CEAE554929E6623200DE0DD9 /* Sources */, + CEAE554A29E6623200DE0DD9 /* Frameworks */, + CEAE554B29E6623200DE0DD9 /* Resources */, + CEF802DB29E70D4800039E96 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FaceLivenessDetection; + productName = FaceLivenessDetection; + productReference = CEAE554D29E6623200DE0DD9 /* FaceLivenessDetection.app */; + productType = "com.apple.product-type.application"; + }; + CEAE556529E6625100DE0DD9 /* FaceLivenessDetectionTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CEAE557D29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionTests" */; + buildPhases = ( + CEAE556229E6625100DE0DD9 /* Sources */, + CEAE556329E6625100DE0DD9 /* Frameworks */, + CEAE556429E6625100DE0DD9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CEAE556829E6625100DE0DD9 /* PBXTargetDependency */, + ); + name = FaceLivenessDetectionTests; + productName = FaceLivenessDetectionTests; + productReference = CEAE556629E6625100DE0DD9 /* FaceLivenessDetectionTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + CEAE556F29E6625100DE0DD9 /* FaceLivenessDetectionUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = CEAE558029E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionUITests" */; + buildPhases = ( + CEAE556C29E6625100DE0DD9 /* Sources */, + CEAE556D29E6625100DE0DD9 /* Frameworks */, + CEAE556E29E6625100DE0DD9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CEAE557229E6625100DE0DD9 /* PBXTargetDependency */, + ); + name = FaceLivenessDetectionUITests; + productName = FaceLivenessDetectionUITests; + productReference = CEAE557029E6625100DE0DD9 /* FaceLivenessDetectionUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CEAE554529E6623200DE0DD9 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1420; + LastUpgradeCheck = 1420; + TargetAttributes = { + CEAE554C29E6623200DE0DD9 = { + CreatedOnToolsVersion = 14.2; + }; + CEAE556529E6625100DE0DD9 = { + CreatedOnToolsVersion = 14.2; + TestTargetID = CEAE554C29E6623200DE0DD9; + }; + CEAE556F29E6625100DE0DD9 = { + CreatedOnToolsVersion = 14.2; + TestTargetID = CEAE554C29E6623200DE0DD9; + }; + }; + }; + buildConfigurationList = CEAE554829E6623200DE0DD9 /* Build configuration list for PBXProject "FaceLivenessDetection" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CEAE554429E6623200DE0DD9; + productRefGroup = CEAE554E29E6623200DE0DD9 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */, + CEAE556529E6625100DE0DD9 /* FaceLivenessDetectionTests */, + CEAE556F29E6625100DE0DD9 /* FaceLivenessDetectionUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + CEAE554B29E6623200DE0DD9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CEAE556029E6625000DE0DD9 /* LaunchScreen.storyboard in Resources */, + CEAE555D29E6625000DE0DD9 /* Assets.xcassets in Resources */, + CEAE555829E6623200DE0DD9 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEAE556429E6625100DE0DD9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEAE556E29E6625100DE0DD9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + CEAE554929E6623200DE0DD9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CEAE555529E6623200DE0DD9 /* ViewController.swift in Sources */, + CE29C4EC29E84471008EDB5A /* UIImageFixedOrientationExtension.swift in Sources */, + CEAE555B29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld in Sources */, + CEAE555129E6623200DE0DD9 /* AppDelegate.swift in Sources */, + CEAE555329E6623200DE0DD9 /* SceneDelegate.swift in Sources */, + CEA38C1329E733A50030D4E5 /* FaceView.swift in Sources */, + CE29C4EE29E8503F008EDB5A /* AboutViewController.swift in Sources */, + CEA38C1F29E79F900030D4E5 /* CameraViewController.swift in Sources */, + CE29C4F029E865D4008EDB5A /* SettingsViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEAE556229E6625100DE0DD9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CEAE556B29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CEAE556C29E6625100DE0DD9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CEAE557729E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift in Sources */, + CEAE557529E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + CEAE556829E6625100DE0DD9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */; + targetProxy = CEAE556729E6625100DE0DD9 /* PBXContainerItemProxy */; + }; + CEAE557229E6625100DE0DD9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */; + targetProxy = CEAE557129E6625100DE0DD9 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + CEAE555629E6623200DE0DD9 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEAE555729E6623200DE0DD9 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + CEAE555E29E6625000DE0DD9 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + CEAE555F29E6625000DE0DD9 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + CEAE557829E6625100DE0DD9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + CEAE557929E6625100DE0DD9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CEAE557B29E6625100DE0DD9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = JSUUF48N9C; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = FaceLivenessDetection/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = FaceLivenessDetection; + INFOPLIST_KEY_NSCameraUsageDescription = ""; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.facelivedemo11; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "FaceLivenessDetection-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CEAE557C29E6625100DE0DD9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = JSUUF48N9C; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = FaceLivenessDetection/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = FaceLivenessDetection; + INFOPLIST_KEY_NSCameraUsageDescription = ""; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.facelivedemo11; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "FaceLivenessDetection-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + CEAE557E29E6625100DE0DD9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = JSUUF48N9C; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FaceLivenessDetection.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/FaceLivenessDetection"; + }; + name = Debug; + }; + CEAE557F29E6625100DE0DD9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = JSUUF48N9C; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FaceLivenessDetection.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/FaceLivenessDetection"; + }; + name = Release; + }; + CEAE558129E6625100DE0DD9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = JSUUF48N9C; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = FaceLivenessDetection; + }; + name = Debug; + }; + CEAE558229E6625100DE0DD9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = JSUUF48N9C; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = FaceLivenessDetection; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CEAE554829E6623200DE0DD9 /* Build configuration list for PBXProject "FaceLivenessDetection" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEAE557829E6625100DE0DD9 /* Debug */, + CEAE557929E6625100DE0DD9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CEAE557A29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetection" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEAE557B29E6625100DE0DD9 /* Debug */, + CEAE557C29E6625100DE0DD9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CEAE557D29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEAE557E29E6625100DE0DD9 /* Debug */, + CEAE557F29E6625100DE0DD9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CEAE558029E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CEAE558129E6625100DE0DD9 /* Debug */, + CEAE558229E6625100DE0DD9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + CEAE555929E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + CEAE555A29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodel */, + ); + currentVersion = CEAE555A29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodel */; + path = FaceLivenessDetection.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = CEAE554529E6623200DE0DD9 /* Project object */; +} diff --git a/FaceLivenessDetection.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/FaceLivenessDetection.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/FaceLivenessDetection.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/FaceLivenessDetection.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/FaceLivenessDetection.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/FaceLivenessDetection.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/FaceLivenessDetection.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/FaceLivenessDetection.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..84f6fb3 Binary files /dev/null and b/FaceLivenessDetection.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..0dbc1cf --- /dev/null +++ b/FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..afc98c5 --- /dev/null +++ b/FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + FaceLivenessDetection.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/FaceLivenessDetection/.DS_Store b/FaceLivenessDetection/.DS_Store new file mode 100644 index 0000000..55189b7 Binary files /dev/null and b/FaceLivenessDetection/.DS_Store differ diff --git a/FaceLivenessDetection/AboutViewController.swift b/FaceLivenessDetection/AboutViewController.swift new file mode 100644 index 0000000..6978482 --- /dev/null +++ b/FaceLivenessDetection/AboutViewController.swift @@ -0,0 +1,70 @@ +import UIKit +import AVFoundation + +class AboutViewController: UIViewController{ + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + + @IBAction func done_clicked(_ sender: Any) { + if let vc = self.presentingViewController as? ViewController { + self.dismiss(animated: true, completion: nil) + } + } + + + @IBAction func mail_clicked(_ sender: Any) { + let appURL = URL(string: "mailto:contact@kby-ai.com") // URL scheme for Mail app + + if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) { + // If Mail app is installed, open it with a pre-filled email + UIApplication.shared.open(appURL, options: [:], completionHandler: nil) + } else { + // If Mail app is not installed, show an alert indicating that Mail app is not available + let alert = UIAlertController(title: "Mail App Not Available", message: "The Mail app is not installed on this device.", preferredStyle: .alert) + let okAction = UIAlertAction(title: "OK", style: .default, handler: nil) + alert.addAction(okAction) + UIApplication.shared.keyWindow?.rootViewController?.present(alert, animated: true, completion: nil) + } + } + + + @IBAction func skype_clicked(_ sender: Any) { + + } + + @IBAction func telegram_clicked(_ sender: Any) { + let appURL = URL(string: "tg://resolve?domain=kbyai") // URL scheme for Telegram app + + if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) { + // If Telegram app is installed, open it to the "Add Contact" screen + UIApplication.shared.open(appURL, options: [:], completionHandler: nil) + } else { + let username = "kbyai" + let telegramURL = URL(string: "https://t.me/\(username)")! + UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil) + } + } + + @IBAction func whatsapp_clicked(_ sender: Any) { + let appURL = URL(string: "whatsapp://send?phone=+19092802609") // URL scheme for Telegram app + + if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) { + // If Telegram app is installed, open it to the "Add Contact" screen + UIApplication.shared.open(appURL, options: [:], completionHandler: nil) + } else { + let username = "+19092802609" + let telegramURL = URL(string: "https://wa.me/\(username)")! + UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil) + } + } + + @IBAction func github_clicked(_ sender: Any) { + let telegramURL = URL(string: "https://github.com/kby-ai")! + UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil) + } +} + diff --git a/FaceLivenessDetection/AppDelegate.swift b/FaceLivenessDetection/AppDelegate.swift new file mode 100644 index 0000000..520707e --- /dev/null +++ b/FaceLivenessDetection/AppDelegate.swift @@ -0,0 +1,75 @@ + +import UIKit +import CoreData + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + // MARK: - Core Data stack + + lazy var persistentContainer: NSPersistentContainer = { + /* + The persistent container for the application. This implementation + creates and returns a container, having loaded the store for the + application to it. This property is optional since there are legitimate + error conditions that could cause the creation of the store to fail. + */ + let container = NSPersistentContainer(name: "FaceLivenessDetection") + container.loadPersistentStores(completionHandler: { (storeDescription, error) in + if let error = error as NSError? { + // Replace this implementation with code to handle the error appropriately. + // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + /* + Typical reasons for an error here include: + * The parent directory does not exist, cannot be created, or disallows writing. + * The persistent store is not accessible, due to permissions or data protection when the device is locked. + * The device is out of space. + * The store could not be migrated to the current model version. + Check the error message to determine what the actual problem was. + */ + fatalError("Unresolved error \(error), \(error.userInfo)") + } + }) + return container + }() + + // MARK: - Core Data Saving support + + func saveContext () { + let context = persistentContainer.viewContext + if context.hasChanges { + do { + try context.save() + } catch { + // Replace this implementation with code to handle the error appropriately. + // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + let nserror = error as NSError + fatalError("Unresolved error \(nserror), \(nserror.userInfo)") + } + } + } + +} + diff --git a/FaceLivenessDetection/Assets.xcassets/AccentColor.colorset/Contents.json b/FaceLivenessDetection/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/Contents.json b/FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..44ac9cc --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "appstore.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/appstore.png b/FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/appstore.png new file mode 100644 index 0000000..ce64898 Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/appstore.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/Contents.json b/FaceLivenessDetection/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/clr_main_button_bg1.colorset/Contents.json b/FaceLivenessDetection/Assets.xcassets/clr_main_button_bg1.colorset/Contents.json new file mode 100644 index 0000000..0c20dd0 --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/clr_main_button_bg1.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x8B", + "green" : "0x37", + "red" : "0x4F" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x8B", + "green" : "0x37", + "red" : "0x4F" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/clr_main_button_bg2.colorset/Contents.json b/FaceLivenessDetection/Assets.xcassets/clr_main_button_bg2.colorset/Contents.json new file mode 100644 index 0000000..1192b7a --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/clr_main_button_bg2.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "0.867", + "red" : "0.918" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "0.867", + "red" : "0.918" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/Contents.json b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/Contents.json new file mode 100644 index 0000000..a8700e4 --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_github.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_github 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_github 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 1.png b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 1.png new file mode 100644 index 0000000..8261401 Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 1.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 2.png b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 2.png new file mode 100644 index 0000000..8261401 Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 2.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github.png b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github.png new file mode 100644 index 0000000..8261401 Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/Contents.json b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/Contents.json new file mode 100644 index 0000000..34037b0 --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_kby.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_kby 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_kby 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 1.png b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 1.png new file mode 100644 index 0000000..b295d6c Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 1.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 2.png b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 2.png new file mode 100644 index 0000000..b295d6c Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 2.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby.png b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby.png new file mode 100644 index 0000000..b295d6c Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/Contents.json b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/Contents.json new file mode 100644 index 0000000..9816e4c --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_skype.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_skype 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_skype 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 1.png b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 1.png new file mode 100644 index 0000000..c92130a Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 1.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 2.png b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 2.png new file mode 100644 index 0000000..c92130a Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 2.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype.png b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype.png new file mode 100644 index 0000000..c92130a Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/Contents.json b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/Contents.json new file mode 100644 index 0000000..d3d3fda --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_telegram.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_telegram 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_telegram 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 1.png b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 1.png new file mode 100644 index 0000000..5f96d5e Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 1.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 2.png b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 2.png new file mode 100644 index 0000000..5f96d5e Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 2.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram.png b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram.png new file mode 100644 index 0000000..5f96d5e Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/Contents.json b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/Contents.json new file mode 100644 index 0000000..24ee2cc --- /dev/null +++ b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "ic_whatsapp.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ic_whatsapp 1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_whatsapp 2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 1.png b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 1.png new file mode 100644 index 0000000..2e46c94 Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 1.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 2.png b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 2.png new file mode 100644 index 0000000..2e46c94 Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 2.png differ diff --git a/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp.png b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp.png new file mode 100644 index 0000000..2e46c94 Binary files /dev/null and b/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp.png differ diff --git a/FaceLivenessDetection/Base.lproj/LaunchScreen.storyboard b/FaceLivenessDetection/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/FaceLivenessDetection/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FaceLivenessDetection/Base.lproj/Main.storyboard b/FaceLivenessDetection/Base.lproj/Main.storyboard new file mode 100644 index 0000000..2ebd9b7 --- /dev/null +++ b/FaceLivenessDetection/Base.lproj/Main.storyboard @@ -0,0 +1,997 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FaceLivenessDetection/CameraViewController.swift b/FaceLivenessDetection/CameraViewController.swift new file mode 100644 index 0000000..3979555 --- /dev/null +++ b/FaceLivenessDetection/CameraViewController.swift @@ -0,0 +1,86 @@ +import UIKit +import AVFoundation + +class CameraViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate{ + + static let LIVENESS_THRESHOLD = Float(0.7) + + @IBOutlet weak var cameraView: UIView! + @IBOutlet weak var faceView: FaceView! + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + + cameraView.translatesAutoresizingMaskIntoConstraints = true + cameraView.frame = view.bounds + + faceView.translatesAutoresizingMaskIntoConstraints = true + faceView.frame = view.bounds + + startCamera() + } + + func startCamera() { + let defaults = UserDefaults.standard + let cameraLens_val = defaults.integer(forKey: "camera_lens") + var cameraLens = AVCaptureDevice.Position.front + if(cameraLens_val == 0) { + cameraLens = AVCaptureDevice.Position.back + } + + // Create an AVCaptureSession + let session = AVCaptureSession() + session.sessionPreset = .high + + // Create an AVCaptureDevice for the camera + let device = AVCaptureDevice.default(for: .video) + + guard let videoDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: cameraLens) else { return } + guard let input = try? AVCaptureDeviceInput(device: videoDevice) else { return } + if session.canAddInput(input) { + session.addInput(input) + } + + // Create an AVCaptureVideoDataOutput + let videoOutput = AVCaptureVideoDataOutput() + + // Set the video output's delegate and queue for processing video frames + videoOutput.setSampleBufferDelegate(self, queue: DispatchQueue.global(qos: .default)) + + // Add the video output to the session + session.addOutput(videoOutput) + + let previewLayer = AVCaptureVideoPreviewLayer(session: session) + previewLayer.videoGravity = .resizeAspectFill + previewLayer.frame = view.bounds + cameraView.layer.addSublayer(previewLayer) + + // Start the session + session.startRunning() + } + + func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) { + + guard let pixelBuffer: CVPixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { return } + + CVPixelBufferLockBaseAddress(pixelBuffer, CVPixelBufferLockFlags.readOnly) + let image = CIImage(cvPixelBuffer: pixelBuffer).oriented(CGImagePropertyOrientation.leftMirrored) + let capturedImage = UIImage(ciImage: image) + CVPixelBufferUnlockBaseAddress(pixelBuffer, CVPixelBufferLockFlags.readOnly) + + let faceBoxes = FaceSDK.faceDetection(capturedImage) + DispatchQueue.main.sync { + self.faceView.setFrameSize(frameSize: capturedImage.size) + self.faceView.setFaceBoxes(faceBoxes: faceBoxes) + } + } + + + @IBAction func done_clicked(_ sender: Any) { + if let vc = self.presentingViewController as? ViewController { + self.dismiss(animated: true, completion: nil) + } + } +} + diff --git a/FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/.xccurrentversion b/FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/.xccurrentversion new file mode 100644 index 0000000..186fcd4 --- /dev/null +++ b/FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + FaceLivenessDetection.xcdatamodel + + diff --git a/FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/FaceLivenessDetection.xcdatamodel/contents b/FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/FaceLivenessDetection.xcdatamodel/contents new file mode 100644 index 0000000..50d2514 --- /dev/null +++ b/FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/FaceLivenessDetection.xcdatamodel/contents @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/FaceLivenessDetection/FaceView.swift b/FaceLivenessDetection/FaceView.swift new file mode 100644 index 0000000..74a15c6 --- /dev/null +++ b/FaceLivenessDetection/FaceView.swift @@ -0,0 +1,56 @@ +import UIKit + +class FaceView: UIView { + + var faceBoxes: NSMutableArray? = nil + var frameSize: CGSize? + + public func setFaceBoxes(faceBoxes: NSMutableArray) { + self.faceBoxes = faceBoxes + setNeedsDisplay() + } + + public func setFrameSize(frameSize: CGSize) { + self.frameSize = frameSize + } + + // Only override draw() if you perform custom drawing. + // An empty implementation adversely affects performance during animation. + override func draw(_ rect: CGRect) { + + guard let context = UIGraphicsGetCurrentContext() else { + return + } + + let defaults = UserDefaults.standard + let livenessThreshold = defaults.float(forKey: "liveness_threshold") + + if(self.frameSize != nil) { + context.beginPath() + + let x_scale = self.frameSize!.width / self.bounds.width + let y_scale = self.frameSize!.height / self.bounds.height + + for faceBox in (faceBoxes! as NSArray as! [FaceBox]) { + var color = UIColor.green + var string = "REAL " + String(format: "%.3f", faceBox.liveness) + if(faceBox.liveness < livenessThreshold) { + color = UIColor.red + string = "SPOOF " + String(format: "%.3f", faceBox.liveness) + } + + context.setStrokeColor(color.cgColor) + context.setLineWidth(2.0) + + let scaledRect = CGRect(x: Int(CGFloat(faceBox.x1) / x_scale), y: Int(CGFloat(faceBox.y1) / y_scale), width: Int(CGFloat(faceBox.x2 - faceBox.x1 + 1) / x_scale), height: Int(CGFloat(faceBox.y2 - faceBox.y1 + 1) / y_scale)) + context.addRect(scaledRect) + + let attributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 20), + NSAttributedString.Key.foregroundColor: color] + string.draw(at: CGPoint(x: CGFloat(scaledRect.minX + 5), y: CGFloat(scaledRect.minY - 25)), withAttributes: attributes) + + context.strokePath() + } + } + } +} diff --git a/FaceLivenessDetection/Info.plist b/FaceLivenessDetection/Info.plist new file mode 100644 index 0000000..dd3c9af --- /dev/null +++ b/FaceLivenessDetection/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/FaceLivenessDetection/SceneDelegate.swift b/FaceLivenessDetection/SceneDelegate.swift new file mode 100644 index 0000000..f4cd2f2 --- /dev/null +++ b/FaceLivenessDetection/SceneDelegate.swift @@ -0,0 +1,48 @@ +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + + // Save changes in the application's managed object context when the application transitions to the background. + (UIApplication.shared.delegate as? AppDelegate)?.saveContext() + } + + +} + diff --git a/FaceLivenessDetection/SettingsViewController.swift b/FaceLivenessDetection/SettingsViewController.swift new file mode 100644 index 0000000..61f8a26 --- /dev/null +++ b/FaceLivenessDetection/SettingsViewController.swift @@ -0,0 +1,115 @@ +import UIKit +import AVFoundation + +class SettingsViewController: UIViewController{ + + static let CAMERA_LENS_DEFAULT = 1 + static let LIVENESS_THRESHOLD_DEFAULT = Float(0.7) + + + @IBOutlet weak var cameraLensSwitch: UISwitch! + @IBOutlet weak var livenessThresholdLbl: UILabel! + @IBOutlet weak var cameraLensLbl: UILabel! + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + + let defaults = UserDefaults.standard + let cameraLens = defaults.integer(forKey: "camera_lens") + + if(cameraLens == 0) { + cameraLensSwitch.isOn = false + cameraLensLbl.text = "Back" + } else { + cameraLensSwitch.isOn = true + cameraLensLbl.text = "Front" + } + + let livenessThreshold = defaults.float(forKey: "liveness_threshold") + livenessThresholdLbl.text = String(livenessThreshold) + } + + static func setDefaultSettings() { + let defaults = UserDefaults.standard + let defaultChanged = defaults.bool(forKey: "default_changed") + if(defaultChanged == false) { + defaults.set(true, forKey: "default_changed") + + defaults.set(SettingsViewController.CAMERA_LENS_DEFAULT, forKey: "camera_lens") + defaults.set(SettingsViewController.LIVENESS_THRESHOLD_DEFAULT, forKey: "liveness_threshold") + } + } + + @IBAction func done_clicked(_ sender: Any) { + if let vc = self.presentingViewController as? ViewController { + self.dismiss(animated: true, completion: nil) + } + } + + @IBAction func cameraLens_switch(_ sender: Any) { + let defaults = UserDefaults.standard + if(cameraLensSwitch.isOn) { + defaults.set(1, forKey: "camera_lens") + cameraLensLbl.text = "Front" + } else { + defaults.set(0, forKey: "camera_lens") + cameraLensLbl.text = "Back" + } + } + + + @IBAction func livenessThreshold_clicked(_ sender: Any) { + + let title = "Liveness threshold" + let alertController = UIAlertController(title: title, message: "Please input a number between 0 and 1.", preferredStyle: .alert) + + var minimum = Float(0) + var maximum = Float(1) + alertController.addTextField { (textField) in + textField.keyboardType = .decimalPad + + let defaults = UserDefaults.standard + textField.text = String(defaults.float(forKey: "liveness_threshold")) + } + + let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) + + let submitAction = UIAlertAction(title: "Ok", style: .default) { (action) in + + var hasError = false + var errorStr = "" + let defaults = UserDefaults.standard + + if let numberString = alertController.textFields?.first?.text, let number = Float(numberString) { + if(number < Float(minimum) || number > Float(maximum)) { + hasError = true + errorStr = "Invalid value" + } else { + self.livenessThresholdLbl.text = String(number) + defaults.set(number, forKey: "liveness_threshold") + } + } else { + hasError = true + errorStr = "Invalid value" + } + + if(hasError) { + let errorNotification = UIAlertController(title: "Error", message: errorStr, preferredStyle: .alert) + let okAction = UIAlertAction(title: "OK", style: .default, handler: nil) + errorNotification.addAction(okAction) + self.present(errorNotification, animated: true, completion: nil) + + DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { + errorNotification.dismiss(animated: true, completion: nil) + } + } + } + + alertController.addAction(cancelAction) + alertController.addAction(submitAction) + + present(alertController, animated: true, completion: nil) + } +} + diff --git a/FaceLivenessDetection/UIImageFixedOrientationExtension.swift b/FaceLivenessDetection/UIImageFixedOrientationExtension.swift new file mode 100644 index 0000000..dcd6c88 --- /dev/null +++ b/FaceLivenessDetection/UIImageFixedOrientationExtension.swift @@ -0,0 +1,69 @@ +import Foundation +import UIKit + + +public extension UIImage { + + /// Extension to fix orientation of an UIImage without EXIF + func fixOrientation() -> UIImage { + + guard let cgImage = cgImage else { return self } + + if imageOrientation == .up { return self } + + var transform = CGAffineTransform.identity + + switch imageOrientation { + + case .down, .downMirrored: + transform = transform.translatedBy(x: size.width, y: size.height) + transform = transform.rotated(by: CGFloat(Double.pi)) + + case .left, .leftMirrored: + transform = transform.translatedBy(x: size.width, y: 0) + transform = transform.rotated(by: CGFloat(Double.pi/2)) + + case .right, .rightMirrored: + transform = transform.translatedBy(x: 0, y : size.height) + transform = transform.rotated(by: CGFloat(-Double.pi/2)) + + case .up, .upMirrored: + break + } + + switch imageOrientation { + + case .upMirrored, .downMirrored: + transform.translatedBy(x: size.width, y: 0) + transform.scaledBy(x: -1, y: 1) + + case .leftMirrored, .rightMirrored: + transform.translatedBy(x: size.height, y: 0) + transform.scaledBy(x: -1, y: 1) + + case .up, .down, .left, .right: + break + } + + if let ctx = CGContext(data: nil, width: Int(size.width), height: Int(size.height), bitsPerComponent: cgImage.bitsPerComponent, bytesPerRow: 0, space: cgImage.colorSpace!, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue) { + + ctx.concatenate(transform) + + switch imageOrientation { + + case .left, .leftMirrored, .right, .rightMirrored: + ctx.draw(cgImage, in: CGRect(x: 0, y: 0, width: size.height, height: size.width)) + + default: + ctx.draw(cgImage, in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) + } + + if let finalImage = ctx.makeImage() { + return (UIImage(cgImage: finalImage)) + } + } + + // something failed -- return original + return self + } +} diff --git a/FaceLivenessDetection/ViewController.swift b/FaceLivenessDetection/ViewController.swift new file mode 100644 index 0000000..79e7eb8 --- /dev/null +++ b/FaceLivenessDetection/ViewController.swift @@ -0,0 +1,177 @@ +import UIKit +import AVFoundation + +class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate{ + + @IBOutlet weak var warningLbl: UILabel! + @IBOutlet weak var resultLbl: UILabel! + @IBOutlet weak var imageView: UIImageView! + + @IBOutlet weak var cameraBtnView: UIView! + @IBOutlet weak var imageBtnView: UIView! + @IBOutlet weak var settingsBtnView: UIView! + @IBOutlet weak var aboutBtnView: UIView! + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + + var ret = FaceSDK.setActivation("glF/068/SCjGIKN/o1HwZKKEANRWrO0eCTY7VinO46mMiXWcccNfCGLzAe2aNU2JBbjcn+IY000Q" + + "zwYQUjEqx8X4Dkx41KMcZhJQSSdPg9KBEpxbOaksjsPCktAy78wlUJ9L+zmX6oa0h/3H45gMCHka" + + "qPjjEWqrtGotonspHOxo5Z8TqofHSWJ04ORGllILdB4UQELaeToomCJMSNMJRKt425sIEdidO/+2" + + "cQTdw04ShTpyMRgFI4B/sY5XMlz8Jyh1L9X3Yf5vEzj/Dk6d/7mtp1r3vRzIaBiFvk8M0Y0CyIwK" + + "pdXxtkmC/OAO7DqzT3XQL69oX51XBMIwQXFriA==") + + if(ret == SDK_SUCCESS.rawValue) { + ret = FaceSDK.initSDK() + } + + if(ret != SDK_SUCCESS.rawValue) { + warningLbl.isHidden = false + + if(ret == SDK_LICENSE_KEY_ERROR.rawValue) { + warningLbl.text = "Invalid license!" + } else if(ret == SDK_LICENSE_APPID_ERROR.rawValue) { + warningLbl.text = "Invalid license!" + } else if(ret == SDK_LICENSE_EXPIRED.rawValue) { + warningLbl.text = "License expired!" + } else if(ret == SDK_NO_ACTIVATED.rawValue) { + warningLbl.text = "No activated!" + } else if(ret == SDK_INIT_ERROR.rawValue) { + warningLbl.text = "Init error!" + } + } + + SettingsViewController.setDefaultSettings() + } + + @IBAction func camera_touch_down(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.cameraBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color + } + } + + @IBAction func camera_touch_cancel(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.cameraBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + } + + @IBAction func camera_clicked(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.cameraBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + + performSegue(withIdentifier: "camera", sender: self) + } + + + @IBAction func image_touch_down(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.imageBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color + } + } + + @IBAction func image_touch_up(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.imageBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + } + + @IBAction func image_clicked(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.imageBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + + let imagePicker = UIImagePickerController() + imagePicker.sourceType = .photoLibrary + imagePicker.delegate = self + present(imagePicker, animated: true, completion: nil) + } + + + @IBAction func settings_touch_down(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.settingsBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color + } + } + + + @IBAction func settings_touch_up(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.settingsBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + } + + @IBAction func settings_clicked(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.settingsBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + + performSegue(withIdentifier: "settings", sender: self) + } + + @IBAction func about_touch_down(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.aboutBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color + } + } + + + @IBAction func about_touch_up(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.aboutBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + } + + @IBAction func about_clicked(_ sender: Any) { + UIView.animate(withDuration: 0.5) { + self.aboutBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color + } + + performSegue(withIdentifier: "about", sender: self) + } + + @IBAction func brand_clicked(_ sender: Any) { + let webURL = URL(string: "https://kby-ai.com") + UIApplication.shared.open(webURL!, options: [:], completionHandler: nil) + } + + + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { + + dismiss(animated: true, completion: nil) + + guard let image = info[.originalImage] as? UIImage else { + return + } + + let fixed_image = image.fixOrientation() + imageView.image = fixed_image + + let faceBoxes = FaceSDK.faceDetection(fixed_image) + if(faceBoxes.count == 0) { + resultLbl.text = "No face" + resultLbl.textColor = UIColor.red + return + } + + + let defaults = UserDefaults.standard + let livenessThreshold = defaults.float(forKey: "liveness_threshold") + + let faceBox = faceBoxes[0] as! FaceBox + if(faceBox.liveness < livenessThreshold) { + resultLbl.text = "SPOOF, Score: " + String(format: "%.3f", faceBox.liveness) + resultLbl.textColor = UIColor.red + } else { + resultLbl.text = "REAL, Score: " + String(format: "%.3f", faceBox.liveness) + resultLbl.textColor = UIColor.green + } + } + + func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { + dismiss(animated: true, completion: nil) + } +} + diff --git a/FaceLivenessDetectionTests/FaceLivenessDetectionTests.swift b/FaceLivenessDetectionTests/FaceLivenessDetectionTests.swift new file mode 100644 index 0000000..d04f385 --- /dev/null +++ b/FaceLivenessDetectionTests/FaceLivenessDetectionTests.swift @@ -0,0 +1,30 @@ + +import XCTest +@testable import FaceLivenessDetection + +final class FaceLivenessDetectionTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/FaceLivenessDetectionUITests/FaceLivenessDetectionUITests.swift b/FaceLivenessDetectionUITests/FaceLivenessDetectionUITests.swift new file mode 100644 index 0000000..be851ec --- /dev/null +++ b/FaceLivenessDetectionUITests/FaceLivenessDetectionUITests.swift @@ -0,0 +1,35 @@ + +import XCTest + +final class FaceLivenessDetectionUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/FaceLivenessDetectionUITests/FaceLivenessDetectionUITestsLaunchTests.swift b/FaceLivenessDetectionUITests/FaceLivenessDetectionUITestsLaunchTests.swift new file mode 100644 index 0000000..6f179bb --- /dev/null +++ b/FaceLivenessDetectionUITests/FaceLivenessDetectionUITestsLaunchTests.swift @@ -0,0 +1,26 @@ + +import XCTest + +final class FaceLivenessDetectionUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +} diff --git a/facesdk.framework/.DS_Store b/facesdk.framework/.DS_Store new file mode 100644 index 0000000..007f7b9 Binary files /dev/null and b/facesdk.framework/.DS_Store differ diff --git a/facesdk.framework/Headers/facesdk.h b/facesdk.framework/Headers/facesdk.h new file mode 100644 index 0000000..e4c2bd5 --- /dev/null +++ b/facesdk.framework/Headers/facesdk.h @@ -0,0 +1,19 @@ +// +// facesdk.h +// facesdk +// +// Created by user on 4/12/23. +// + +#import + +//! Project version number for facesdk. +FOUNDATION_EXPORT double facesdkVersionNumber; + +//! Project version string for facesdk. +FOUNDATION_EXPORT const unsigned char facesdkVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + +#include "facesdk_api.h" diff --git a/facesdk.framework/Headers/facesdk_api.h b/facesdk.framework/Headers/facesdk_api.h new file mode 100644 index 0000000..9d66d8c --- /dev/null +++ b/facesdk.framework/Headers/facesdk_api.h @@ -0,0 +1,36 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +enum SDK_ERROR +{ + SDK_SUCCESS = 0, + SDK_LICENSE_KEY_ERROR = -1, + SDK_LICENSE_APPID_ERROR = -2, + SDK_LICENSE_EXPIRED = -3, + SDK_NO_ACTIVATED = -4, + SDK_INIT_ERROR = -5, +}; + +@interface FaceBox : NSObject + +@property (nonatomic) int x1; +@property (nonatomic) int y1; +@property (nonatomic) int x2; +@property (nonatomic) int y2; +@property (nonatomic) float liveness; +@property (nonatomic) float yaw; +@property (nonatomic) float roll; +@property (nonatomic) float pitch; +@end + +@interface FaceSDK : NSObject + ++(int) setActivation: (NSString*) license; ++(int) initSDK; ++(NSMutableArray*) faceDetection: (UIImage*) image; + +@end + +NS_ASSUME_NONNULL_END diff --git a/facesdk.framework/Info.plist b/facesdk.framework/Info.plist new file mode 100644 index 0000000..10898d4 Binary files /dev/null and b/facesdk.framework/Info.plist differ diff --git a/facesdk.framework/Modules/module.modulemap b/facesdk.framework/Modules/module.modulemap new file mode 100644 index 0000000..28bee10 --- /dev/null +++ b/facesdk.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module facesdk { + umbrella header "facesdk.h" + + export * + module * { export * } +} diff --git a/facesdk.framework/_CodeSignature/CodeResources b/facesdk.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..aaf3be6 --- /dev/null +++ b/facesdk.framework/_CodeSignature/CodeResources @@ -0,0 +1,190 @@ + + + + + files + + Headers/facesdk.h + + iXedJdnTNjJdkav0lex0htXPBa8= + + Headers/facesdk_api.h + + zk4iCdz2Sm53ZpOzWgV8TlFWgkw= + + Info.plist + + +SvIfsGnFHBVJaHBQiElfACQ340= + + Modules/module.modulemap + + X8zglrv2quSgEMFeVf0TybJa6gA= + + detection.bin + + G52JYi47ACwak8HkEcpkm9zo1as= + + detection.param + + tHFm7ohczZG7KEtACVgRSjX3XIA= + + landmark.bin + + YwuxUSePlqnFEDLD95H35rgexRI= + + landmark.param + + HHZGt8b9GPLjgGplhK/7hcOW0Mo= + + liveness.bin + + qh1obYoGNe0LoyD5JBmUkdeYrEY= + + + files2 + + Headers/facesdk.h + + hash2 + + CEHWZwXGt6HTp0cWeGAWrhBufzotOw42QLbWl2FjbpE= + + + Headers/facesdk_api.h + + hash2 + + yTXovrcbcLOnBMkl4rCZTDWVsJAQx2j5Q2mIw9vYQFw= + + + Modules/module.modulemap + + hash2 + + MPLn3hXOxK25/iaEZAyvAIf2qaUvsHUOWkHsaZrg7LY= + + + detection.bin + + hash2 + + aSBPVzW2w5vueXMHRoelxdPFfzE45CIHzJJfvcmNVVc= + + + detection.param + + hash2 + + yb/QW3dSgGun1LdCqss+oipjB11F0sE0NtewKSJibFo= + + + landmark.bin + + hash2 + + q59zkpnecoyeYz1houDmoVK0+ROe2x8l/0dtpqDC9Ic= + + + landmark.param + + hash2 + + nkGOHyOPviHWfG8E67n+geJfRcw+yc7qGU4famEpZNc= + + + liveness.bin + + hash2 + + 3XjsZ9HffijptH6kD8YcgXR9DwsM2tDsYTNDvdErRkE= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/facesdk.framework/detection.bin b/facesdk.framework/detection.bin new file mode 100644 index 0000000..e1af3b5 Binary files /dev/null and b/facesdk.framework/detection.bin differ diff --git a/facesdk.framework/detection.param b/facesdk.framework/detection.param new file mode 100644 index 0000000..4bbbabb --- /dev/null +++ b/facesdk.framework/detection.param @@ -0,0 +1,236 @@ +7767517 +234 255 +Input data 0 1 data 0=60 1=60 2=3 +Split splitncnn_0 1 4 data data_splitncnn_0 data_splitncnn_1 data_splitncnn_2 data_splitncnn_3 +Convolution conv1 1 1 data_splitncnn_3 conv_blob1 0=8 1=3 2=1 3=2 4=1 5=0 6=216 +BatchNorm batch_norm1 1 1 conv_blob1 batch_norm_blob1 0=8 +Scale bn_scale1 1 1 batch_norm_blob1 batch_norm_blob1_bn_scale1 0=8 1=1 +ReLU relu1 1 1 batch_norm_blob1_bn_scale1 relu_blob1 +ConvolutionDepthWise conv2 1 1 relu_blob1 conv_blob2 0=8 1=3 2=1 3=1 4=1 5=0 6=72 7=8 +BatchNorm batch_norm2 1 1 conv_blob2 batch_norm_blob2 0=8 +Scale bn_scale2 1 1 batch_norm_blob2 batch_norm_blob2_bn_scale2 0=8 1=1 +ReLU relu2 1 1 batch_norm_blob2_bn_scale2 relu_blob2 +Convolution conv3 1 1 relu_blob2 conv_blob3 0=16 1=1 2=1 3=1 4=0 5=0 6=128 +BatchNorm batch_norm3 1 1 conv_blob3 batch_norm_blob3 0=16 +Scale bn_scale3 1 1 batch_norm_blob3 batch_norm_blob3_bn_scale3 0=16 1=1 +ReLU relu3 1 1 batch_norm_blob3_bn_scale3 relu_blob3 +ConvolutionDepthWise conv4 1 1 relu_blob3 conv_blob4 0=16 1=3 2=1 3=2 4=1 5=0 6=144 7=16 +BatchNorm batch_norm4 1 1 conv_blob4 batch_norm_blob4 0=16 +Scale bn_scale4 1 1 batch_norm_blob4 batch_norm_blob4_bn_scale4 0=16 1=1 +ReLU relu4 1 1 batch_norm_blob4_bn_scale4 relu_blob4 +Convolution conv5 1 1 relu_blob4 conv_blob5 0=32 1=1 2=1 3=1 4=0 5=0 6=512 +BatchNorm batch_norm5 1 1 conv_blob5 batch_norm_blob5 0=32 +Scale bn_scale5 1 1 batch_norm_blob5 batch_norm_blob5_bn_scale5 0=32 1=1 +ReLU relu5 1 1 batch_norm_blob5_bn_scale5 relu_blob5 +ConvolutionDepthWise conv6 1 1 relu_blob5 conv_blob6 0=32 1=3 2=1 3=1 4=1 5=0 6=288 7=32 +BatchNorm batch_norm6 1 1 conv_blob6 batch_norm_blob6 0=32 +Scale bn_scale6 1 1 batch_norm_blob6 batch_norm_blob6_bn_scale6 0=32 1=1 +ReLU relu6 1 1 batch_norm_blob6_bn_scale6 relu_blob6 +Convolution conv7 1 1 relu_blob6 conv_blob7 0=32 1=1 2=1 3=1 4=0 5=0 6=1024 +BatchNorm batch_norm7 1 1 conv_blob7 batch_norm_blob7 0=32 +Scale bn_scale7 1 1 batch_norm_blob7 batch_norm_blob7_bn_scale7 0=32 1=1 +ReLU relu7 1 1 batch_norm_blob7_bn_scale7 relu_blob7 +ConvolutionDepthWise conv8 1 1 relu_blob7 conv_blob8 0=32 1=3 2=1 3=2 4=1 5=0 6=288 7=32 +BatchNorm batch_norm8 1 1 conv_blob8 batch_norm_blob8 0=32 +Scale bn_scale8 1 1 batch_norm_blob8 batch_norm_blob8_bn_scale8 0=32 1=1 +ReLU relu8 1 1 batch_norm_blob8_bn_scale8 relu_blob8 +Convolution conv9 1 1 relu_blob8 conv_blob9 0=64 1=1 2=1 3=1 4=0 5=0 6=2048 +BatchNorm batch_norm9 1 1 conv_blob9 batch_norm_blob9 0=64 +Scale bn_scale9 1 1 batch_norm_blob9 batch_norm_blob9_bn_scale9 0=64 1=1 +ReLU relu9 1 1 batch_norm_blob9_bn_scale9 relu_blob9 +ConvolutionDepthWise conv10 1 1 relu_blob9 conv_blob10 0=64 1=3 2=1 3=1 4=1 5=0 6=576 7=64 +BatchNorm batch_norm10 1 1 conv_blob10 batch_norm_blob10 0=64 +Scale bn_scale10 1 1 batch_norm_blob10 batch_norm_blob10_bn_scale10 0=64 1=1 +ReLU relu10 1 1 batch_norm_blob10_bn_scale10 relu_blob10 +Convolution conv11 1 1 relu_blob10 conv_blob11 0=64 1=1 2=1 3=1 4=0 5=0 6=4096 +BatchNorm batch_norm11 1 1 conv_blob11 batch_norm_blob11 0=64 +Scale bn_scale11 1 1 batch_norm_blob11 batch_norm_blob11_bn_scale11 0=64 1=1 +ReLU relu11 1 1 batch_norm_blob11_bn_scale11 relu_blob11 +Split splitncnn_1 1 2 relu_blob11 relu_blob11_splitncnn_0 relu_blob11_splitncnn_1 +ConvolutionDepthWise conv12 1 1 relu_blob11_splitncnn_1 conv_blob12 0=64 1=3 2=1 3=2 4=1 5=0 6=576 7=64 +BatchNorm batch_norm12 1 1 conv_blob12 batch_norm_blob12 0=64 +Scale bn_scale12 1 1 batch_norm_blob12 batch_norm_blob12_bn_scale12 0=64 1=1 +ReLU relu12 1 1 batch_norm_blob12_bn_scale12 relu_blob12 +Convolution conv13 1 1 relu_blob12 conv_blob13 0=128 1=1 2=1 3=1 4=0 5=0 6=8192 +BatchNorm batch_norm13 1 1 conv_blob13 batch_norm_blob13 0=128 +Scale bn_scale13 1 1 batch_norm_blob13 batch_norm_blob13_bn_scale13 0=128 1=1 +ReLU relu13 1 1 batch_norm_blob13_bn_scale13 relu_blob13 +ConvolutionDepthWise conv14 1 1 relu_blob13 conv_blob14 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 +BatchNorm batch_norm14 1 1 conv_blob14 batch_norm_blob14 0=128 +Scale bn_scale14 1 1 batch_norm_blob14 batch_norm_blob14_bn_scale14 0=128 1=1 +ReLU relu14 1 1 batch_norm_blob14_bn_scale14 relu_blob14 +Convolution conv15 1 1 relu_blob14 conv_blob15 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 +BatchNorm batch_norm15 1 1 conv_blob15 batch_norm_blob15 0=128 +Scale bn_scale15 1 1 batch_norm_blob15 batch_norm_blob15_bn_scale15 0=128 1=1 +ReLU relu15 1 1 batch_norm_blob15_bn_scale15 relu_blob15 +ConvolutionDepthWise conv16 1 1 relu_blob15 conv_blob16 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 +BatchNorm batch_norm16 1 1 conv_blob16 batch_norm_blob16 0=128 +Scale bn_scale16 1 1 batch_norm_blob16 batch_norm_blob16_bn_scale16 0=128 1=1 +ReLU relu16 1 1 batch_norm_blob16_bn_scale16 relu_blob16 +Convolution conv17 1 1 relu_blob16 conv_blob17 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 +BatchNorm batch_norm17 1 1 conv_blob17 batch_norm_blob17 0=128 +Scale bn_scale17 1 1 batch_norm_blob17 batch_norm_blob17_bn_scale17 0=128 1=1 +ReLU relu17 1 1 batch_norm_blob17_bn_scale17 relu_blob17 +ConvolutionDepthWise conv18 1 1 relu_blob17 conv_blob18 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 +BatchNorm batch_norm18 1 1 conv_blob18 batch_norm_blob18 0=128 +Scale bn_scale18 1 1 batch_norm_blob18 batch_norm_blob18_bn_scale18 0=128 1=1 +ReLU relu18 1 1 batch_norm_blob18_bn_scale18 relu_blob18 +Convolution conv19 1 1 relu_blob18 conv_blob19 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 +BatchNorm batch_norm19 1 1 conv_blob19 batch_norm_blob19 0=128 +Scale bn_scale19 1 1 batch_norm_blob19 batch_norm_blob19_bn_scale19 0=128 1=1 +ReLU relu19 1 1 batch_norm_blob19_bn_scale19 relu_blob19 +ConvolutionDepthWise conv20 1 1 relu_blob19 conv_blob20 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 +BatchNorm batch_norm20 1 1 conv_blob20 batch_norm_blob20 0=128 +Scale bn_scale20 1 1 batch_norm_blob20 batch_norm_blob20_bn_scale20 0=128 1=1 +ReLU relu20 1 1 batch_norm_blob20_bn_scale20 relu_blob20 +Convolution conv21 1 1 relu_blob20 conv_blob21 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 +BatchNorm batch_norm21 1 1 conv_blob21 batch_norm_blob21 0=128 +Scale bn_scale21 1 1 batch_norm_blob21 batch_norm_blob21_bn_scale21 0=128 1=1 +ReLU relu21 1 1 batch_norm_blob21_bn_scale21 relu_blob21 +ConvolutionDepthWise conv22 1 1 relu_blob21 conv_blob22 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 +BatchNorm batch_norm22 1 1 conv_blob22 batch_norm_blob22 0=128 +Scale bn_scale22 1 1 batch_norm_blob22 batch_norm_blob22_bn_scale22 0=128 1=1 +ReLU relu22 1 1 batch_norm_blob22_bn_scale22 relu_blob22 +Convolution conv23 1 1 relu_blob22 conv_blob23 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 +BatchNorm batch_norm23 1 1 conv_blob23 batch_norm_blob23 0=128 +Scale bn_scale23 1 1 batch_norm_blob23 batch_norm_blob23_bn_scale23 0=128 1=1 +ReLU relu23 1 1 batch_norm_blob23_bn_scale23 relu_blob23 +Split splitncnn_2 1 2 relu_blob23 relu_blob23_splitncnn_0 relu_blob23_splitncnn_1 +ConvolutionDepthWise conv24 1 1 relu_blob23_splitncnn_1 conv_blob24 0=128 1=3 2=1 3=2 4=1 5=0 6=1152 7=128 +BatchNorm batch_norm24 1 1 conv_blob24 batch_norm_blob24 0=128 +Scale bn_scale24 1 1 batch_norm_blob24 batch_norm_blob24_bn_scale24 0=128 1=1 +ReLU relu24 1 1 batch_norm_blob24_bn_scale24 relu_blob24 +Convolution conv25 1 1 relu_blob24 conv_blob25 0=256 1=1 2=1 3=1 4=0 5=0 6=32768 +BatchNorm batch_norm25 1 1 conv_blob25 batch_norm_blob25 0=256 +Scale bn_scale25 1 1 batch_norm_blob25 batch_norm_blob25_bn_scale25 0=256 1=1 +ReLU relu25 1 1 batch_norm_blob25_bn_scale25 relu_blob25 +ConvolutionDepthWise conv26 1 1 relu_blob25 conv_blob26 0=256 1=3 2=1 3=1 4=1 5=0 6=2304 7=256 +BatchNorm batch_norm26 1 1 conv_blob26 batch_norm_blob26 0=256 +Scale bn_scale26 1 1 batch_norm_blob26 batch_norm_blob26_bn_scale26 0=256 1=1 +ReLU relu26 1 1 batch_norm_blob26_bn_scale26 relu_blob26 +Convolution conv27 1 1 relu_blob26 conv_blob27 0=256 1=1 2=1 3=1 4=0 5=0 6=65536 +BatchNorm batch_norm27 1 1 conv_blob27 batch_norm_blob27 0=256 +Scale bn_scale27 1 1 batch_norm_blob27 batch_norm_blob27_bn_scale27 0=256 1=1 +ReLU relu27 1 1 batch_norm_blob27_bn_scale27 relu_blob27 +Convolution conv28 1 1 relu_blob11_splitncnn_0 conv_blob28 0=64 1=1 2=1 3=1 4=0 5=0 6=4096 +BatchNorm batch_norm28 1 1 conv_blob28 batch_norm_blob28 0=64 +Scale bn_scale28 1 1 batch_norm_blob28 batch_norm_blob28_bn_scale28 0=64 1=1 +ReLU relu28 1 1 batch_norm_blob28_bn_scale28 relu_blob28 +Split splitncnn_3 1 2 relu_blob28 relu_blob28_splitncnn_0 relu_blob28_splitncnn_1 +Convolution conv29 1 1 relu_blob23_splitncnn_0 conv_blob29 0=64 1=1 2=1 3=1 4=0 5=0 6=8192 +BatchNorm batch_norm29 1 1 conv_blob29 batch_norm_blob29 0=64 +Scale bn_scale29 1 1 batch_norm_blob29 batch_norm_blob29_bn_scale29 0=64 1=1 +ReLU relu29 1 1 batch_norm_blob29_bn_scale29 relu_blob29 +Split splitncnn_4 1 2 relu_blob29 relu_blob29_splitncnn_0 relu_blob29_splitncnn_1 +Convolution conv30 1 1 relu_blob27 conv_blob30 0=64 1=1 2=1 3=1 4=0 5=0 6=16384 +BatchNorm batch_norm30 1 1 conv_blob30 batch_norm_blob30 0=64 +Scale bn_scale30 1 1 batch_norm_blob30 batch_norm_blob30_bn_scale30 0=64 1=1 +ReLU relu30 1 1 batch_norm_blob30_bn_scale30 relu_blob30 +Split splitncnn_5 1 3 relu_blob30 relu_blob30_splitncnn_0 relu_blob30_splitncnn_1 relu_blob30_splitncnn_2 +Deconvolution conv_transpose1 1 1 relu_blob30_splitncnn_2 conv_transpose_blob1 0=64 1=2 2=1 3=2 4=0 5=1 6=16384 +Crop crop1 2 1 conv_transpose_blob1 relu_blob29_splitncnn_1 crop1 +Eltwise add1 2 1 relu_blob29_splitncnn_0 crop1 add_blob1 0=1 -23301=0 +Convolution conv31 1 1 add_blob1 conv_blob31 0=64 1=3 2=1 3=1 4=1 5=0 6=36864 +BatchNorm batch_norm31 1 1 conv_blob31 batch_norm_blob31 0=64 +Scale bn_scale31 1 1 batch_norm_blob31 batch_norm_blob31_bn_scale31 0=64 1=1 +ReLU relu31 1 1 batch_norm_blob31_bn_scale31 relu_blob31 +Split splitncnn_6 1 3 relu_blob31 relu_blob31_splitncnn_0 relu_blob31_splitncnn_1 relu_blob31_splitncnn_2 +Deconvolution conv_transpose2 1 1 relu_blob31_splitncnn_2 conv_transpose_blob2 0=64 1=2 2=1 3=2 4=0 5=1 6=16384 +Crop crop2 2 1 conv_transpose_blob2 relu_blob28_splitncnn_1 crop2 +Eltwise add2 2 1 relu_blob28_splitncnn_0 crop2 add_blob2 0=1 -23301=0 +Convolution conv32 1 1 add_blob2 conv_blob32 0=64 1=3 2=1 3=1 4=1 5=0 6=36864 +BatchNorm batch_norm32 1 1 conv_blob32 batch_norm_blob32 0=64 +Scale bn_scale32 1 1 batch_norm_blob32 batch_norm_blob32_bn_scale32 0=64 1=1 +ReLU relu32 1 1 batch_norm_blob32_bn_scale32 relu_blob32 +Split splitncnn_7 1 2 relu_blob32 relu_blob32_splitncnn_0 relu_blob32_splitncnn_1 +Convolution conv33 1 1 relu_blob32_splitncnn_1 conv_blob33 0=32 1=3 2=1 3=1 4=1 5=0 6=18432 +BatchNorm batch_norm33 1 1 conv_blob33 batch_norm_blob33 0=32 +Scale bn_scale33 1 1 batch_norm_blob33 batch_norm_blob33_bn_scale33 0=32 1=1 +Convolution conv34 1 1 relu_blob32_splitncnn_0 conv_blob34 0=16 1=3 2=1 3=1 4=1 5=0 6=9216 +BatchNorm batch_norm34 1 1 conv_blob34 batch_norm_blob34 0=16 +Scale bn_scale34 1 1 batch_norm_blob34 batch_norm_blob34_bn_scale34 0=16 1=1 +ReLU relu33 1 1 batch_norm_blob34_bn_scale34 relu_blob33 +Split splitncnn_8 1 2 relu_blob33 relu_blob33_splitncnn_0 relu_blob33_splitncnn_1 +Convolution conv35 1 1 relu_blob33_splitncnn_1 conv_blob35 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm35 1 1 conv_blob35 batch_norm_blob35 0=16 +Scale bn_scale35 1 1 batch_norm_blob35 batch_norm_blob35_bn_scale35 0=16 1=1 +Convolution conv36 1 1 relu_blob33_splitncnn_0 conv_blob36 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm36 1 1 conv_blob36 batch_norm_blob36 0=16 +Scale bn_scale36 1 1 batch_norm_blob36 batch_norm_blob36_bn_scale36 0=16 1=1 +ReLU relu34 1 1 batch_norm_blob36_bn_scale36 relu_blob34 +Convolution conv37 1 1 relu_blob34 conv_blob37 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm37 1 1 conv_blob37 batch_norm_blob37 0=16 +Scale bn_scale37 1 1 batch_norm_blob37 batch_norm_blob37_bn_scale37 0=16 1=1 +Concat cat1 3 1 batch_norm_blob33_bn_scale33 batch_norm_blob35_bn_scale35 batch_norm_blob37_bn_scale37 cat_blob1 0=0 +ReLU relu35 1 1 cat_blob1 relu_blob35 +Split splitncnn_9 1 3 relu_blob35 relu_blob35_splitncnn_0 relu_blob35_splitncnn_1 relu_blob35_splitncnn_2 +Convolution conv38 1 1 relu_blob31_splitncnn_1 conv_blob38 0=32 1=3 2=1 3=1 4=1 5=0 6=18432 +BatchNorm batch_norm38 1 1 conv_blob38 batch_norm_blob38 0=32 +Scale bn_scale38 1 1 batch_norm_blob38 batch_norm_blob38_bn_scale38 0=32 1=1 +Convolution conv39 1 1 relu_blob31_splitncnn_0 conv_blob39 0=16 1=3 2=1 3=1 4=1 5=0 6=9216 +BatchNorm batch_norm39 1 1 conv_blob39 batch_norm_blob39 0=16 +Scale bn_scale39 1 1 batch_norm_blob39 batch_norm_blob39_bn_scale39 0=16 1=1 +ReLU relu36 1 1 batch_norm_blob39_bn_scale39 relu_blob36 +Split splitncnn_10 1 2 relu_blob36 relu_blob36_splitncnn_0 relu_blob36_splitncnn_1 +Convolution conv40 1 1 relu_blob36_splitncnn_1 conv_blob40 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm40 1 1 conv_blob40 batch_norm_blob40 0=16 +Scale bn_scale40 1 1 batch_norm_blob40 batch_norm_blob40_bn_scale40 0=16 1=1 +Convolution conv41 1 1 relu_blob36_splitncnn_0 conv_blob41 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm41 1 1 conv_blob41 batch_norm_blob41 0=16 +Scale bn_scale41 1 1 batch_norm_blob41 batch_norm_blob41_bn_scale41 0=16 1=1 +ReLU relu37 1 1 batch_norm_blob41_bn_scale41 relu_blob37 +Convolution conv42 1 1 relu_blob37 conv_blob42 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm42 1 1 conv_blob42 batch_norm_blob42 0=16 +Scale bn_scale42 1 1 batch_norm_blob42 batch_norm_blob42_bn_scale42 0=16 1=1 +Concat cat2 3 1 batch_norm_blob38_bn_scale38 batch_norm_blob40_bn_scale40 batch_norm_blob42_bn_scale42 cat_blob2 0=0 +ReLU relu38 1 1 cat_blob2 relu_blob38 +Split splitncnn_11 1 3 relu_blob38 relu_blob38_splitncnn_0 relu_blob38_splitncnn_1 relu_blob38_splitncnn_2 +Convolution conv43 1 1 relu_blob30_splitncnn_1 conv_blob43 0=32 1=3 2=1 3=1 4=1 5=0 6=18432 +BatchNorm batch_norm43 1 1 conv_blob43 batch_norm_blob43 0=32 +Scale bn_scale43 1 1 batch_norm_blob43 batch_norm_blob43_bn_scale43 0=32 1=1 +Convolution conv44 1 1 relu_blob30_splitncnn_0 conv_blob44 0=16 1=3 2=1 3=1 4=1 5=0 6=9216 +BatchNorm batch_norm44 1 1 conv_blob44 batch_norm_blob44 0=16 +Scale bn_scale44 1 1 batch_norm_blob44 batch_norm_blob44_bn_scale44 0=16 1=1 +ReLU relu39 1 1 batch_norm_blob44_bn_scale44 relu_blob39 +Split splitncnn_12 1 2 relu_blob39 relu_blob39_splitncnn_0 relu_blob39_splitncnn_1 +Convolution conv45 1 1 relu_blob39_splitncnn_1 conv_blob45 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm45 1 1 conv_blob45 batch_norm_blob45 0=16 +Scale bn_scale45 1 1 batch_norm_blob45 batch_norm_blob45_bn_scale45 0=16 1=1 +Convolution conv46 1 1 relu_blob39_splitncnn_0 conv_blob46 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm46 1 1 conv_blob46 batch_norm_blob46 0=16 +Scale bn_scale46 1 1 batch_norm_blob46 batch_norm_blob46_bn_scale46 0=16 1=1 +ReLU relu40 1 1 batch_norm_blob46_bn_scale46 relu_blob40 +Convolution conv47 1 1 relu_blob40 conv_blob47 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 +BatchNorm batch_norm47 1 1 conv_blob47 batch_norm_blob47 0=16 +Scale bn_scale47 1 1 batch_norm_blob47 batch_norm_blob47_bn_scale47 0=16 1=1 +Concat cat3 3 1 batch_norm_blob43_bn_scale43 batch_norm_blob45_bn_scale45 batch_norm_blob47_bn_scale47 cat_blob3 0=0 +ReLU relu41 1 1 cat_blob3 relu_blob41 +Split splitncnn_13 1 3 relu_blob41 relu_blob41_splitncnn_0 relu_blob41_splitncnn_1 relu_blob41_splitncnn_2 +Convolution conv48 1 1 relu_blob35_splitncnn_2 conv_blob48 0=8 1=1 2=1 3=1 4=0 5=1 6=512 +Convolution conv49 1 1 relu_blob35_splitncnn_1 conv_blob49 0=4 1=1 2=1 3=1 4=0 5=1 6=256 +Convolution conv50 1 1 relu_blob38_splitncnn_2 conv_blob50 0=8 1=1 2=1 3=1 4=0 5=1 6=512 +Convolution conv51 1 1 relu_blob38_splitncnn_1 conv_blob51 0=4 1=1 2=1 3=1 4=0 5=1 6=256 +Convolution conv52 1 1 relu_blob41_splitncnn_2 conv_blob52 0=8 1=1 2=1 3=1 4=0 5=1 6=512 +Convolution conv53 1 1 relu_blob41_splitncnn_1 conv_blob53 0=4 1=1 2=1 3=1 4=0 5=1 6=256 +Permute conv4_3_norm_mbox_loc_perm 1 1 conv_blob48 conv4_3_norm_mbox_loc_perm 0=3 +Flatten conv4_3_norm_mbox_loc_flat 1 1 conv4_3_norm_mbox_loc_perm conv4_3_norm_mbox_loc_flat +Permute conv4_3_norm_mbox_conf_perm 1 1 conv_blob49 conv4_3_norm_mbox_conf_perm 0=3 +Flatten conv4_3_norm_mbox_conf_flat 1 1 conv4_3_norm_mbox_conf_perm conv4_3_norm_mbox_conf_flat +PriorBox conv4_3_norm_mbox_priorbox 2 1 relu_blob35_splitncnn_0 data_splitncnn_2 conv4_3_norm_mbox_priorbox -23300=2,1.600000e+01,3.200000e+01 -23301=0 -23302=0 3=1.000000e-01 4=1.000000e-01 5=2.000000e-01 6=2.000000e-01 7=1 8=0 9=-233 10=-233 11=8.000000e+00 12=8.000000e+00 13=5.000000e-01 +Permute conv5_3_norm_mbox_loc_perm 1 1 conv_blob50 conv5_3_norm_mbox_loc_perm 0=3 +Flatten conv5_3_norm_mbox_loc_flat 1 1 conv5_3_norm_mbox_loc_perm conv5_3_norm_mbox_loc_flat +Permute conv5_3_norm_mbox_conf_perm 1 1 conv_blob51 conv5_3_norm_mbox_conf_perm 0=3 +Flatten conv5_3_norm_mbox_conf_flat 1 1 conv5_3_norm_mbox_conf_perm conv5_3_norm_mbox_conf_flat +PriorBox conv5_3_norm_mbox_priorbox 2 1 relu_blob38_splitncnn_0 data_splitncnn_1 conv5_3_norm_mbox_priorbox -23300=2,6.400000e+01,1.280000e+02 -23301=0 -23302=0 3=1.000000e-01 4=1.000000e-01 5=2.000000e-01 6=2.000000e-01 7=1 8=0 9=-233 10=-233 11=1.600000e+01 12=1.600000e+01 13=5.000000e-01 +Permute conv6_3_norm_mbox_loc_perm 1 1 conv_blob52 conv6_3_norm_mbox_loc_perm 0=3 +Flatten conv6_3_norm_mbox_loc_flat 1 1 conv6_3_norm_mbox_loc_perm conv6_3_norm_mbox_loc_flat +Permute conv6_3_norm_mbox_conf_perm 1 1 conv_blob53 conv6_3_norm_mbox_conf_perm 0=3 +Flatten conv6_3_norm_mbox_conf_flat 1 1 conv6_3_norm_mbox_conf_perm conv6_3_norm_mbox_conf_flat +PriorBox conv6_3_norm_mbox_priorbox 2 1 relu_blob41_splitncnn_0 data_splitncnn_0 conv6_3_norm_mbox_priorbox -23300=2,2.560000e+02,5.120000e+02 -23301=0 -23302=0 3=1.000000e-01 4=1.000000e-01 5=2.000000e-01 6=2.000000e-01 7=1 8=0 9=-233 10=-233 11=3.200000e+01 12=3.200000e+01 13=5.000000e-01 +Concat mbox_loc 3 1 conv4_3_norm_mbox_loc_flat conv5_3_norm_mbox_loc_flat conv6_3_norm_mbox_loc_flat mbox_loc 0=0 +Concat mbox_conf 3 1 conv4_3_norm_mbox_conf_flat conv5_3_norm_mbox_conf_flat conv6_3_norm_mbox_conf_flat mbox_conf 0=0 +Concat mbox_priorbox 3 1 conv4_3_norm_mbox_priorbox conv5_3_norm_mbox_priorbox conv6_3_norm_mbox_priorbox mbox_priorbox 0=1 +Reshape mbox_conf_reshape 1 1 mbox_conf mbox_conf_reshape 0=2 1=-1 2=-233 3=0 +Softmax mbox_conf_softmax 1 1 mbox_conf_reshape mbox_conf_softmax 0=1 1=1 +Flatten mbox_conf_flatten 1 1 mbox_conf_softmax mbox_conf_flatten +DetectionOutput detection_out 3 1 mbox_loc mbox_conf_flatten mbox_priorbox detection_out 0=2 1=3.000000e-01 2=400 3=200 4=1.000000e-01 diff --git a/facesdk.framework/facesdk b/facesdk.framework/facesdk new file mode 100644 index 0000000..3cff73e Binary files /dev/null and b/facesdk.framework/facesdk differ diff --git a/facesdk.framework/landmark.bin b/facesdk.framework/landmark.bin new file mode 100644 index 0000000..1250575 Binary files /dev/null and b/facesdk.framework/landmark.bin differ diff --git a/facesdk.framework/landmark.param b/facesdk.framework/landmark.param new file mode 100644 index 0000000..f8bf71d --- /dev/null +++ b/facesdk.framework/landmark.param @@ -0,0 +1,17 @@ +7767517 +15 15 +Input input 0 1 data 0=60 1=60 2=1 +Convolution Conv1 1 1 data Conv1 0=20 1=5 2=1 3=1 4=2 5=1 6=500 +ReLU ActivationReLU1 1 1 Conv1 ActivationReLU1 +Pooling Pool1 1 1 ActivationReLU1 Pool1 0=0 1=2 2=2 3=0 4=0 +Convolution Conv2 1 1 Pool1 Conv2 0=48 1=5 2=1 3=1 4=2 5=1 6=24000 +ReLU ActivationReLU2 1 1 Conv2 ActivationReLU2 +Pooling Pool2 1 1 ActivationReLU2 Pool2 0=0 1=2 2=2 3=0 4=0 +Convolution Conv3 1 1 Pool2 Conv3 0=64 1=3 2=1 3=1 4=0 5=1 6=27648 +ReLU ActivationReLU3 1 1 Conv3 ActivationReLU3 +Pooling Pool3 1 1 ActivationReLU3 Pool3 0=0 1=3 2=2 3=0 4=0 +Convolution Conv4 1 1 Pool3 Conv4 0=80 1=3 2=1 3=1 4=0 5=1 6=46080 +ReLU ActivationReLU4 1 1 Conv4 ActivationReLU4 +InnerProduct Dense1 1 1 ActivationReLU4 Dense1 0=512 1=1 2=655360 +ReLU ActivationReLU5 1 1 Dense1 ActivationReLU5 +InnerProduct Dense3 1 1 ActivationReLU5 Dense3 0=136 1=1 2=69632 diff --git a/facesdk.framework/liveness.bin b/facesdk.framework/liveness.bin new file mode 100644 index 0000000..67fd25e Binary files /dev/null and b/facesdk.framework/liveness.bin differ