├── FaceLivenessDetection-Bridging-Header.h ├── FaceLivenessDetection.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── user.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── user.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── FaceLivenessDetection ├── .DS_Store ├── AboutViewController.swift ├── AppDelegate.swift ├── Assets.xcassets │ ├── .DS_Store │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── iTunesArtwork@2x.png │ ├── Contents.json │ ├── clr_main_button_bg1.colorset │ │ └── Contents.json │ ├── clr_main_button_bg2.colorset │ │ └── Contents.json │ ├── ic_github.imageset │ │ ├── Contents.json │ │ ├── ic_github 1.png │ │ ├── ic_github 2.png │ │ └── ic_github.png │ ├── ic_kby.imageset │ │ ├── Contents.json │ │ ├── ic_kby 1.png │ │ ├── ic_kby 2.png │ │ └── ic_kby.png │ ├── ic_skype.imageset │ │ ├── Contents.json │ │ ├── ic_skype 1.png │ │ ├── ic_skype 2.png │ │ └── ic_skype.png │ ├── ic_telegram.imageset │ │ ├── Contents.json │ │ ├── ic_telegram 1.png │ │ ├── ic_telegram 2.png │ │ └── ic_telegram.png │ └── ic_whatsapp.imageset │ │ ├── Contents.json │ │ ├── ic_whatsapp 1.png │ │ ├── ic_whatsapp 2.png │ │ └── ic_whatsapp.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CameraViewController.swift ├── FaceLivenessDetection.xcdatamodeld │ ├── .xccurrentversion │ └── FaceLivenessDetection.xcdatamodel │ │ └── contents ├── FaceView.swift ├── Info.plist ├── SceneDelegate.swift ├── SettingsViewController.swift ├── UIImageExtension.swift └── ViewController.swift ├── FaceLivenessDetectionTests └── FaceLivenessDetectionTests.swift ├── FaceLivenessDetectionUITests ├── FaceLivenessDetectionUITests.swift └── FaceLivenessDetectionUITestsLaunchTests.swift ├── README.md ├── facesdk.framework ├── .DS_Store ├── Headers │ ├── facesdk.h │ └── facesdk_api.h ├── Info.plist ├── Modules │ └── module.modulemap ├── _CodeSignature │ └── CodeResources ├── detection.bin ├── detection.param ├── facesdk ├── landmark.bin ├── landmark.param └── liveness.bin └── privacy /FaceLivenessDetection-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | #import "facesdk/facesdk.h" 5 | -------------------------------------------------------------------------------- /FaceLivenessDetection.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CE0A0A312A43304E00EDDCE7 /* UIImageExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0A0A302A43304E00EDDCE7 /* UIImageExtension.swift */; }; 11 | CE29C4EE29E8503F008EDB5A /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE29C4ED29E8503E008EDB5A /* AboutViewController.swift */; }; 12 | CE29C4F029E865D4008EDB5A /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE29C4EF29E865D4008EDB5A /* SettingsViewController.swift */; }; 13 | CEA38C1329E733A50030D4E5 /* FaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA38C1229E733A50030D4E5 /* FaceView.swift */; }; 14 | CEA38C1F29E79F900030D4E5 /* CameraViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA38C1E29E79F900030D4E5 /* CameraViewController.swift */; }; 15 | CEAE555129E6623200DE0DD9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555029E6623200DE0DD9 /* AppDelegate.swift */; }; 16 | CEAE555329E6623200DE0DD9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555229E6623200DE0DD9 /* SceneDelegate.swift */; }; 17 | CEAE555529E6623200DE0DD9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555429E6623200DE0DD9 /* ViewController.swift */; }; 18 | CEAE555829E6623200DE0DD9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEAE555629E6623200DE0DD9 /* Main.storyboard */; }; 19 | CEAE555B29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = CEAE555929E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld */; }; 20 | CEAE555D29E6625000DE0DD9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CEAE555C29E6625000DE0DD9 /* Assets.xcassets */; }; 21 | CEAE556029E6625000DE0DD9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEAE555E29E6625000DE0DD9 /* LaunchScreen.storyboard */; }; 22 | CEAE556B29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE556A29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift */; }; 23 | CEAE557529E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE557429E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift */; }; 24 | CEAE557729E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEAE557629E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift */; }; 25 | CEF802D929E70D4700039E96 /* facesdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEF802D829E70D4600039E96 /* facesdk.framework */; }; 26 | CEF802DA29E70D4700039E96 /* facesdk.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CEF802D829E70D4600039E96 /* facesdk.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | CEAE556729E6625100DE0DD9 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = CEAE554529E6623200DE0DD9 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = CEAE554C29E6623200DE0DD9; 35 | remoteInfo = FaceLivenessDetection; 36 | }; 37 | CEAE557129E6625100DE0DD9 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = CEAE554529E6623200DE0DD9 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = CEAE554C29E6623200DE0DD9; 42 | remoteInfo = FaceLivenessDetection; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXCopyFilesBuildPhase section */ 47 | CEF802DB29E70D4800039E96 /* Embed Frameworks */ = { 48 | isa = PBXCopyFilesBuildPhase; 49 | buildActionMask = 2147483647; 50 | dstPath = ""; 51 | dstSubfolderSpec = 10; 52 | files = ( 53 | CEF802DA29E70D4700039E96 /* facesdk.framework in Embed Frameworks */, 54 | ); 55 | name = "Embed Frameworks"; 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXCopyFilesBuildPhase section */ 59 | 60 | /* Begin PBXFileReference section */ 61 | CE0A0A302A43304E00EDDCE7 /* UIImageExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImageExtension.swift; sourceTree = ""; }; 62 | CE29C4ED29E8503E008EDB5A /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; 63 | CE29C4EF29E865D4008EDB5A /* SettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = ""; }; 64 | CEA38C1229E733A50030D4E5 /* FaceView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FaceView.swift; sourceTree = ""; }; 65 | CEA38C1E29E79F900030D4E5 /* CameraViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraViewController.swift; sourceTree = ""; }; 66 | CEAE554D29E6623200DE0DD9 /* FaceLivenessDetection.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FaceLivenessDetection.app; sourceTree = BUILT_PRODUCTS_DIR; }; 67 | CEAE555029E6623200DE0DD9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 68 | CEAE555229E6623200DE0DD9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 69 | CEAE555429E6623200DE0DD9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 70 | CEAE555729E6623200DE0DD9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 71 | CEAE555A29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = FaceLivenessDetection.xcdatamodel; sourceTree = ""; }; 72 | CEAE555C29E6625000DE0DD9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 73 | CEAE555F29E6625000DE0DD9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 74 | CEAE556129E6625000DE0DD9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 75 | CEAE556629E6625100DE0DD9 /* FaceLivenessDetectionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FaceLivenessDetectionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 76 | CEAE556A29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceLivenessDetectionTests.swift; sourceTree = ""; }; 77 | CEAE557029E6625100DE0DD9 /* FaceLivenessDetectionUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FaceLivenessDetectionUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | CEAE557429E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceLivenessDetectionUITests.swift; sourceTree = ""; }; 79 | CEAE557629E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaceLivenessDetectionUITestsLaunchTests.swift; sourceTree = ""; }; 80 | CEF802D829E70D4600039E96 /* facesdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = facesdk.framework; sourceTree = ""; }; 81 | /* End PBXFileReference section */ 82 | 83 | /* Begin PBXFrameworksBuildPhase section */ 84 | CEAE554A29E6623200DE0DD9 /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | CEF802D929E70D4700039E96 /* facesdk.framework in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | CEAE556329E6625100DE0DD9 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | CEAE556D29E6625100DE0DD9 /* Frameworks */ = { 100 | isa = PBXFrameworksBuildPhase; 101 | buildActionMask = 2147483647; 102 | files = ( 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | /* End PBXFrameworksBuildPhase section */ 107 | 108 | /* Begin PBXGroup section */ 109 | CEAE554429E6623200DE0DD9 = { 110 | isa = PBXGroup; 111 | children = ( 112 | CEAE554F29E6623200DE0DD9 /* FaceLivenessDetection */, 113 | CEAE556929E6625100DE0DD9 /* FaceLivenessDetectionTests */, 114 | CEAE557329E6625100DE0DD9 /* FaceLivenessDetectionUITests */, 115 | CEAE554E29E6623200DE0DD9 /* Products */, 116 | CEF802D729E70D4000039E96 /* Frameworks */, 117 | ); 118 | sourceTree = ""; 119 | }; 120 | CEAE554E29E6623200DE0DD9 /* Products */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | CEAE554D29E6623200DE0DD9 /* FaceLivenessDetection.app */, 124 | CEAE556629E6625100DE0DD9 /* FaceLivenessDetectionTests.xctest */, 125 | CEAE557029E6625100DE0DD9 /* FaceLivenessDetectionUITests.xctest */, 126 | ); 127 | name = Products; 128 | sourceTree = ""; 129 | }; 130 | CEAE554F29E6623200DE0DD9 /* FaceLivenessDetection */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | CEAE555029E6623200DE0DD9 /* AppDelegate.swift */, 134 | CE29C4ED29E8503E008EDB5A /* AboutViewController.swift */, 135 | CEAE555229E6623200DE0DD9 /* SceneDelegate.swift */, 136 | CEAE555429E6623200DE0DD9 /* ViewController.swift */, 137 | CEA38C1E29E79F900030D4E5 /* CameraViewController.swift */, 138 | CE0A0A302A43304E00EDDCE7 /* UIImageExtension.swift */, 139 | CE29C4EF29E865D4008EDB5A /* SettingsViewController.swift */, 140 | CEA38C1229E733A50030D4E5 /* FaceView.swift */, 141 | CEAE555629E6623200DE0DD9 /* Main.storyboard */, 142 | CEAE555C29E6625000DE0DD9 /* Assets.xcassets */, 143 | CEAE555E29E6625000DE0DD9 /* LaunchScreen.storyboard */, 144 | CEAE556129E6625000DE0DD9 /* Info.plist */, 145 | CEAE555929E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld */, 146 | ); 147 | path = FaceLivenessDetection; 148 | sourceTree = ""; 149 | }; 150 | CEAE556929E6625100DE0DD9 /* FaceLivenessDetectionTests */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | CEAE556A29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift */, 154 | ); 155 | path = FaceLivenessDetectionTests; 156 | sourceTree = ""; 157 | }; 158 | CEAE557329E6625100DE0DD9 /* FaceLivenessDetectionUITests */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | CEAE557429E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift */, 162 | CEAE557629E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift */, 163 | ); 164 | path = FaceLivenessDetectionUITests; 165 | sourceTree = ""; 166 | }; 167 | CEF802D729E70D4000039E96 /* Frameworks */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | CEF802D829E70D4600039E96 /* facesdk.framework */, 171 | ); 172 | name = Frameworks; 173 | sourceTree = ""; 174 | }; 175 | /* End PBXGroup section */ 176 | 177 | /* Begin PBXNativeTarget section */ 178 | CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = CEAE557A29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetection" */; 181 | buildPhases = ( 182 | CEAE554929E6623200DE0DD9 /* Sources */, 183 | CEAE554A29E6623200DE0DD9 /* Frameworks */, 184 | CEAE554B29E6623200DE0DD9 /* Resources */, 185 | CEF802DB29E70D4800039E96 /* Embed Frameworks */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | ); 191 | name = FaceLivenessDetection; 192 | productName = FaceLivenessDetection; 193 | productReference = CEAE554D29E6623200DE0DD9 /* FaceLivenessDetection.app */; 194 | productType = "com.apple.product-type.application"; 195 | }; 196 | CEAE556529E6625100DE0DD9 /* FaceLivenessDetectionTests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = CEAE557D29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionTests" */; 199 | buildPhases = ( 200 | CEAE556229E6625100DE0DD9 /* Sources */, 201 | CEAE556329E6625100DE0DD9 /* Frameworks */, 202 | CEAE556429E6625100DE0DD9 /* Resources */, 203 | ); 204 | buildRules = ( 205 | ); 206 | dependencies = ( 207 | CEAE556829E6625100DE0DD9 /* PBXTargetDependency */, 208 | ); 209 | name = FaceLivenessDetectionTests; 210 | productName = FaceLivenessDetectionTests; 211 | productReference = CEAE556629E6625100DE0DD9 /* FaceLivenessDetectionTests.xctest */; 212 | productType = "com.apple.product-type.bundle.unit-test"; 213 | }; 214 | CEAE556F29E6625100DE0DD9 /* FaceLivenessDetectionUITests */ = { 215 | isa = PBXNativeTarget; 216 | buildConfigurationList = CEAE558029E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionUITests" */; 217 | buildPhases = ( 218 | CEAE556C29E6625100DE0DD9 /* Sources */, 219 | CEAE556D29E6625100DE0DD9 /* Frameworks */, 220 | CEAE556E29E6625100DE0DD9 /* Resources */, 221 | ); 222 | buildRules = ( 223 | ); 224 | dependencies = ( 225 | CEAE557229E6625100DE0DD9 /* PBXTargetDependency */, 226 | ); 227 | name = FaceLivenessDetectionUITests; 228 | productName = FaceLivenessDetectionUITests; 229 | productReference = CEAE557029E6625100DE0DD9 /* FaceLivenessDetectionUITests.xctest */; 230 | productType = "com.apple.product-type.bundle.ui-testing"; 231 | }; 232 | /* End PBXNativeTarget section */ 233 | 234 | /* Begin PBXProject section */ 235 | CEAE554529E6623200DE0DD9 /* Project object */ = { 236 | isa = PBXProject; 237 | attributes = { 238 | BuildIndependentTargetsInParallel = 1; 239 | LastSwiftUpdateCheck = 1420; 240 | LastUpgradeCheck = 1420; 241 | TargetAttributes = { 242 | CEAE554C29E6623200DE0DD9 = { 243 | CreatedOnToolsVersion = 14.2; 244 | }; 245 | CEAE556529E6625100DE0DD9 = { 246 | CreatedOnToolsVersion = 14.2; 247 | TestTargetID = CEAE554C29E6623200DE0DD9; 248 | }; 249 | CEAE556F29E6625100DE0DD9 = { 250 | CreatedOnToolsVersion = 14.2; 251 | TestTargetID = CEAE554C29E6623200DE0DD9; 252 | }; 253 | }; 254 | }; 255 | buildConfigurationList = CEAE554829E6623200DE0DD9 /* Build configuration list for PBXProject "FaceLivenessDetection" */; 256 | compatibilityVersion = "Xcode 14.0"; 257 | developmentRegion = en; 258 | hasScannedForEncodings = 0; 259 | knownRegions = ( 260 | en, 261 | Base, 262 | ); 263 | mainGroup = CEAE554429E6623200DE0DD9; 264 | productRefGroup = CEAE554E29E6623200DE0DD9 /* Products */; 265 | projectDirPath = ""; 266 | projectRoot = ""; 267 | targets = ( 268 | CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */, 269 | CEAE556529E6625100DE0DD9 /* FaceLivenessDetectionTests */, 270 | CEAE556F29E6625100DE0DD9 /* FaceLivenessDetectionUITests */, 271 | ); 272 | }; 273 | /* End PBXProject section */ 274 | 275 | /* Begin PBXResourcesBuildPhase section */ 276 | CEAE554B29E6623200DE0DD9 /* Resources */ = { 277 | isa = PBXResourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | CEAE556029E6625000DE0DD9 /* LaunchScreen.storyboard in Resources */, 281 | CEAE555D29E6625000DE0DD9 /* Assets.xcassets in Resources */, 282 | CEAE555829E6623200DE0DD9 /* Main.storyboard in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | CEAE556429E6625100DE0DD9 /* Resources */ = { 287 | isa = PBXResourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | CEAE556E29E6625100DE0DD9 /* Resources */ = { 294 | isa = PBXResourcesBuildPhase; 295 | buildActionMask = 2147483647; 296 | files = ( 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | /* End PBXResourcesBuildPhase section */ 301 | 302 | /* Begin PBXSourcesBuildPhase section */ 303 | CEAE554929E6623200DE0DD9 /* Sources */ = { 304 | isa = PBXSourcesBuildPhase; 305 | buildActionMask = 2147483647; 306 | files = ( 307 | CEAE555529E6623200DE0DD9 /* ViewController.swift in Sources */, 308 | CEAE555B29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld in Sources */, 309 | CEAE555129E6623200DE0DD9 /* AppDelegate.swift in Sources */, 310 | CEAE555329E6623200DE0DD9 /* SceneDelegate.swift in Sources */, 311 | CEA38C1329E733A50030D4E5 /* FaceView.swift in Sources */, 312 | CE0A0A312A43304E00EDDCE7 /* UIImageExtension.swift in Sources */, 313 | CE29C4EE29E8503F008EDB5A /* AboutViewController.swift in Sources */, 314 | CEA38C1F29E79F900030D4E5 /* CameraViewController.swift in Sources */, 315 | CE29C4F029E865D4008EDB5A /* SettingsViewController.swift in Sources */, 316 | ); 317 | runOnlyForDeploymentPostprocessing = 0; 318 | }; 319 | CEAE556229E6625100DE0DD9 /* Sources */ = { 320 | isa = PBXSourcesBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | CEAE556B29E6625100DE0DD9 /* FaceLivenessDetectionTests.swift in Sources */, 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | }; 327 | CEAE556C29E6625100DE0DD9 /* Sources */ = { 328 | isa = PBXSourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | CEAE557729E6625100DE0DD9 /* FaceLivenessDetectionUITestsLaunchTests.swift in Sources */, 332 | CEAE557529E6625100DE0DD9 /* FaceLivenessDetectionUITests.swift in Sources */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXSourcesBuildPhase section */ 337 | 338 | /* Begin PBXTargetDependency section */ 339 | CEAE556829E6625100DE0DD9 /* PBXTargetDependency */ = { 340 | isa = PBXTargetDependency; 341 | target = CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */; 342 | targetProxy = CEAE556729E6625100DE0DD9 /* PBXContainerItemProxy */; 343 | }; 344 | CEAE557229E6625100DE0DD9 /* PBXTargetDependency */ = { 345 | isa = PBXTargetDependency; 346 | target = CEAE554C29E6623200DE0DD9 /* FaceLivenessDetection */; 347 | targetProxy = CEAE557129E6625100DE0DD9 /* PBXContainerItemProxy */; 348 | }; 349 | /* End PBXTargetDependency section */ 350 | 351 | /* Begin PBXVariantGroup section */ 352 | CEAE555629E6623200DE0DD9 /* Main.storyboard */ = { 353 | isa = PBXVariantGroup; 354 | children = ( 355 | CEAE555729E6623200DE0DD9 /* Base */, 356 | ); 357 | name = Main.storyboard; 358 | sourceTree = ""; 359 | }; 360 | CEAE555E29E6625000DE0DD9 /* LaunchScreen.storyboard */ = { 361 | isa = PBXVariantGroup; 362 | children = ( 363 | CEAE555F29E6625000DE0DD9 /* Base */, 364 | ); 365 | name = LaunchScreen.storyboard; 366 | sourceTree = ""; 367 | }; 368 | /* End PBXVariantGroup section */ 369 | 370 | /* Begin XCBuildConfiguration section */ 371 | CEAE557829E6625100DE0DD9 /* Debug */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | ALWAYS_SEARCH_USER_PATHS = NO; 375 | CLANG_ANALYZER_NONNULL = YES; 376 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 377 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 378 | CLANG_ENABLE_MODULES = YES; 379 | CLANG_ENABLE_OBJC_ARC = YES; 380 | CLANG_ENABLE_OBJC_WEAK = YES; 381 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_COMMA = YES; 384 | CLANG_WARN_CONSTANT_CONVERSION = YES; 385 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 388 | CLANG_WARN_EMPTY_BODY = YES; 389 | CLANG_WARN_ENUM_CONVERSION = YES; 390 | CLANG_WARN_INFINITE_RECURSION = YES; 391 | CLANG_WARN_INT_CONVERSION = YES; 392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 393 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 396 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 398 | CLANG_WARN_STRICT_PROTOTYPES = YES; 399 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 400 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 401 | CLANG_WARN_UNREACHABLE_CODE = YES; 402 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 403 | COPY_PHASE_STRIP = NO; 404 | DEBUG_INFORMATION_FORMAT = dwarf; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | ENABLE_TESTABILITY = YES; 407 | GCC_C_LANGUAGE_STANDARD = gnu11; 408 | GCC_DYNAMIC_NO_PIC = NO; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_OPTIMIZATION_LEVEL = 0; 411 | GCC_PREPROCESSOR_DEFINITIONS = ( 412 | "DEBUG=1", 413 | "$(inherited)", 414 | ); 415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 417 | GCC_WARN_UNDECLARED_SELECTOR = YES; 418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 419 | GCC_WARN_UNUSED_FUNCTION = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 422 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 423 | MTL_FAST_MATH = YES; 424 | ONLY_ACTIVE_ARCH = YES; 425 | SDKROOT = iphoneos; 426 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 427 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 428 | }; 429 | name = Debug; 430 | }; 431 | CEAE557929E6625100DE0DD9 /* Release */ = { 432 | isa = XCBuildConfiguration; 433 | buildSettings = { 434 | ALWAYS_SEARCH_USER_PATHS = NO; 435 | CLANG_ANALYZER_NONNULL = YES; 436 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 437 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 438 | CLANG_ENABLE_MODULES = YES; 439 | CLANG_ENABLE_OBJC_ARC = YES; 440 | CLANG_ENABLE_OBJC_WEAK = YES; 441 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 442 | CLANG_WARN_BOOL_CONVERSION = YES; 443 | CLANG_WARN_COMMA = YES; 444 | CLANG_WARN_CONSTANT_CONVERSION = YES; 445 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 448 | CLANG_WARN_EMPTY_BODY = YES; 449 | CLANG_WARN_ENUM_CONVERSION = YES; 450 | CLANG_WARN_INFINITE_RECURSION = YES; 451 | CLANG_WARN_INT_CONVERSION = YES; 452 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 453 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 454 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 455 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 456 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 457 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 458 | CLANG_WARN_STRICT_PROTOTYPES = YES; 459 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 460 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 461 | CLANG_WARN_UNREACHABLE_CODE = YES; 462 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 463 | COPY_PHASE_STRIP = NO; 464 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 465 | ENABLE_NS_ASSERTIONS = NO; 466 | ENABLE_STRICT_OBJC_MSGSEND = YES; 467 | GCC_C_LANGUAGE_STANDARD = gnu11; 468 | GCC_NO_COMMON_BLOCKS = YES; 469 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 470 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 471 | GCC_WARN_UNDECLARED_SELECTOR = YES; 472 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 473 | GCC_WARN_UNUSED_FUNCTION = YES; 474 | GCC_WARN_UNUSED_VARIABLE = YES; 475 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 476 | MTL_ENABLE_DEBUG_INFO = NO; 477 | MTL_FAST_MATH = YES; 478 | SDKROOT = iphoneos; 479 | SWIFT_COMPILATION_MODE = wholemodule; 480 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 481 | VALIDATE_PRODUCT = YES; 482 | }; 483 | name = Release; 484 | }; 485 | CEAE557B29E6625100DE0DD9 /* Debug */ = { 486 | isa = XCBuildConfiguration; 487 | buildSettings = { 488 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 489 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 490 | CODE_SIGN_STYLE = Automatic; 491 | CURRENT_PROJECT_VERSION = 4; 492 | DEVELOPMENT_TEAM = 6G7RACBX72; 493 | FRAMEWORK_SEARCH_PATHS = ( 494 | "$(inherited)", 495 | "$(PROJECT_DIR)", 496 | ); 497 | GENERATE_INFOPLIST_FILE = YES; 498 | INFOPLIST_FILE = FaceLivenessDetection/Info.plist; 499 | INFOPLIST_KEY_CFBundleDisplayName = FaceLivenessDetection; 500 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity"; 501 | INFOPLIST_KEY_NSCameraUsageDescription = "The application utilizes the camera for performing facial recognition.\n\n\n\n\nThe app utilizes the camera for performing facial recognition."; 502 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 503 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 504 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 505 | INFOPLIST_KEY_UIStatusBarStyle = ""; 506 | INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 507 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 508 | LD_RUNPATH_SEARCH_PATHS = ( 509 | "$(inherited)", 510 | "@executable_path/Frameworks", 511 | ); 512 | MARKETING_VERSION = 1.2; 513 | PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.facelive; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; 516 | SUPPORTS_MACCATALYST = NO; 517 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; 518 | SWIFT_EMIT_LOC_STRINGS = YES; 519 | SWIFT_OBJC_BRIDGING_HEADER = "FaceLivenessDetection-Bridging-Header.h"; 520 | SWIFT_VERSION = 5.0; 521 | TARGETED_DEVICE_FAMILY = 1; 522 | }; 523 | name = Debug; 524 | }; 525 | CEAE557C29E6625100DE0DD9 /* Release */ = { 526 | isa = XCBuildConfiguration; 527 | buildSettings = { 528 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 529 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 530 | CODE_SIGN_STYLE = Automatic; 531 | CURRENT_PROJECT_VERSION = 4; 532 | DEVELOPMENT_TEAM = 6G7RACBX72; 533 | FRAMEWORK_SEARCH_PATHS = ( 534 | "$(inherited)", 535 | "$(PROJECT_DIR)", 536 | ); 537 | GENERATE_INFOPLIST_FILE = YES; 538 | INFOPLIST_FILE = FaceLivenessDetection/Info.plist; 539 | INFOPLIST_KEY_CFBundleDisplayName = FaceLivenessDetection; 540 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity"; 541 | INFOPLIST_KEY_NSCameraUsageDescription = "The application utilizes the camera for performing facial recognition.\n\n\n\n\nThe app utilizes the camera for performing facial recognition."; 542 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 543 | INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; 544 | INFOPLIST_KEY_UIMainStoryboardFile = Main; 545 | INFOPLIST_KEY_UIStatusBarStyle = ""; 546 | INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 547 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 548 | LD_RUNPATH_SEARCH_PATHS = ( 549 | "$(inherited)", 550 | "@executable_path/Frameworks", 551 | ); 552 | MARKETING_VERSION = 1.2; 553 | PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.facelive; 554 | PRODUCT_NAME = "$(TARGET_NAME)"; 555 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; 556 | SUPPORTS_MACCATALYST = NO; 557 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; 558 | SWIFT_EMIT_LOC_STRINGS = YES; 559 | SWIFT_OBJC_BRIDGING_HEADER = "FaceLivenessDetection-Bridging-Header.h"; 560 | SWIFT_VERSION = 5.0; 561 | TARGETED_DEVICE_FAMILY = 1; 562 | }; 563 | name = Release; 564 | }; 565 | CEAE557E29E6625100DE0DD9 /* Debug */ = { 566 | isa = XCBuildConfiguration; 567 | buildSettings = { 568 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 569 | BUNDLE_LOADER = "$(TEST_HOST)"; 570 | CODE_SIGN_STYLE = Automatic; 571 | CURRENT_PROJECT_VERSION = 1; 572 | DEVELOPMENT_TEAM = JSUUF48N9C; 573 | GENERATE_INFOPLIST_FILE = YES; 574 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 575 | MARKETING_VERSION = 1.0; 576 | PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionTests; 577 | PRODUCT_NAME = "$(TARGET_NAME)"; 578 | SWIFT_EMIT_LOC_STRINGS = NO; 579 | SWIFT_VERSION = 5.0; 580 | TARGETED_DEVICE_FAMILY = "1,2"; 581 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FaceLivenessDetection.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/FaceLivenessDetection"; 582 | }; 583 | name = Debug; 584 | }; 585 | CEAE557F29E6625100DE0DD9 /* Release */ = { 586 | isa = XCBuildConfiguration; 587 | buildSettings = { 588 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 589 | BUNDLE_LOADER = "$(TEST_HOST)"; 590 | CODE_SIGN_STYLE = Automatic; 591 | CURRENT_PROJECT_VERSION = 1; 592 | DEVELOPMENT_TEAM = JSUUF48N9C; 593 | GENERATE_INFOPLIST_FILE = YES; 594 | IPHONEOS_DEPLOYMENT_TARGET = 16.2; 595 | MARKETING_VERSION = 1.0; 596 | PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionTests; 597 | PRODUCT_NAME = "$(TARGET_NAME)"; 598 | SWIFT_EMIT_LOC_STRINGS = NO; 599 | SWIFT_VERSION = 5.0; 600 | TARGETED_DEVICE_FAMILY = "1,2"; 601 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FaceLivenessDetection.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/FaceLivenessDetection"; 602 | }; 603 | name = Release; 604 | }; 605 | CEAE558129E6625100DE0DD9 /* Debug */ = { 606 | isa = XCBuildConfiguration; 607 | buildSettings = { 608 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 609 | CODE_SIGN_STYLE = Automatic; 610 | CURRENT_PROJECT_VERSION = 1; 611 | DEVELOPMENT_TEAM = JSUUF48N9C; 612 | GENERATE_INFOPLIST_FILE = YES; 613 | MARKETING_VERSION = 1.0; 614 | PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionUITests; 615 | PRODUCT_NAME = "$(TARGET_NAME)"; 616 | SWIFT_EMIT_LOC_STRINGS = NO; 617 | SWIFT_VERSION = 5.0; 618 | TARGETED_DEVICE_FAMILY = "1,2"; 619 | TEST_TARGET_NAME = FaceLivenessDetection; 620 | }; 621 | name = Debug; 622 | }; 623 | CEAE558229E6625100DE0DD9 /* Release */ = { 624 | isa = XCBuildConfiguration; 625 | buildSettings = { 626 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 627 | CODE_SIGN_STYLE = Automatic; 628 | CURRENT_PROJECT_VERSION = 1; 629 | DEVELOPMENT_TEAM = JSUUF48N9C; 630 | GENERATE_INFOPLIST_FILE = YES; 631 | MARKETING_VERSION = 1.0; 632 | PRODUCT_BUNDLE_IDENTIFIER = com.kbyai.FaceLivenessDetectionUITests; 633 | PRODUCT_NAME = "$(TARGET_NAME)"; 634 | SWIFT_EMIT_LOC_STRINGS = NO; 635 | SWIFT_VERSION = 5.0; 636 | TARGETED_DEVICE_FAMILY = "1,2"; 637 | TEST_TARGET_NAME = FaceLivenessDetection; 638 | }; 639 | name = Release; 640 | }; 641 | /* End XCBuildConfiguration section */ 642 | 643 | /* Begin XCConfigurationList section */ 644 | CEAE554829E6623200DE0DD9 /* Build configuration list for PBXProject "FaceLivenessDetection" */ = { 645 | isa = XCConfigurationList; 646 | buildConfigurations = ( 647 | CEAE557829E6625100DE0DD9 /* Debug */, 648 | CEAE557929E6625100DE0DD9 /* Release */, 649 | ); 650 | defaultConfigurationIsVisible = 0; 651 | defaultConfigurationName = Release; 652 | }; 653 | CEAE557A29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetection" */ = { 654 | isa = XCConfigurationList; 655 | buildConfigurations = ( 656 | CEAE557B29E6625100DE0DD9 /* Debug */, 657 | CEAE557C29E6625100DE0DD9 /* Release */, 658 | ); 659 | defaultConfigurationIsVisible = 0; 660 | defaultConfigurationName = Release; 661 | }; 662 | CEAE557D29E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionTests" */ = { 663 | isa = XCConfigurationList; 664 | buildConfigurations = ( 665 | CEAE557E29E6625100DE0DD9 /* Debug */, 666 | CEAE557F29E6625100DE0DD9 /* Release */, 667 | ); 668 | defaultConfigurationIsVisible = 0; 669 | defaultConfigurationName = Release; 670 | }; 671 | CEAE558029E6625100DE0DD9 /* Build configuration list for PBXNativeTarget "FaceLivenessDetectionUITests" */ = { 672 | isa = XCConfigurationList; 673 | buildConfigurations = ( 674 | CEAE558129E6625100DE0DD9 /* Debug */, 675 | CEAE558229E6625100DE0DD9 /* Release */, 676 | ); 677 | defaultConfigurationIsVisible = 0; 678 | defaultConfigurationName = Release; 679 | }; 680 | /* End XCConfigurationList section */ 681 | 682 | /* Begin XCVersionGroup section */ 683 | CEAE555929E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodeld */ = { 684 | isa = XCVersionGroup; 685 | children = ( 686 | CEAE555A29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodel */, 687 | ); 688 | currentVersion = CEAE555A29E6623200DE0DD9 /* FaceLivenessDetection.xcdatamodel */; 689 | path = FaceLivenessDetection.xcdatamodeld; 690 | sourceTree = ""; 691 | versionGroupType = wrapper.xcdatamodel; 692 | }; 693 | /* End XCVersionGroup section */ 694 | }; 695 | rootObject = CEAE554529E6623200DE0DD9 /* Project object */; 696 | } 697 | -------------------------------------------------------------------------------- /FaceLivenessDetection.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FaceLivenessDetection.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /FaceLivenessDetection.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /FaceLivenessDetection.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FaceLivenessDetection.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /FaceLivenessDetection/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/.DS_Store -------------------------------------------------------------------------------- /FaceLivenessDetection/AboutViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AVFoundation 3 | 4 | class AboutViewController: UIViewController{ 5 | 6 | override func viewDidLoad() { 7 | super.viewDidLoad() 8 | // Do any additional setup after loading the view. 9 | } 10 | 11 | 12 | @IBAction func done_clicked(_ sender: Any) { 13 | if let vc = self.presentingViewController as? ViewController { 14 | self.dismiss(animated: true, completion: nil) 15 | } 16 | } 17 | 18 | 19 | @IBAction func mail_clicked(_ sender: Any) { 20 | let appURL = URL(string: "mailto:contact@kby-ai.com") // URL scheme for Mail app 21 | 22 | if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) { 23 | // If Mail app is installed, open it with a pre-filled email 24 | UIApplication.shared.open(appURL, options: [:], completionHandler: nil) 25 | } else { 26 | // If Mail app is not installed, show an alert indicating that Mail app is not available 27 | let alert = UIAlertController(title: "Mail App Not Available", message: "The Mail app is not installed on this device.", preferredStyle: .alert) 28 | let okAction = UIAlertAction(title: "OK", style: .default, handler: nil) 29 | alert.addAction(okAction) 30 | UIApplication.shared.keyWindow?.rootViewController?.present(alert, animated: true, completion: nil) 31 | } 32 | } 33 | 34 | 35 | @IBAction func skype_clicked(_ sender: Any) { 36 | 37 | } 38 | 39 | @IBAction func telegram_clicked(_ sender: Any) { 40 | let appURL = URL(string: "tg://resolve?domain=kbyai") // URL scheme for Telegram app 41 | 42 | if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) { 43 | // If Telegram app is installed, open it to the "Add Contact" screen 44 | UIApplication.shared.open(appURL, options: [:], completionHandler: nil) 45 | } else { 46 | let username = "kbyai" 47 | let telegramURL = URL(string: "https://t.me/\(username)")! 48 | UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil) 49 | } 50 | } 51 | 52 | @IBAction func whatsapp_clicked(_ sender: Any) { 53 | let appURL = URL(string: "whatsapp://send?phone=+19092802609") // URL scheme for Telegram app 54 | 55 | if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) { 56 | // If Telegram app is installed, open it to the "Add Contact" screen 57 | UIApplication.shared.open(appURL, options: [:], completionHandler: nil) 58 | } else { 59 | let username = "+19092802609" 60 | let telegramURL = URL(string: "https://wa.me/\(username)")! 61 | UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil) 62 | } 63 | } 64 | 65 | @IBAction func github_clicked(_ sender: Any) { 66 | let telegramURL = URL(string: "https://github.com/kby-ai")! 67 | UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil) 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /FaceLivenessDetection/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | import CoreData 4 | 5 | @main 6 | class AppDelegate: UIResponder, UIApplicationDelegate { 7 | 8 | 9 | 10 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 11 | // Override point for customization after application launch. 12 | return true 13 | } 14 | 15 | // MARK: UISceneSession Lifecycle 16 | 17 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 18 | // Called when a new scene session is being created. 19 | // Use this method to select a configuration to create the new scene with. 20 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 21 | } 22 | 23 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 24 | // Called when the user discards a scene session. 25 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 26 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 27 | } 28 | 29 | // MARK: - Core Data stack 30 | 31 | lazy var persistentContainer: NSPersistentContainer = { 32 | /* 33 | The persistent container for the application. This implementation 34 | creates and returns a container, having loaded the store for the 35 | application to it. This property is optional since there are legitimate 36 | error conditions that could cause the creation of the store to fail. 37 | */ 38 | let container = NSPersistentContainer(name: "FaceLivenessDetection") 39 | container.loadPersistentStores(completionHandler: { (storeDescription, error) in 40 | if let error = error as NSError? { 41 | // Replace this implementation with code to handle the error appropriately. 42 | // 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. 43 | 44 | /* 45 | Typical reasons for an error here include: 46 | * The parent directory does not exist, cannot be created, or disallows writing. 47 | * The persistent store is not accessible, due to permissions or data protection when the device is locked. 48 | * The device is out of space. 49 | * The store could not be migrated to the current model version. 50 | Check the error message to determine what the actual problem was. 51 | */ 52 | fatalError("Unresolved error \(error), \(error.userInfo)") 53 | } 54 | }) 55 | return container 56 | }() 57 | 58 | // MARK: - Core Data Saving support 59 | 60 | func saveContext () { 61 | let context = persistentContainer.viewContext 62 | if context.hasChanges { 63 | do { 64 | try context.save() 65 | } catch { 66 | // Replace this implementation with code to handle the error appropriately. 67 | // 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. 68 | let nserror = error as NSError 69 | fatalError("Unresolved error \(nserror), \(nserror.userInfo)") 70 | } 71 | } 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/.DS_Store -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@2x.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/clr_main_button_bg1.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0x8B", 9 | "green" : "0x37", 10 | "red" : "0x4F" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0x8B", 27 | "green" : "0x37", 28 | "red" : "0x4F" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/clr_main_button_bg2.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "1.000", 9 | "green" : "0.867", 10 | "red" : "0.918" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "1.000", 27 | "green" : "0.867", 28 | "red" : "0.918" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_github.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_github.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_github 1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_github 2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 1.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github 2.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_github.imageset/ic_github.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_kby.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_kby 1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_kby 2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 1.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby 2.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_kby.imageset/ic_kby.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_skype.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_skype 1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_skype 2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 1.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype 2.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_skype.imageset/ic_skype.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_telegram.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_telegram 1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_telegram 2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 1.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram 2.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_telegram.imageset/ic_telegram.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_whatsapp.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_whatsapp 1.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_whatsapp 2.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 1.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp 2.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/FaceLivenessDetection/Assets.xcassets/ic_whatsapp.imageset/ic_whatsapp.png -------------------------------------------------------------------------------- /FaceLivenessDetection/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /FaceLivenessDetection/CameraViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AVFoundation 3 | 4 | class CameraViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate{ 5 | 6 | static let LIVENESS_THRESHOLD = Float(0.7) 7 | 8 | @IBOutlet weak var cameraView: UIView! 9 | @IBOutlet weak var faceView: FaceView! 10 | 11 | override func viewDidLoad() { 12 | super.viewDidLoad() 13 | // Do any additional setup after loading the view. 14 | 15 | cameraView.translatesAutoresizingMaskIntoConstraints = true 16 | cameraView.frame = view.bounds 17 | 18 | faceView.translatesAutoresizingMaskIntoConstraints = true 19 | faceView.frame = view.bounds 20 | 21 | startCamera() 22 | } 23 | 24 | func startCamera() { 25 | let defaults = UserDefaults.standard 26 | let cameraLens_val = defaults.integer(forKey: "camera_lens") 27 | var cameraLens = AVCaptureDevice.Position.front 28 | if(cameraLens_val == 0) { 29 | cameraLens = AVCaptureDevice.Position.back 30 | } 31 | 32 | // Create an AVCaptureSession 33 | let session = AVCaptureSession() 34 | session.sessionPreset = .high 35 | 36 | // Create an AVCaptureDevice for the camera 37 | let device = AVCaptureDevice.default(for: .video) 38 | 39 | guard let videoDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: cameraLens) else { return } 40 | guard let input = try? AVCaptureDeviceInput(device: videoDevice) else { return } 41 | if session.canAddInput(input) { 42 | session.addInput(input) 43 | } 44 | 45 | // Create an AVCaptureVideoDataOutput 46 | let videoOutput = AVCaptureVideoDataOutput() 47 | 48 | // Set the video output's delegate and queue for processing video frames 49 | videoOutput.setSampleBufferDelegate(self, queue: DispatchQueue.global(qos: .default)) 50 | 51 | // Add the video output to the session 52 | session.addOutput(videoOutput) 53 | 54 | let previewLayer = AVCaptureVideoPreviewLayer(session: session) 55 | previewLayer.videoGravity = .resizeAspectFill 56 | previewLayer.frame = view.bounds 57 | cameraView.layer.addSublayer(previewLayer) 58 | 59 | // Start the session 60 | session.startRunning() 61 | } 62 | 63 | func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) { 64 | 65 | guard let pixelBuffer: CVPixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { return } 66 | 67 | CVPixelBufferLockBaseAddress(pixelBuffer, CVPixelBufferLockFlags.readOnly) 68 | let ciImage = CIImage(cvPixelBuffer: pixelBuffer) 69 | 70 | let context = CIContext() 71 | let cgImage = context.createCGImage(ciImage, from: ciImage.extent) 72 | let image = UIImage(cgImage: cgImage!) 73 | CVPixelBufferUnlockBaseAddress(pixelBuffer, CVPixelBufferLockFlags.readOnly) 74 | 75 | // Rotate and flip the image 76 | var capturedImage = image.rotate(radians: .pi/2) 77 | let defaults = UserDefaults.standard 78 | let cameraLens_val = defaults.integer(forKey: "camera_lens") 79 | if(cameraLens_val == 1) { 80 | capturedImage = capturedImage.flipHorizontally() 81 | } 82 | 83 | let faceBoxes = FaceSDK.faceDetection(capturedImage) 84 | DispatchQueue.main.sync { 85 | self.faceView.setFrameSize(frameSize: capturedImage.size) 86 | self.faceView.setFaceBoxes(faceBoxes: faceBoxes) 87 | } 88 | } 89 | 90 | 91 | @IBAction func done_clicked(_ sender: Any) { 92 | if let vc = self.presentingViewController as? ViewController { 93 | self.dismiss(animated: true, completion: nil) 94 | } 95 | } 96 | } 97 | 98 | -------------------------------------------------------------------------------- /FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | FaceLivenessDetection.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /FaceLivenessDetection/FaceLivenessDetection.xcdatamodeld/FaceLivenessDetection.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /FaceLivenessDetection/FaceView.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class FaceView: UIView { 4 | 5 | var faceBoxes: NSMutableArray? = nil 6 | var frameSize: CGSize? 7 | 8 | public func setFaceBoxes(faceBoxes: NSMutableArray) { 9 | self.faceBoxes = faceBoxes 10 | setNeedsDisplay() 11 | } 12 | 13 | public func setFrameSize(frameSize: CGSize) { 14 | self.frameSize = frameSize 15 | } 16 | 17 | // Only override draw() if you perform custom drawing. 18 | // An empty implementation adversely affects performance during animation. 19 | override func draw(_ rect: CGRect) { 20 | 21 | guard let context = UIGraphicsGetCurrentContext() else { 22 | return 23 | } 24 | 25 | let defaults = UserDefaults.standard 26 | let livenessThreshold = defaults.float(forKey: "liveness_threshold") 27 | 28 | if(self.frameSize != nil) { 29 | context.beginPath() 30 | 31 | let x_scale = self.frameSize!.width / self.bounds.width 32 | let y_scale = self.frameSize!.height / self.bounds.height 33 | 34 | for faceBox in (faceBoxes! as NSArray as! [FaceBox]) { 35 | var color = UIColor.green 36 | var string = "REAL " + String(format: "%.3f", faceBox.liveness) 37 | if(faceBox.liveness < livenessThreshold) { 38 | color = UIColor.red 39 | string = "SPOOF " + String(format: "%.3f", faceBox.liveness) 40 | } 41 | 42 | context.setStrokeColor(color.cgColor) 43 | context.setLineWidth(2.0) 44 | 45 | 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)) 46 | context.addRect(scaledRect) 47 | 48 | let attributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 20), 49 | NSAttributedString.Key.foregroundColor: color] 50 | string.draw(at: CGPoint(x: CGFloat(scaledRect.minX + 5), y: CGFloat(scaledRect.minY - 25)), withAttributes: attributes) 51 | 52 | context.strokePath() 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /FaceLivenessDetection/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIApplicationSceneManifest 6 | 7 | UIApplicationSupportsMultipleScenes 8 | 9 | UISceneConfigurations 10 | 11 | UIWindowSceneSessionRoleApplication 12 | 13 | 14 | UISceneConfigurationName 15 | Default Configuration 16 | UISceneDelegateClassName 17 | $(PRODUCT_MODULE_NAME).SceneDelegate 18 | UISceneStoryboardFile 19 | Main 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /FaceLivenessDetection/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 4 | 5 | var window: UIWindow? 6 | 7 | 8 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 9 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 10 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 11 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 12 | guard let _ = (scene as? UIWindowScene) else { return } 13 | } 14 | 15 | func sceneDidDisconnect(_ scene: UIScene) { 16 | // Called as the scene is being released by the system. 17 | // This occurs shortly after the scene enters the background, or when its session is discarded. 18 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 19 | // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). 20 | } 21 | 22 | func sceneDidBecomeActive(_ scene: UIScene) { 23 | // Called when the scene has moved from an inactive state to an active state. 24 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 25 | } 26 | 27 | func sceneWillResignActive(_ scene: UIScene) { 28 | // Called when the scene will move from an active state to an inactive state. 29 | // This may occur due to temporary interruptions (ex. an incoming phone call). 30 | } 31 | 32 | func sceneWillEnterForeground(_ scene: UIScene) { 33 | // Called as the scene transitions from the background to the foreground. 34 | // Use this method to undo the changes made on entering the background. 35 | } 36 | 37 | func sceneDidEnterBackground(_ scene: UIScene) { 38 | // Called as the scene transitions from the foreground to the background. 39 | // Use this method to save data, release shared resources, and store enough scene-specific state information 40 | // to restore the scene back to its current state. 41 | 42 | // Save changes in the application's managed object context when the application transitions to the background. 43 | (UIApplication.shared.delegate as? AppDelegate)?.saveContext() 44 | } 45 | 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /FaceLivenessDetection/SettingsViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AVFoundation 3 | 4 | class SettingsViewController: UIViewController{ 5 | 6 | static let CAMERA_LENS_DEFAULT = 1 7 | static let LIVENESS_THRESHOLD_DEFAULT = Float(0.7) 8 | 9 | 10 | @IBOutlet weak var cameraLensSwitch: UISwitch! 11 | @IBOutlet weak var livenessThresholdLbl: UILabel! 12 | @IBOutlet weak var cameraLensLbl: UILabel! 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | // Do any additional setup after loading the view. 17 | 18 | let defaults = UserDefaults.standard 19 | let cameraLens = defaults.integer(forKey: "camera_lens") 20 | 21 | if(cameraLens == 0) { 22 | cameraLensSwitch.isOn = false 23 | cameraLensLbl.text = "Back" 24 | } else { 25 | cameraLensSwitch.isOn = true 26 | cameraLensLbl.text = "Front" 27 | } 28 | 29 | let livenessThreshold = defaults.float(forKey: "liveness_threshold") 30 | livenessThresholdLbl.text = String(livenessThreshold) 31 | } 32 | 33 | static func setDefaultSettings() { 34 | let defaults = UserDefaults.standard 35 | let defaultChanged = defaults.bool(forKey: "default_changed") 36 | if(defaultChanged == false) { 37 | defaults.set(true, forKey: "default_changed") 38 | 39 | defaults.set(SettingsViewController.CAMERA_LENS_DEFAULT, forKey: "camera_lens") 40 | defaults.set(SettingsViewController.LIVENESS_THRESHOLD_DEFAULT, forKey: "liveness_threshold") 41 | } 42 | } 43 | 44 | @IBAction func done_clicked(_ sender: Any) { 45 | if let vc = self.presentingViewController as? ViewController { 46 | self.dismiss(animated: true, completion: nil) 47 | } 48 | } 49 | 50 | @IBAction func cameraLens_switch(_ sender: Any) { 51 | let defaults = UserDefaults.standard 52 | if(cameraLensSwitch.isOn) { 53 | defaults.set(1, forKey: "camera_lens") 54 | cameraLensLbl.text = "Front" 55 | } else { 56 | defaults.set(0, forKey: "camera_lens") 57 | cameraLensLbl.text = "Back" 58 | } 59 | } 60 | 61 | 62 | @IBAction func livenessThreshold_clicked(_ sender: Any) { 63 | 64 | let title = "Liveness threshold" 65 | let alertController = UIAlertController(title: title, message: "Please input a number between 0 and 1.", preferredStyle: .alert) 66 | 67 | var minimum = Float(0) 68 | var maximum = Float(1) 69 | alertController.addTextField { (textField) in 70 | textField.keyboardType = .decimalPad 71 | 72 | let defaults = UserDefaults.standard 73 | textField.text = String(defaults.float(forKey: "liveness_threshold")) 74 | } 75 | 76 | let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) 77 | 78 | let submitAction = UIAlertAction(title: "Ok", style: .default) { (action) in 79 | 80 | var hasError = false 81 | var errorStr = "" 82 | let defaults = UserDefaults.standard 83 | 84 | if let numberString = alertController.textFields?.first?.text, let number = Float(numberString) { 85 | if(number < Float(minimum) || number > Float(maximum)) { 86 | hasError = true 87 | errorStr = "Invalid value" 88 | } else { 89 | self.livenessThresholdLbl.text = String(number) 90 | defaults.set(number, forKey: "liveness_threshold") 91 | } 92 | } else { 93 | hasError = true 94 | errorStr = "Invalid value" 95 | } 96 | 97 | if(hasError) { 98 | let errorNotification = UIAlertController(title: "Error", message: errorStr, preferredStyle: .alert) 99 | let okAction = UIAlertAction(title: "OK", style: .default, handler: nil) 100 | errorNotification.addAction(okAction) 101 | self.present(errorNotification, animated: true, completion: nil) 102 | 103 | DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { 104 | errorNotification.dismiss(animated: true, completion: nil) 105 | } 106 | } 107 | } 108 | 109 | alertController.addAction(cancelAction) 110 | alertController.addAction(submitAction) 111 | 112 | present(alertController, animated: true, completion: nil) 113 | } 114 | } 115 | 116 | -------------------------------------------------------------------------------- /FaceLivenessDetection/UIImageExtension.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | 5 | public extension UIImage { 6 | 7 | func cropFace(faceBox: FaceBox) -> UIImage? { 8 | let centerX = Int((faceBox.x1 + faceBox.x2) / 2) 9 | let centerY = Int((faceBox.y1 + faceBox.y2) / 2) 10 | let cropWidth = Int(Float(faceBox.x2 - faceBox.x1) * Float(1.4)) 11 | 12 | let cropX1 = Int(Float(centerX) - Float(cropWidth / 2)) 13 | let cropX2 = Int(Float(centerY) - Float(cropWidth / 2)) 14 | let cropRect = CGRect(x: CGFloat(cropX1), y: CGFloat(cropX2), width: CGFloat(cropWidth), height: CGFloat(cropWidth)) 15 | 16 | guard let croppedImage = self.cgImage!.cropping(to: cropRect) else { return nil } 17 | 18 | let faceImage = UIImage(cgImage: croppedImage) 19 | 20 | let renderer = UIGraphicsImageRenderer(size: CGSize(width: 150, height: 150)) 21 | let newImage = renderer.image { (context) in 22 | faceImage.draw(in: CGRect(origin: .zero, size: CGSize(width: 150, height: 150))) 23 | } 24 | return newImage 25 | } 26 | 27 | /// Extension to fix orientation of an UIImage without EXIF 28 | func fixOrientation() -> UIImage { 29 | 30 | guard let cgImage = cgImage else { return self } 31 | 32 | if imageOrientation == .up { return self } 33 | 34 | var transform = CGAffineTransform.identity 35 | 36 | switch imageOrientation { 37 | 38 | case .down, .downMirrored: 39 | transform = transform.translatedBy(x: size.width, y: size.height) 40 | transform = transform.rotated(by: CGFloat(Double.pi)) 41 | 42 | case .left, .leftMirrored: 43 | transform = transform.translatedBy(x: size.width, y: 0) 44 | transform = transform.rotated(by: CGFloat(Double.pi/2)) 45 | 46 | case .right, .rightMirrored: 47 | transform = transform.translatedBy(x: 0, y : size.height) 48 | transform = transform.rotated(by: CGFloat(-Double.pi/2)) 49 | 50 | case .up, .upMirrored: 51 | break 52 | } 53 | 54 | switch imageOrientation { 55 | 56 | case .upMirrored, .downMirrored: 57 | transform.translatedBy(x: size.width, y: 0) 58 | transform.scaledBy(x: -1, y: 1) 59 | 60 | case .leftMirrored, .rightMirrored: 61 | transform.translatedBy(x: size.height, y: 0) 62 | transform.scaledBy(x: -1, y: 1) 63 | 64 | case .up, .down, .left, .right: 65 | break 66 | } 67 | 68 | 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) { 69 | 70 | ctx.concatenate(transform) 71 | 72 | switch imageOrientation { 73 | 74 | case .left, .leftMirrored, .right, .rightMirrored: 75 | ctx.draw(cgImage, in: CGRect(x: 0, y: 0, width: size.height, height: size.width)) 76 | 77 | default: 78 | ctx.draw(cgImage, in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) 79 | } 80 | 81 | if let finalImage = ctx.makeImage() { 82 | return (UIImage(cgImage: finalImage)) 83 | } 84 | } 85 | 86 | // something failed -- return original 87 | return self 88 | } 89 | 90 | func rotate(radians: CGFloat) -> UIImage { 91 | let rotatedSize = CGRect(origin: .zero, size: size) 92 | .applying(CGAffineTransform(rotationAngle: radians)) 93 | .integral.size 94 | UIGraphicsBeginImageContext(rotatedSize) 95 | if let context = UIGraphicsGetCurrentContext() { 96 | context.translateBy(x: rotatedSize.width / 2, y: rotatedSize.height / 2) 97 | context.rotate(by: radians) 98 | draw(in: CGRect(x: -size.width / 2, y: -size.height / 2, width: size.width, height: size.height)) 99 | let rotatedImage = UIGraphicsGetImageFromCurrentImageContext() 100 | UIGraphicsEndImageContext() 101 | return rotatedImage ?? self 102 | } 103 | return self 104 | } 105 | 106 | // Extension to flip UIImage horizontally 107 | func flipHorizontally() -> UIImage { 108 | UIGraphicsBeginImageContextWithOptions(size, false, scale) 109 | let context = UIGraphicsGetCurrentContext()! 110 | context.translateBy(x: size.width, y: 0) 111 | context.scaleBy(x: -1.0, y: 1.0) 112 | draw(in: CGRect(origin: .zero, size: size)) 113 | let flippedImage = UIGraphicsGetImageFromCurrentImageContext()! 114 | UIGraphicsEndImageContext() 115 | return flippedImage 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /FaceLivenessDetection/ViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import AVFoundation 3 | 4 | class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate{ 5 | 6 | @IBOutlet weak var warningLbl: UILabel! 7 | @IBOutlet weak var resultLbl: UILabel! 8 | @IBOutlet weak var imageView: UIImageView! 9 | 10 | @IBOutlet weak var cameraBtnView: UIView! 11 | @IBOutlet weak var imageBtnView: UIView! 12 | @IBOutlet weak var settingsBtnView: UIView! 13 | @IBOutlet weak var aboutBtnView: UIView! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | // Do any additional setup after loading the view. 18 | 19 | var ret = FaceSDK.setActivation("YCRClDhC0+CoonKUL3FxV2Mz5228DbAOkpKXh31Mr1n1FShBllIhXqxpKGi6mdYbP37jJZu1jzvJ" + 20 | "PMQBKdh43TnonqRk7qXKiLI+AZM4GcTUoWJ62OnVO7Zdq1h+o4IVgn79dTDVBjrlDvM9AxTEkRd1" + 21 | "UUQkH9DIX2+oALcNsNDofLJr1aX7C4si4yb0A9GFUaEdPWZh6pNLqO4Pq7Yn2alyh+5v/qomI/9G" + 22 | "kQWmzVym66Su1fmnb8qVPG9anuNYk2Shd1SijMY5Ti4lServck/q91fD8v49bNBC9FN/KiAyUMcc" + 23 | "WYqcSezgguSI0YIrrC/PpA/zVzc9mKjNhikEwQ==") 24 | 25 | if(ret == SDK_SUCCESS.rawValue) { 26 | ret = FaceSDK.initSDK() 27 | } 28 | 29 | if(ret != SDK_SUCCESS.rawValue) { 30 | warningLbl.isHidden = false 31 | 32 | if(ret == SDK_LICENSE_KEY_ERROR.rawValue) { 33 | warningLbl.text = "Invalid license!" 34 | } else if(ret == SDK_LICENSE_APPID_ERROR.rawValue) { 35 | warningLbl.text = "Invalid license!" 36 | } else if(ret == SDK_LICENSE_EXPIRED.rawValue) { 37 | warningLbl.text = "License expired!" 38 | } else if(ret == SDK_NO_ACTIVATED.rawValue) { 39 | warningLbl.text = "No activated!" 40 | } else if(ret == SDK_INIT_ERROR.rawValue) { 41 | warningLbl.text = "Init error!" 42 | } 43 | } 44 | 45 | SettingsViewController.setDefaultSettings() 46 | } 47 | 48 | @IBAction func camera_touch_down(_ sender: Any) { 49 | UIView.animate(withDuration: 0.5) { 50 | self.cameraBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color 51 | } 52 | } 53 | 54 | @IBAction func camera_touch_cancel(_ sender: Any) { 55 | UIView.animate(withDuration: 0.5) { 56 | self.cameraBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 57 | } 58 | } 59 | 60 | @IBAction func camera_clicked(_ sender: Any) { 61 | UIView.animate(withDuration: 0.5) { 62 | self.cameraBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 63 | } 64 | 65 | performSegue(withIdentifier: "camera", sender: self) 66 | } 67 | 68 | 69 | @IBAction func image_touch_down(_ sender: Any) { 70 | UIView.animate(withDuration: 0.5) { 71 | self.imageBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color 72 | } 73 | } 74 | 75 | @IBAction func image_touch_up(_ sender: Any) { 76 | UIView.animate(withDuration: 0.5) { 77 | self.imageBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 78 | } 79 | } 80 | 81 | @IBAction func image_clicked(_ sender: Any) { 82 | UIView.animate(withDuration: 0.5) { 83 | self.imageBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 84 | } 85 | 86 | let imagePicker = UIImagePickerController() 87 | imagePicker.sourceType = .photoLibrary 88 | imagePicker.delegate = self 89 | present(imagePicker, animated: true, completion: nil) 90 | } 91 | 92 | 93 | @IBAction func settings_touch_down(_ sender: Any) { 94 | UIView.animate(withDuration: 0.5) { 95 | self.settingsBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color 96 | } 97 | } 98 | 99 | 100 | @IBAction func settings_touch_up(_ sender: Any) { 101 | UIView.animate(withDuration: 0.5) { 102 | self.settingsBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 103 | } 104 | } 105 | 106 | @IBAction func settings_clicked(_ sender: Any) { 107 | UIView.animate(withDuration: 0.5) { 108 | self.settingsBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 109 | } 110 | 111 | performSegue(withIdentifier: "settings", sender: self) 112 | } 113 | 114 | @IBAction func about_touch_down(_ sender: Any) { 115 | UIView.animate(withDuration: 0.5) { 116 | self.aboutBtnView.backgroundColor = UIColor(named: "clr_main_button_bg2") // Change to desired color 117 | } 118 | } 119 | 120 | 121 | @IBAction func about_touch_up(_ sender: Any) { 122 | UIView.animate(withDuration: 0.5) { 123 | self.aboutBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 124 | } 125 | } 126 | 127 | @IBAction func about_clicked(_ sender: Any) { 128 | UIView.animate(withDuration: 0.5) { 129 | self.aboutBtnView.backgroundColor = UIColor(named: "clr_main_button_bg1") // Change to desired color 130 | } 131 | 132 | performSegue(withIdentifier: "about", sender: self) 133 | } 134 | 135 | @IBAction func brand_clicked(_ sender: Any) { 136 | let webURL = URL(string: "https://kby-ai.com") 137 | UIApplication.shared.open(webURL!, options: [:], completionHandler: nil) 138 | } 139 | 140 | 141 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { 142 | 143 | dismiss(animated: true, completion: nil) 144 | 145 | guard let image = info[.originalImage] as? UIImage else { 146 | return 147 | } 148 | 149 | let fixed_image = image.fixOrientation() 150 | imageView.image = fixed_image 151 | 152 | let faceBoxes = FaceSDK.faceDetection(fixed_image) 153 | if(faceBoxes.count == 0) { 154 | resultLbl.text = "No face" 155 | resultLbl.textColor = UIColor.red 156 | return 157 | } 158 | 159 | 160 | let defaults = UserDefaults.standard 161 | let livenessThreshold = defaults.float(forKey: "liveness_threshold") 162 | 163 | let faceBox = faceBoxes[0] as! FaceBox 164 | if(faceBox.liveness < livenessThreshold) { 165 | resultLbl.text = "SPOOF, Score: " + String(format: "%.3f", faceBox.liveness) 166 | resultLbl.textColor = UIColor.red 167 | } else { 168 | resultLbl.text = "REAL, Score: " + String(format: "%.3f", faceBox.liveness) 169 | resultLbl.textColor = UIColor.green 170 | } 171 | } 172 | 173 | func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { 174 | dismiss(animated: true, completion: nil) 175 | } 176 | } 177 | 178 | -------------------------------------------------------------------------------- /FaceLivenessDetectionTests/FaceLivenessDetectionTests.swift: -------------------------------------------------------------------------------- 1 | 2 | import XCTest 3 | @testable import FaceLivenessDetection 4 | 5 | final class FaceLivenessDetectionTests: XCTestCase { 6 | 7 | override func setUpWithError() throws { 8 | // Put setup code here. This method is called before the invocation of each test method in the class. 9 | } 10 | 11 | override func tearDownWithError() throws { 12 | // Put teardown code here. This method is called after the invocation of each test method in the class. 13 | } 14 | 15 | func testExample() throws { 16 | // This is an example of a functional test case. 17 | // Use XCTAssert and related functions to verify your tests produce the correct results. 18 | // Any test you write for XCTest can be annotated as throws and async. 19 | // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. 20 | // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. 21 | } 22 | 23 | func testPerformanceExample() throws { 24 | // This is an example of a performance test case. 25 | self.measure { 26 | // Put the code you want to measure the time of here. 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /FaceLivenessDetectionUITests/FaceLivenessDetectionUITests.swift: -------------------------------------------------------------------------------- 1 | 2 | import XCTest 3 | 4 | final class FaceLivenessDetectionUITests: XCTestCase { 5 | 6 | override func setUpWithError() throws { 7 | // Put setup code here. This method is called before the invocation of each test method in the class. 8 | 9 | // In UI tests it is usually best to stop immediately when a failure occurs. 10 | continueAfterFailure = false 11 | 12 | // 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. 13 | } 14 | 15 | override func tearDownWithError() throws { 16 | // Put teardown code here. This method is called after the invocation of each test method in the class. 17 | } 18 | 19 | func testExample() throws { 20 | // UI tests must launch the application that they test. 21 | let app = XCUIApplication() 22 | app.launch() 23 | 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testLaunchPerformance() throws { 28 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { 29 | // This measures how long it takes to launch your application. 30 | measure(metrics: [XCTApplicationLaunchMetric()]) { 31 | XCUIApplication().launch() 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /FaceLivenessDetectionUITests/FaceLivenessDetectionUITestsLaunchTests.swift: -------------------------------------------------------------------------------- 1 | 2 | import XCTest 3 | 4 | final class FaceLivenessDetectionUITestsLaunchTests: XCTestCase { 5 | 6 | override class var runsForEachTargetApplicationUIConfiguration: Bool { 7 | true 8 | } 9 | 10 | override func setUpWithError() throws { 11 | continueAfterFailure = false 12 | } 13 | 14 | func testLaunch() throws { 15 | let app = XCUIApplication() 16 | app.launch() 17 | 18 | // Insert steps here to perform after app launch but before taking a screenshot, 19 | // such as logging into a test account or navigating somewhere in the app 20 | 21 | let attachment = XCTAttachment(screenshot: app.screenshot()) 22 | attachment.name = "Launch Screen" 23 | attachment.lifetime = .keepAlways 24 | add(attachment) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 |

6 | 7 | ### Our facial recognition algorithm is globally top-ranked by NIST in the FRVT 1:1 leaderboards. badge 8 | [Latest NIST FRVT evaluation report 2024-12-20](https://pages.nist.gov/frvt/html/frvt11.html) 9 | 10 | ![FRVT Sheet](https://github.com/user-attachments/assets/16b4cee2-3a91-453f-94e0-9e81262393d7) 11 | 12 | #### 🆔 ID Document Liveness Detection - Linux - [Here](https://web.kby-ai.com) badge 13 | #### 🤗 Hugging Face - [Here](https://huggingface.co/kby-ai) 14 | #### 📚 Product & Resources - [Here](https://github.com/kby-ai/Product) 15 | #### 🛟 Help Center - [Here](https://docs.kby-ai.com) 16 | #### 💼 KYC Verification Demo - [Here](https://github.com/kby-ai/KYC-Verification-Demo-Android) 17 | #### 🙋‍♀️ Docker Hub - [Here](https://hub.docker.com/u/kbyai) 18 | 19 | # FaceLivenessDetection-iOS 20 | 21 | ## Overview 22 | This repository showcases real-time `face liveness detection` technology on `iOS` device. 23 | 24 | > In this repository, we integrated `KBY-AI`'s face liveness(face anti-spoofing) solution into `iOS` platform. 25 | 26 | ### ◾FaceSDK(Mobile) Details 27 | 28 | | 🔽Basic | Standard | Premium | 29 | |------------------|------------------|------------------| 30 | | Face Detection | Face Detection | Face Detection | 31 | | Face Liveness Detection | Face Liveness Detection | Face Liveness Detection | 32 | | Pose Estimation | Pose Estimation | Pose Estimation | 33 | | | Face Recognition | Face Recognition | 34 | | | | 68 points Face Landmark Detection | 35 | | | | Face Quality Calculation | 36 | | | | Face Occlusion Detection | 37 | | | | Eye Closure Detection | 38 | | | | Age, Gender Estimation | 39 | 40 | ### ◾FaceSDK(Mobile) Product List 41 | | No. | Repository | SDK Details | 42 | |------------------|------------------|------------------| 43 | | 1 | [Face Liveness Detection - Android](https://github.com/kby-ai/FaceLivenessDetection-Android) | Basic SDK | 44 | | ➡️ | [Face Liveness Detection - iOS](https://github.com/kby-ai/FaceLivenessDetection-iOS) | Basic SDK | 45 | | 3 | [Face Recognition + Face Liveness Detection - Android](https://github.com/kby-ai/FaceRecognition-Android) | Standard SDK | 46 | | 4 | [Face Recognition + Face Liveness Detection - iOS](https://github.com/kby-ai/FaceRecognition-iOS) | Standard SDK | 47 | | 5 | [Face Recognition + Face Liveness Detection - Flutter](https://github.com/kby-ai/FaceRecognition-Flutter) | Standard SDK | 48 | | 6 | [Face Recognition + Face Liveness Detection - Ionic-Cordova](https://github.com/kby-ai/FaceRececogniion-Ionic-Cordova) | Standard SDK | 49 | | 7 | [Face Recognition + Face Liveness Detection - React-Native](https://github.com/kby-ai/FaceRecognition-React-Native) | Standard SDK | 50 | | 8 | [Face Attribute - Android](https://github.com/kby-ai/FaceAttribute-Android) | Premium SDK | 51 | | 9 | [Face Attribute - iOS](https://github.com/kby-ai/FaceAttribute-iOS) | Premium SDK | 52 | | 10 | [Face Attribute - Flutter](https://github.com/kby-ai/FaceAttribute-Flutter) | Premium SDK | 53 | 54 | 55 | > To get `Face SDK(server)`, please visit products [here](https://github.com/kby-ai/Product).
56 | 57 | ## Download on the App Store 58 | 59 | 60 | 61 | 62 | 63 | ## Performance Video 64 | 65 | You can visit our YouTube video [here](https://www.youtube.com/watch?v=qOAlsq6uba0) to see how well our demo app works.

66 | [![Face Recognition Android](https://img.youtube.com/vi/qOAlsq6uba0/0.jpg)](https://www.youtube.com/watch?v=qOAlsq6uba0) 67 | 68 | ## Screenshots 69 | 70 |

71 | 72 | 73 |

74 | 75 |

76 | 77 | 78 |

79 | 80 | ## SDK License 81 | 82 | This project uses `KBY-AI`'s liveness detection SDK. The SDK requires a license per `bundle ID`. 83 | 84 | - The code below shows how to use the license: https://github.com/kby-ai/FaceLivenessDetection-iOS/blob/ff6722b7946797f0c9f2314f88eb43a96ac59f57/FaceLivenessDetection/ViewController.swift#L18-L27 85 | 86 | - To request a license, please contact us:
87 | 🧙`Email:` contact@kby-ai.com
88 | 🧙`Telegram:` [@kbyai](https://t.me/kbyai)
89 | 🧙`WhatsApp:` [+19092802609](https://wa.me/+19092802609)
90 | 🧙`Discord:` [KBY-AI](https://discord.gg/CgHtWQ3k9T)
91 | 🧙`Teams:` [KBY-AI](https://teams.live.com/l/invite/FBAYGB1-IlXkuQM3AY)
92 | 93 | ## About SDK 94 | 95 | ### Set up 96 | 1. Copy the SDK (`facesdk.framework` folder) to the `root` folder in your project. 97 | 98 | 2. Add `SDK framework` to the project in `Xcode`. 99 | 100 | > Project Navigator -> General -> Frameworks, Libraries, and Embedded Content 101 | 102 | ![image](https://user-images.githubusercontent.com/125717930/231925359-ef30b3c0-d2d9-4b32-ae57-80b42b021b91.png) 103 | 104 | 3. Add the bridging header to your project settings 105 | 106 | > Project Navigator -> Build Settings -> Swift Compiler - General 107 | 108 | ![image](https://user-images.githubusercontent.com/125717930/231926873-6a510b63-209a-480f-8486-ec11b1962613.png) 109 | 110 | 111 | ### Initializing an SDK 112 | 113 | - Step One 114 | 115 | To begin, you need to activate the SDK using the license that you have received. 116 | ```swift 117 | FaceSDK.setActivation("...") 118 | ``` 119 | 120 | If activation is successful, the return value will be `SDK_SUCCESS`. Otherwise, an error value will be returned. 121 | 122 | - Step Two 123 | 124 | After activation, call the `SDK`'s initialization function. 125 | ```swift 126 | FaceSDK.initSDK() 127 | ``` 128 | If initialization is successful, the return value will be `SDK_SUCCESS`. Otherwise, an error value will be returned. 129 | 130 | ### Face Detection and Liveness Detection 131 | 132 | The `FaceSDK` offers a single function for detecting face and liveness detection, which can be used as follows: 133 | ```swift 134 | let faceBoxes = FaceSDK.faceDetection(image) 135 | ``` 136 | 137 | https://github.com/kby-ai/FaceLivenessDetection-iOS/blob/ff6722b7946797f0c9f2314f88eb43a96ac59f57/FaceLivenessDetection/CameraViewController.swift#L62-L78 138 | 139 | This function takes a single parameter, which is a `UIImage` object. 140 | The return value of the function is a list of `FaceBox` objects. 141 | Each `FaceBox` object contains the detected face rectangle, liveness score, and facial angles such as `yaw`, `roll`, and `pitch`. 142 | 143 | -------------------------------------------------------------------------------- /facesdk.framework/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/facesdk.framework/.DS_Store -------------------------------------------------------------------------------- /facesdk.framework/Headers/facesdk.h: -------------------------------------------------------------------------------- 1 | // 2 | // facesdk.h 3 | // facesdk 4 | // 5 | // Created by user on 4/12/23. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for facesdk. 11 | FOUNDATION_EXPORT double facesdkVersionNumber; 12 | 13 | //! Project version string for facesdk. 14 | FOUNDATION_EXPORT const unsigned char facesdkVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | #include "facesdk_api.h" 20 | -------------------------------------------------------------------------------- /facesdk.framework/Headers/facesdk_api.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | NS_ASSUME_NONNULL_BEGIN 5 | 6 | enum SDK_ERROR 7 | { 8 | SDK_SUCCESS = 0, 9 | SDK_LICENSE_KEY_ERROR = -1, 10 | SDK_LICENSE_APPID_ERROR = -2, 11 | SDK_LICENSE_EXPIRED = -3, 12 | SDK_NO_ACTIVATED = -4, 13 | SDK_INIT_ERROR = -5, 14 | }; 15 | 16 | @interface FaceBox : NSObject 17 | 18 | @property (nonatomic) int x1; 19 | @property (nonatomic) int y1; 20 | @property (nonatomic) int x2; 21 | @property (nonatomic) int y2; 22 | @property (nonatomic) float liveness; 23 | @property (nonatomic) float yaw; 24 | @property (nonatomic) float roll; 25 | @property (nonatomic) float pitch; 26 | @end 27 | 28 | @interface FaceSDK : NSObject 29 | 30 | +(int) setActivation: (NSString*) license; 31 | +(int) initSDK; 32 | +(NSMutableArray*) faceDetection: (UIImage*) image; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /facesdk.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/facesdk.framework/Info.plist -------------------------------------------------------------------------------- /facesdk.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module facesdk { 2 | umbrella header "facesdk.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /facesdk.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/facesdk.h 8 | 9 | iXedJdnTNjJdkav0lex0htXPBa8= 10 | 11 | Headers/facesdk_api.h 12 | 13 | zk4iCdz2Sm53ZpOzWgV8TlFWgkw= 14 | 15 | Info.plist 16 | 17 | +SvIfsGnFHBVJaHBQiElfACQ340= 18 | 19 | Modules/module.modulemap 20 | 21 | X8zglrv2quSgEMFeVf0TybJa6gA= 22 | 23 | detection.bin 24 | 25 | G52JYi47ACwak8HkEcpkm9zo1as= 26 | 27 | detection.param 28 | 29 | tHFm7ohczZG7KEtACVgRSjX3XIA= 30 | 31 | landmark.bin 32 | 33 | YwuxUSePlqnFEDLD95H35rgexRI= 34 | 35 | landmark.param 36 | 37 | HHZGt8b9GPLjgGplhK/7hcOW0Mo= 38 | 39 | liveness.bin 40 | 41 | qh1obYoGNe0LoyD5JBmUkdeYrEY= 42 | 43 | 44 | files2 45 | 46 | Headers/facesdk.h 47 | 48 | hash2 49 | 50 | CEHWZwXGt6HTp0cWeGAWrhBufzotOw42QLbWl2FjbpE= 51 | 52 | 53 | Headers/facesdk_api.h 54 | 55 | hash2 56 | 57 | yTXovrcbcLOnBMkl4rCZTDWVsJAQx2j5Q2mIw9vYQFw= 58 | 59 | 60 | Modules/module.modulemap 61 | 62 | hash2 63 | 64 | MPLn3hXOxK25/iaEZAyvAIf2qaUvsHUOWkHsaZrg7LY= 65 | 66 | 67 | detection.bin 68 | 69 | hash2 70 | 71 | aSBPVzW2w5vueXMHRoelxdPFfzE45CIHzJJfvcmNVVc= 72 | 73 | 74 | detection.param 75 | 76 | hash2 77 | 78 | yb/QW3dSgGun1LdCqss+oipjB11F0sE0NtewKSJibFo= 79 | 80 | 81 | landmark.bin 82 | 83 | hash2 84 | 85 | q59zkpnecoyeYz1houDmoVK0+ROe2x8l/0dtpqDC9Ic= 86 | 87 | 88 | landmark.param 89 | 90 | hash2 91 | 92 | nkGOHyOPviHWfG8E67n+geJfRcw+yc7qGU4famEpZNc= 93 | 94 | 95 | liveness.bin 96 | 97 | hash2 98 | 99 | 3XjsZ9HffijptH6kD8YcgXR9DwsM2tDsYTNDvdErRkE= 100 | 101 | 102 | 103 | rules 104 | 105 | ^.* 106 | 107 | ^.*\.lproj/ 108 | 109 | optional 110 | 111 | weight 112 | 1000 113 | 114 | ^.*\.lproj/locversion.plist$ 115 | 116 | omit 117 | 118 | weight 119 | 1100 120 | 121 | ^Base\.lproj/ 122 | 123 | weight 124 | 1010 125 | 126 | ^version.plist$ 127 | 128 | 129 | rules2 130 | 131 | .*\.dSYM($|/) 132 | 133 | weight 134 | 11 135 | 136 | ^(.*/)?\.DS_Store$ 137 | 138 | omit 139 | 140 | weight 141 | 2000 142 | 143 | ^.* 144 | 145 | ^.*\.lproj/ 146 | 147 | optional 148 | 149 | weight 150 | 1000 151 | 152 | ^.*\.lproj/locversion.plist$ 153 | 154 | omit 155 | 156 | weight 157 | 1100 158 | 159 | ^Base\.lproj/ 160 | 161 | weight 162 | 1010 163 | 164 | ^Info\.plist$ 165 | 166 | omit 167 | 168 | weight 169 | 20 170 | 171 | ^PkgInfo$ 172 | 173 | omit 174 | 175 | weight 176 | 20 177 | 178 | ^embedded\.provisionprofile$ 179 | 180 | weight 181 | 20 182 | 183 | ^version\.plist$ 184 | 185 | weight 186 | 20 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /facesdk.framework/detection.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/facesdk.framework/detection.bin -------------------------------------------------------------------------------- /facesdk.framework/detection.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 234 255 3 | Input data 0 1 data 0=60 1=60 2=3 4 | Split splitncnn_0 1 4 data data_splitncnn_0 data_splitncnn_1 data_splitncnn_2 data_splitncnn_3 5 | Convolution conv1 1 1 data_splitncnn_3 conv_blob1 0=8 1=3 2=1 3=2 4=1 5=0 6=216 6 | BatchNorm batch_norm1 1 1 conv_blob1 batch_norm_blob1 0=8 7 | Scale bn_scale1 1 1 batch_norm_blob1 batch_norm_blob1_bn_scale1 0=8 1=1 8 | ReLU relu1 1 1 batch_norm_blob1_bn_scale1 relu_blob1 9 | ConvolutionDepthWise conv2 1 1 relu_blob1 conv_blob2 0=8 1=3 2=1 3=1 4=1 5=0 6=72 7=8 10 | BatchNorm batch_norm2 1 1 conv_blob2 batch_norm_blob2 0=8 11 | Scale bn_scale2 1 1 batch_norm_blob2 batch_norm_blob2_bn_scale2 0=8 1=1 12 | ReLU relu2 1 1 batch_norm_blob2_bn_scale2 relu_blob2 13 | Convolution conv3 1 1 relu_blob2 conv_blob3 0=16 1=1 2=1 3=1 4=0 5=0 6=128 14 | BatchNorm batch_norm3 1 1 conv_blob3 batch_norm_blob3 0=16 15 | Scale bn_scale3 1 1 batch_norm_blob3 batch_norm_blob3_bn_scale3 0=16 1=1 16 | ReLU relu3 1 1 batch_norm_blob3_bn_scale3 relu_blob3 17 | ConvolutionDepthWise conv4 1 1 relu_blob3 conv_blob4 0=16 1=3 2=1 3=2 4=1 5=0 6=144 7=16 18 | BatchNorm batch_norm4 1 1 conv_blob4 batch_norm_blob4 0=16 19 | Scale bn_scale4 1 1 batch_norm_blob4 batch_norm_blob4_bn_scale4 0=16 1=1 20 | ReLU relu4 1 1 batch_norm_blob4_bn_scale4 relu_blob4 21 | Convolution conv5 1 1 relu_blob4 conv_blob5 0=32 1=1 2=1 3=1 4=0 5=0 6=512 22 | BatchNorm batch_norm5 1 1 conv_blob5 batch_norm_blob5 0=32 23 | Scale bn_scale5 1 1 batch_norm_blob5 batch_norm_blob5_bn_scale5 0=32 1=1 24 | ReLU relu5 1 1 batch_norm_blob5_bn_scale5 relu_blob5 25 | ConvolutionDepthWise conv6 1 1 relu_blob5 conv_blob6 0=32 1=3 2=1 3=1 4=1 5=0 6=288 7=32 26 | BatchNorm batch_norm6 1 1 conv_blob6 batch_norm_blob6 0=32 27 | Scale bn_scale6 1 1 batch_norm_blob6 batch_norm_blob6_bn_scale6 0=32 1=1 28 | ReLU relu6 1 1 batch_norm_blob6_bn_scale6 relu_blob6 29 | Convolution conv7 1 1 relu_blob6 conv_blob7 0=32 1=1 2=1 3=1 4=0 5=0 6=1024 30 | BatchNorm batch_norm7 1 1 conv_blob7 batch_norm_blob7 0=32 31 | Scale bn_scale7 1 1 batch_norm_blob7 batch_norm_blob7_bn_scale7 0=32 1=1 32 | ReLU relu7 1 1 batch_norm_blob7_bn_scale7 relu_blob7 33 | ConvolutionDepthWise conv8 1 1 relu_blob7 conv_blob8 0=32 1=3 2=1 3=2 4=1 5=0 6=288 7=32 34 | BatchNorm batch_norm8 1 1 conv_blob8 batch_norm_blob8 0=32 35 | Scale bn_scale8 1 1 batch_norm_blob8 batch_norm_blob8_bn_scale8 0=32 1=1 36 | ReLU relu8 1 1 batch_norm_blob8_bn_scale8 relu_blob8 37 | Convolution conv9 1 1 relu_blob8 conv_blob9 0=64 1=1 2=1 3=1 4=0 5=0 6=2048 38 | BatchNorm batch_norm9 1 1 conv_blob9 batch_norm_blob9 0=64 39 | Scale bn_scale9 1 1 batch_norm_blob9 batch_norm_blob9_bn_scale9 0=64 1=1 40 | ReLU relu9 1 1 batch_norm_blob9_bn_scale9 relu_blob9 41 | ConvolutionDepthWise conv10 1 1 relu_blob9 conv_blob10 0=64 1=3 2=1 3=1 4=1 5=0 6=576 7=64 42 | BatchNorm batch_norm10 1 1 conv_blob10 batch_norm_blob10 0=64 43 | Scale bn_scale10 1 1 batch_norm_blob10 batch_norm_blob10_bn_scale10 0=64 1=1 44 | ReLU relu10 1 1 batch_norm_blob10_bn_scale10 relu_blob10 45 | Convolution conv11 1 1 relu_blob10 conv_blob11 0=64 1=1 2=1 3=1 4=0 5=0 6=4096 46 | BatchNorm batch_norm11 1 1 conv_blob11 batch_norm_blob11 0=64 47 | Scale bn_scale11 1 1 batch_norm_blob11 batch_norm_blob11_bn_scale11 0=64 1=1 48 | ReLU relu11 1 1 batch_norm_blob11_bn_scale11 relu_blob11 49 | Split splitncnn_1 1 2 relu_blob11 relu_blob11_splitncnn_0 relu_blob11_splitncnn_1 50 | 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 51 | BatchNorm batch_norm12 1 1 conv_blob12 batch_norm_blob12 0=64 52 | Scale bn_scale12 1 1 batch_norm_blob12 batch_norm_blob12_bn_scale12 0=64 1=1 53 | ReLU relu12 1 1 batch_norm_blob12_bn_scale12 relu_blob12 54 | Convolution conv13 1 1 relu_blob12 conv_blob13 0=128 1=1 2=1 3=1 4=0 5=0 6=8192 55 | BatchNorm batch_norm13 1 1 conv_blob13 batch_norm_blob13 0=128 56 | Scale bn_scale13 1 1 batch_norm_blob13 batch_norm_blob13_bn_scale13 0=128 1=1 57 | ReLU relu13 1 1 batch_norm_blob13_bn_scale13 relu_blob13 58 | ConvolutionDepthWise conv14 1 1 relu_blob13 conv_blob14 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 59 | BatchNorm batch_norm14 1 1 conv_blob14 batch_norm_blob14 0=128 60 | Scale bn_scale14 1 1 batch_norm_blob14 batch_norm_blob14_bn_scale14 0=128 1=1 61 | ReLU relu14 1 1 batch_norm_blob14_bn_scale14 relu_blob14 62 | Convolution conv15 1 1 relu_blob14 conv_blob15 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 63 | BatchNorm batch_norm15 1 1 conv_blob15 batch_norm_blob15 0=128 64 | Scale bn_scale15 1 1 batch_norm_blob15 batch_norm_blob15_bn_scale15 0=128 1=1 65 | ReLU relu15 1 1 batch_norm_blob15_bn_scale15 relu_blob15 66 | ConvolutionDepthWise conv16 1 1 relu_blob15 conv_blob16 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 67 | BatchNorm batch_norm16 1 1 conv_blob16 batch_norm_blob16 0=128 68 | Scale bn_scale16 1 1 batch_norm_blob16 batch_norm_blob16_bn_scale16 0=128 1=1 69 | ReLU relu16 1 1 batch_norm_blob16_bn_scale16 relu_blob16 70 | Convolution conv17 1 1 relu_blob16 conv_blob17 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 71 | BatchNorm batch_norm17 1 1 conv_blob17 batch_norm_blob17 0=128 72 | Scale bn_scale17 1 1 batch_norm_blob17 batch_norm_blob17_bn_scale17 0=128 1=1 73 | ReLU relu17 1 1 batch_norm_blob17_bn_scale17 relu_blob17 74 | ConvolutionDepthWise conv18 1 1 relu_blob17 conv_blob18 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 75 | BatchNorm batch_norm18 1 1 conv_blob18 batch_norm_blob18 0=128 76 | Scale bn_scale18 1 1 batch_norm_blob18 batch_norm_blob18_bn_scale18 0=128 1=1 77 | ReLU relu18 1 1 batch_norm_blob18_bn_scale18 relu_blob18 78 | Convolution conv19 1 1 relu_blob18 conv_blob19 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 79 | BatchNorm batch_norm19 1 1 conv_blob19 batch_norm_blob19 0=128 80 | Scale bn_scale19 1 1 batch_norm_blob19 batch_norm_blob19_bn_scale19 0=128 1=1 81 | ReLU relu19 1 1 batch_norm_blob19_bn_scale19 relu_blob19 82 | ConvolutionDepthWise conv20 1 1 relu_blob19 conv_blob20 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 83 | BatchNorm batch_norm20 1 1 conv_blob20 batch_norm_blob20 0=128 84 | Scale bn_scale20 1 1 batch_norm_blob20 batch_norm_blob20_bn_scale20 0=128 1=1 85 | ReLU relu20 1 1 batch_norm_blob20_bn_scale20 relu_blob20 86 | Convolution conv21 1 1 relu_blob20 conv_blob21 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 87 | BatchNorm batch_norm21 1 1 conv_blob21 batch_norm_blob21 0=128 88 | Scale bn_scale21 1 1 batch_norm_blob21 batch_norm_blob21_bn_scale21 0=128 1=1 89 | ReLU relu21 1 1 batch_norm_blob21_bn_scale21 relu_blob21 90 | ConvolutionDepthWise conv22 1 1 relu_blob21 conv_blob22 0=128 1=3 2=1 3=1 4=1 5=0 6=1152 7=128 91 | BatchNorm batch_norm22 1 1 conv_blob22 batch_norm_blob22 0=128 92 | Scale bn_scale22 1 1 batch_norm_blob22 batch_norm_blob22_bn_scale22 0=128 1=1 93 | ReLU relu22 1 1 batch_norm_blob22_bn_scale22 relu_blob22 94 | Convolution conv23 1 1 relu_blob22 conv_blob23 0=128 1=1 2=1 3=1 4=0 5=0 6=16384 95 | BatchNorm batch_norm23 1 1 conv_blob23 batch_norm_blob23 0=128 96 | Scale bn_scale23 1 1 batch_norm_blob23 batch_norm_blob23_bn_scale23 0=128 1=1 97 | ReLU relu23 1 1 batch_norm_blob23_bn_scale23 relu_blob23 98 | Split splitncnn_2 1 2 relu_blob23 relu_blob23_splitncnn_0 relu_blob23_splitncnn_1 99 | 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 100 | BatchNorm batch_norm24 1 1 conv_blob24 batch_norm_blob24 0=128 101 | Scale bn_scale24 1 1 batch_norm_blob24 batch_norm_blob24_bn_scale24 0=128 1=1 102 | ReLU relu24 1 1 batch_norm_blob24_bn_scale24 relu_blob24 103 | Convolution conv25 1 1 relu_blob24 conv_blob25 0=256 1=1 2=1 3=1 4=0 5=0 6=32768 104 | BatchNorm batch_norm25 1 1 conv_blob25 batch_norm_blob25 0=256 105 | Scale bn_scale25 1 1 batch_norm_blob25 batch_norm_blob25_bn_scale25 0=256 1=1 106 | ReLU relu25 1 1 batch_norm_blob25_bn_scale25 relu_blob25 107 | ConvolutionDepthWise conv26 1 1 relu_blob25 conv_blob26 0=256 1=3 2=1 3=1 4=1 5=0 6=2304 7=256 108 | BatchNorm batch_norm26 1 1 conv_blob26 batch_norm_blob26 0=256 109 | Scale bn_scale26 1 1 batch_norm_blob26 batch_norm_blob26_bn_scale26 0=256 1=1 110 | ReLU relu26 1 1 batch_norm_blob26_bn_scale26 relu_blob26 111 | Convolution conv27 1 1 relu_blob26 conv_blob27 0=256 1=1 2=1 3=1 4=0 5=0 6=65536 112 | BatchNorm batch_norm27 1 1 conv_blob27 batch_norm_blob27 0=256 113 | Scale bn_scale27 1 1 batch_norm_blob27 batch_norm_blob27_bn_scale27 0=256 1=1 114 | ReLU relu27 1 1 batch_norm_blob27_bn_scale27 relu_blob27 115 | Convolution conv28 1 1 relu_blob11_splitncnn_0 conv_blob28 0=64 1=1 2=1 3=1 4=0 5=0 6=4096 116 | BatchNorm batch_norm28 1 1 conv_blob28 batch_norm_blob28 0=64 117 | Scale bn_scale28 1 1 batch_norm_blob28 batch_norm_blob28_bn_scale28 0=64 1=1 118 | ReLU relu28 1 1 batch_norm_blob28_bn_scale28 relu_blob28 119 | Split splitncnn_3 1 2 relu_blob28 relu_blob28_splitncnn_0 relu_blob28_splitncnn_1 120 | Convolution conv29 1 1 relu_blob23_splitncnn_0 conv_blob29 0=64 1=1 2=1 3=1 4=0 5=0 6=8192 121 | BatchNorm batch_norm29 1 1 conv_blob29 batch_norm_blob29 0=64 122 | Scale bn_scale29 1 1 batch_norm_blob29 batch_norm_blob29_bn_scale29 0=64 1=1 123 | ReLU relu29 1 1 batch_norm_blob29_bn_scale29 relu_blob29 124 | Split splitncnn_4 1 2 relu_blob29 relu_blob29_splitncnn_0 relu_blob29_splitncnn_1 125 | Convolution conv30 1 1 relu_blob27 conv_blob30 0=64 1=1 2=1 3=1 4=0 5=0 6=16384 126 | BatchNorm batch_norm30 1 1 conv_blob30 batch_norm_blob30 0=64 127 | Scale bn_scale30 1 1 batch_norm_blob30 batch_norm_blob30_bn_scale30 0=64 1=1 128 | ReLU relu30 1 1 batch_norm_blob30_bn_scale30 relu_blob30 129 | Split splitncnn_5 1 3 relu_blob30 relu_blob30_splitncnn_0 relu_blob30_splitncnn_1 relu_blob30_splitncnn_2 130 | 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 131 | Crop crop1 2 1 conv_transpose_blob1 relu_blob29_splitncnn_1 crop1 132 | Eltwise add1 2 1 relu_blob29_splitncnn_0 crop1 add_blob1 0=1 -23301=0 133 | Convolution conv31 1 1 add_blob1 conv_blob31 0=64 1=3 2=1 3=1 4=1 5=0 6=36864 134 | BatchNorm batch_norm31 1 1 conv_blob31 batch_norm_blob31 0=64 135 | Scale bn_scale31 1 1 batch_norm_blob31 batch_norm_blob31_bn_scale31 0=64 1=1 136 | ReLU relu31 1 1 batch_norm_blob31_bn_scale31 relu_blob31 137 | Split splitncnn_6 1 3 relu_blob31 relu_blob31_splitncnn_0 relu_blob31_splitncnn_1 relu_blob31_splitncnn_2 138 | 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 139 | Crop crop2 2 1 conv_transpose_blob2 relu_blob28_splitncnn_1 crop2 140 | Eltwise add2 2 1 relu_blob28_splitncnn_0 crop2 add_blob2 0=1 -23301=0 141 | Convolution conv32 1 1 add_blob2 conv_blob32 0=64 1=3 2=1 3=1 4=1 5=0 6=36864 142 | BatchNorm batch_norm32 1 1 conv_blob32 batch_norm_blob32 0=64 143 | Scale bn_scale32 1 1 batch_norm_blob32 batch_norm_blob32_bn_scale32 0=64 1=1 144 | ReLU relu32 1 1 batch_norm_blob32_bn_scale32 relu_blob32 145 | Split splitncnn_7 1 2 relu_blob32 relu_blob32_splitncnn_0 relu_blob32_splitncnn_1 146 | Convolution conv33 1 1 relu_blob32_splitncnn_1 conv_blob33 0=32 1=3 2=1 3=1 4=1 5=0 6=18432 147 | BatchNorm batch_norm33 1 1 conv_blob33 batch_norm_blob33 0=32 148 | Scale bn_scale33 1 1 batch_norm_blob33 batch_norm_blob33_bn_scale33 0=32 1=1 149 | Convolution conv34 1 1 relu_blob32_splitncnn_0 conv_blob34 0=16 1=3 2=1 3=1 4=1 5=0 6=9216 150 | BatchNorm batch_norm34 1 1 conv_blob34 batch_norm_blob34 0=16 151 | Scale bn_scale34 1 1 batch_norm_blob34 batch_norm_blob34_bn_scale34 0=16 1=1 152 | ReLU relu33 1 1 batch_norm_blob34_bn_scale34 relu_blob33 153 | Split splitncnn_8 1 2 relu_blob33 relu_blob33_splitncnn_0 relu_blob33_splitncnn_1 154 | Convolution conv35 1 1 relu_blob33_splitncnn_1 conv_blob35 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 155 | BatchNorm batch_norm35 1 1 conv_blob35 batch_norm_blob35 0=16 156 | Scale bn_scale35 1 1 batch_norm_blob35 batch_norm_blob35_bn_scale35 0=16 1=1 157 | Convolution conv36 1 1 relu_blob33_splitncnn_0 conv_blob36 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 158 | BatchNorm batch_norm36 1 1 conv_blob36 batch_norm_blob36 0=16 159 | Scale bn_scale36 1 1 batch_norm_blob36 batch_norm_blob36_bn_scale36 0=16 1=1 160 | ReLU relu34 1 1 batch_norm_blob36_bn_scale36 relu_blob34 161 | Convolution conv37 1 1 relu_blob34 conv_blob37 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 162 | BatchNorm batch_norm37 1 1 conv_blob37 batch_norm_blob37 0=16 163 | Scale bn_scale37 1 1 batch_norm_blob37 batch_norm_blob37_bn_scale37 0=16 1=1 164 | Concat cat1 3 1 batch_norm_blob33_bn_scale33 batch_norm_blob35_bn_scale35 batch_norm_blob37_bn_scale37 cat_blob1 0=0 165 | ReLU relu35 1 1 cat_blob1 relu_blob35 166 | Split splitncnn_9 1 3 relu_blob35 relu_blob35_splitncnn_0 relu_blob35_splitncnn_1 relu_blob35_splitncnn_2 167 | Convolution conv38 1 1 relu_blob31_splitncnn_1 conv_blob38 0=32 1=3 2=1 3=1 4=1 5=0 6=18432 168 | BatchNorm batch_norm38 1 1 conv_blob38 batch_norm_blob38 0=32 169 | Scale bn_scale38 1 1 batch_norm_blob38 batch_norm_blob38_bn_scale38 0=32 1=1 170 | Convolution conv39 1 1 relu_blob31_splitncnn_0 conv_blob39 0=16 1=3 2=1 3=1 4=1 5=0 6=9216 171 | BatchNorm batch_norm39 1 1 conv_blob39 batch_norm_blob39 0=16 172 | Scale bn_scale39 1 1 batch_norm_blob39 batch_norm_blob39_bn_scale39 0=16 1=1 173 | ReLU relu36 1 1 batch_norm_blob39_bn_scale39 relu_blob36 174 | Split splitncnn_10 1 2 relu_blob36 relu_blob36_splitncnn_0 relu_blob36_splitncnn_1 175 | Convolution conv40 1 1 relu_blob36_splitncnn_1 conv_blob40 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 176 | BatchNorm batch_norm40 1 1 conv_blob40 batch_norm_blob40 0=16 177 | Scale bn_scale40 1 1 batch_norm_blob40 batch_norm_blob40_bn_scale40 0=16 1=1 178 | Convolution conv41 1 1 relu_blob36_splitncnn_0 conv_blob41 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 179 | BatchNorm batch_norm41 1 1 conv_blob41 batch_norm_blob41 0=16 180 | Scale bn_scale41 1 1 batch_norm_blob41 batch_norm_blob41_bn_scale41 0=16 1=1 181 | ReLU relu37 1 1 batch_norm_blob41_bn_scale41 relu_blob37 182 | Convolution conv42 1 1 relu_blob37 conv_blob42 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 183 | BatchNorm batch_norm42 1 1 conv_blob42 batch_norm_blob42 0=16 184 | Scale bn_scale42 1 1 batch_norm_blob42 batch_norm_blob42_bn_scale42 0=16 1=1 185 | Concat cat2 3 1 batch_norm_blob38_bn_scale38 batch_norm_blob40_bn_scale40 batch_norm_blob42_bn_scale42 cat_blob2 0=0 186 | ReLU relu38 1 1 cat_blob2 relu_blob38 187 | Split splitncnn_11 1 3 relu_blob38 relu_blob38_splitncnn_0 relu_blob38_splitncnn_1 relu_blob38_splitncnn_2 188 | Convolution conv43 1 1 relu_blob30_splitncnn_1 conv_blob43 0=32 1=3 2=1 3=1 4=1 5=0 6=18432 189 | BatchNorm batch_norm43 1 1 conv_blob43 batch_norm_blob43 0=32 190 | Scale bn_scale43 1 1 batch_norm_blob43 batch_norm_blob43_bn_scale43 0=32 1=1 191 | Convolution conv44 1 1 relu_blob30_splitncnn_0 conv_blob44 0=16 1=3 2=1 3=1 4=1 5=0 6=9216 192 | BatchNorm batch_norm44 1 1 conv_blob44 batch_norm_blob44 0=16 193 | Scale bn_scale44 1 1 batch_norm_blob44 batch_norm_blob44_bn_scale44 0=16 1=1 194 | ReLU relu39 1 1 batch_norm_blob44_bn_scale44 relu_blob39 195 | Split splitncnn_12 1 2 relu_blob39 relu_blob39_splitncnn_0 relu_blob39_splitncnn_1 196 | Convolution conv45 1 1 relu_blob39_splitncnn_1 conv_blob45 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 197 | BatchNorm batch_norm45 1 1 conv_blob45 batch_norm_blob45 0=16 198 | Scale bn_scale45 1 1 batch_norm_blob45 batch_norm_blob45_bn_scale45 0=16 1=1 199 | Convolution conv46 1 1 relu_blob39_splitncnn_0 conv_blob46 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 200 | BatchNorm batch_norm46 1 1 conv_blob46 batch_norm_blob46 0=16 201 | Scale bn_scale46 1 1 batch_norm_blob46 batch_norm_blob46_bn_scale46 0=16 1=1 202 | ReLU relu40 1 1 batch_norm_blob46_bn_scale46 relu_blob40 203 | Convolution conv47 1 1 relu_blob40 conv_blob47 0=16 1=3 2=1 3=1 4=1 5=0 6=2304 204 | BatchNorm batch_norm47 1 1 conv_blob47 batch_norm_blob47 0=16 205 | Scale bn_scale47 1 1 batch_norm_blob47 batch_norm_blob47_bn_scale47 0=16 1=1 206 | Concat cat3 3 1 batch_norm_blob43_bn_scale43 batch_norm_blob45_bn_scale45 batch_norm_blob47_bn_scale47 cat_blob3 0=0 207 | ReLU relu41 1 1 cat_blob3 relu_blob41 208 | Split splitncnn_13 1 3 relu_blob41 relu_blob41_splitncnn_0 relu_blob41_splitncnn_1 relu_blob41_splitncnn_2 209 | Convolution conv48 1 1 relu_blob35_splitncnn_2 conv_blob48 0=8 1=1 2=1 3=1 4=0 5=1 6=512 210 | Convolution conv49 1 1 relu_blob35_splitncnn_1 conv_blob49 0=4 1=1 2=1 3=1 4=0 5=1 6=256 211 | Convolution conv50 1 1 relu_blob38_splitncnn_2 conv_blob50 0=8 1=1 2=1 3=1 4=0 5=1 6=512 212 | Convolution conv51 1 1 relu_blob38_splitncnn_1 conv_blob51 0=4 1=1 2=1 3=1 4=0 5=1 6=256 213 | Convolution conv52 1 1 relu_blob41_splitncnn_2 conv_blob52 0=8 1=1 2=1 3=1 4=0 5=1 6=512 214 | Convolution conv53 1 1 relu_blob41_splitncnn_1 conv_blob53 0=4 1=1 2=1 3=1 4=0 5=1 6=256 215 | Permute conv4_3_norm_mbox_loc_perm 1 1 conv_blob48 conv4_3_norm_mbox_loc_perm 0=3 216 | Flatten conv4_3_norm_mbox_loc_flat 1 1 conv4_3_norm_mbox_loc_perm conv4_3_norm_mbox_loc_flat 217 | Permute conv4_3_norm_mbox_conf_perm 1 1 conv_blob49 conv4_3_norm_mbox_conf_perm 0=3 218 | Flatten conv4_3_norm_mbox_conf_flat 1 1 conv4_3_norm_mbox_conf_perm conv4_3_norm_mbox_conf_flat 219 | 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 220 | Permute conv5_3_norm_mbox_loc_perm 1 1 conv_blob50 conv5_3_norm_mbox_loc_perm 0=3 221 | Flatten conv5_3_norm_mbox_loc_flat 1 1 conv5_3_norm_mbox_loc_perm conv5_3_norm_mbox_loc_flat 222 | Permute conv5_3_norm_mbox_conf_perm 1 1 conv_blob51 conv5_3_norm_mbox_conf_perm 0=3 223 | Flatten conv5_3_norm_mbox_conf_flat 1 1 conv5_3_norm_mbox_conf_perm conv5_3_norm_mbox_conf_flat 224 | 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 225 | Permute conv6_3_norm_mbox_loc_perm 1 1 conv_blob52 conv6_3_norm_mbox_loc_perm 0=3 226 | Flatten conv6_3_norm_mbox_loc_flat 1 1 conv6_3_norm_mbox_loc_perm conv6_3_norm_mbox_loc_flat 227 | Permute conv6_3_norm_mbox_conf_perm 1 1 conv_blob53 conv6_3_norm_mbox_conf_perm 0=3 228 | Flatten conv6_3_norm_mbox_conf_flat 1 1 conv6_3_norm_mbox_conf_perm conv6_3_norm_mbox_conf_flat 229 | 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 230 | 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 231 | 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 232 | Concat mbox_priorbox 3 1 conv4_3_norm_mbox_priorbox conv5_3_norm_mbox_priorbox conv6_3_norm_mbox_priorbox mbox_priorbox 0=1 233 | Reshape mbox_conf_reshape 1 1 mbox_conf mbox_conf_reshape 0=2 1=-1 2=-233 3=0 234 | Softmax mbox_conf_softmax 1 1 mbox_conf_reshape mbox_conf_softmax 0=1 1=1 235 | Flatten mbox_conf_flatten 1 1 mbox_conf_softmax mbox_conf_flatten 236 | 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 237 | -------------------------------------------------------------------------------- /facesdk.framework/facesdk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/facesdk.framework/facesdk -------------------------------------------------------------------------------- /facesdk.framework/landmark.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/facesdk.framework/landmark.bin -------------------------------------------------------------------------------- /facesdk.framework/landmark.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 15 15 3 | Input input 0 1 data 0=60 1=60 2=1 4 | Convolution Conv1 1 1 data Conv1 0=20 1=5 2=1 3=1 4=2 5=1 6=500 5 | ReLU ActivationReLU1 1 1 Conv1 ActivationReLU1 6 | Pooling Pool1 1 1 ActivationReLU1 Pool1 0=0 1=2 2=2 3=0 4=0 7 | Convolution Conv2 1 1 Pool1 Conv2 0=48 1=5 2=1 3=1 4=2 5=1 6=24000 8 | ReLU ActivationReLU2 1 1 Conv2 ActivationReLU2 9 | Pooling Pool2 1 1 ActivationReLU2 Pool2 0=0 1=2 2=2 3=0 4=0 10 | Convolution Conv3 1 1 Pool2 Conv3 0=64 1=3 2=1 3=1 4=0 5=1 6=27648 11 | ReLU ActivationReLU3 1 1 Conv3 ActivationReLU3 12 | Pooling Pool3 1 1 ActivationReLU3 Pool3 0=0 1=3 2=2 3=0 4=0 13 | Convolution Conv4 1 1 Pool3 Conv4 0=80 1=3 2=1 3=1 4=0 5=1 6=46080 14 | ReLU ActivationReLU4 1 1 Conv4 ActivationReLU4 15 | InnerProduct Dense1 1 1 ActivationReLU4 Dense1 0=512 1=1 2=655360 16 | ReLU ActivationReLU5 1 1 Dense1 ActivationReLU5 17 | InnerProduct Dense3 1 1 ActivationReLU5 Dense3 0=136 1=1 2=69632 18 | -------------------------------------------------------------------------------- /facesdk.framework/liveness.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kby-ai/FaceLivenessDetection-iOS/cac1836e502b23a2c9d7c43580f1aa975d62d9b5/facesdk.framework/liveness.bin -------------------------------------------------------------------------------- /privacy: -------------------------------------------------------------------------------- 1 | Face Data Collection and Use 2 | 3 | Our app collects a liveness detection template of your face when you use certain features. This data is used to calculate the liveness score of your face, which determines whether it is a real or spoofed face. 4 | 5 | We use this data solely for the purpose of providing you with a secure and accurate authentication process. We do not use this data for any other purposes, and we do not share it with any third parties. 6 | 7 | The face data is not stored or retained by our app in any way. It is only stored in memory for the duration of the liveness detection process, and is immediately discarded once the process is complete. 8 | 9 | We take the security and privacy of your face data seriously and use industry-standard security measures to protect it from unauthorized access, disclosure, alteration, or destruction 10 | --------------------------------------------------------------------------------