├── .github └── Logo.png ├── .gitignore ├── .travis.yml ├── AR2DFaceDetector.podspec ├── AR2DFaceDetector ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── ARFaceLandmarks2D.swift │ ├── CGPoint+Extensions.swift │ └── simd+Extensions.swift ├── Example ├── AR2DFaceDetector.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── AR2DFaceDetector-Example.xcscheme ├── AR2DFaceDetector.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── AR2DFaceDetector │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── Podfile ├── Podfile.lock └── Tests │ ├── Info.plist │ └── Tests.swift ├── LICENSE ├── README.md └── _Pods.xcodeproj /.github/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noppefoxwolf/AR2DFaceDetector/5e8b9accf44584cf9ad6b3cde721a15027a597ff/.github/Logo.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | 37 | Example/Pods/ 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/AR2DFaceDetector.xcworkspace -scheme AR2DFaceDetector-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /AR2DFaceDetector.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'AR2DFaceDetector' 3 | s.version = '0.1.0' 4 | s.summary = 'A short description of AR2DFaceDetector.' 5 | s.description = <<-DESC 6 | TODO: Add long description of the pod here. 7 | DESC 8 | s.homepage = 'https://github.com/noppefoxwolf/AR2DFaceDetector' 9 | s.license = { :type => 'MIT', :file => 'LICENSE' } 10 | s.author = { 'noppefoxwolf' => 'noppelabs@gmail.com' } 11 | s.source = { :git => 'https://github.com/noppefoxwolf/AR2DFaceDetector.git', :tag => s.version.to_s } 12 | s.social_media_url = 'https://twitter.com/noppefoxwolf' 13 | s.ios.deployment_target = '11.0' 14 | s.swift_versions = ['5.0'] 15 | s.source_files = 'AR2DFaceDetector/Classes/**/*' 16 | end 17 | -------------------------------------------------------------------------------- /AR2DFaceDetector/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noppefoxwolf/AR2DFaceDetector/5e8b9accf44584cf9ad6b3cde721a15027a597ff/AR2DFaceDetector/Assets/.gitkeep -------------------------------------------------------------------------------- /AR2DFaceDetector/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noppefoxwolf/AR2DFaceDetector/5e8b9accf44584cf9ad6b3cde721a15027a597ff/AR2DFaceDetector/Classes/.gitkeep -------------------------------------------------------------------------------- /AR2DFaceDetector/Classes/ARFaceLandmarks2D.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARLandmark.swift 3 | // ARKit-Render 4 | // 5 | // Created by beta on 2019/08/11. 6 | // Copyright © 2019 Tomoya Hirano. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ARKit 11 | 12 | public class AR2DFaceDetector { 13 | public let capturedImage: CIImage 14 | public let faces: [ARFace] 15 | 16 | public init(frame: ARFrame, orientation: CGImagePropertyOrientation = CGImagePropertyOrientation.up) { 17 | capturedImage = CIImage(cvPixelBuffer: frame.capturedImage).oriented(orientation) 18 | faces = frame.anchors.compactMap({ $0 as? ARFaceAnchor }).map({ ARFace(faceAnchor: $0, camera: frame.camera, orientation: orientation) }) 19 | } 20 | } 21 | 22 | public class ARFace { 23 | public let landmarks: ARFaceLandmarks2D? 24 | public let perspectivePoints: ARPerspectivePoints2D? 25 | 26 | init(faceAnchor: ARFaceAnchor, 27 | camera: ARCamera, 28 | orientation: CGImagePropertyOrientation) { 29 | landmarks = ARFaceLandmarks2D(faceAnchor: faceAnchor, camera: camera, orientation: orientation) 30 | perspectivePoints = ARPerspectivePoints2D(landmarks: landmarks) 31 | } 32 | } 33 | 34 | public class ARPerspectivePoints2D { 35 | public let topLeft: ARPerspectiveRegion2D 36 | public let topRight: ARPerspectiveRegion2D 37 | public let bottomRight: ARPerspectiveRegion2D 38 | public let bottomLeft: ARPerspectiveRegion2D 39 | 40 | init?(landmarks: ARFaceLandmarks2D?) { 41 | if let allPoints = landmarks?.allPoints { 42 | // ここの計算は適当、横顔とかに弱い 43 | // 20 44 | // 1023 13 1029 45 | // 1047 46 | let rightTranslationMatrix = allPoints.normalizedPoints[1029].simd - allPoints.normalizedPoints[13].simd 47 | let leftTranslationMatrix = allPoints.normalizedPoints[1023].simd - allPoints.normalizedPoints[13].simd 48 | 49 | topLeft = ARPerspectiveRegion2D(point: (allPoints.normalizedPoints[20].simd + leftTranslationMatrix).point) 50 | topRight = ARPerspectiveRegion2D(point: (allPoints.normalizedPoints[20].simd + rightTranslationMatrix).point) 51 | bottomRight = ARPerspectiveRegion2D(point: (allPoints.normalizedPoints[1047].simd + rightTranslationMatrix).point) 52 | bottomLeft = ARPerspectiveRegion2D(point: (allPoints.normalizedPoints[1047].simd + leftTranslationMatrix).point) 53 | } else { 54 | return nil 55 | } 56 | } 57 | } 58 | 59 | public class ARPerspectiveRegion2D { 60 | public let point: CGPoint 61 | 62 | init(point: CGPoint) { 63 | self.point = point 64 | } 65 | 66 | public func pointInImage(imageSize: CGSize) -> CGPoint { 67 | return point.applying(.init(scaleX: imageSize.width, y: imageSize.height)) 68 | } 69 | } 70 | 71 | public class ARFaceLandmarks2D { 72 | let textureCoordinates: [simd_float2] 73 | let orientation: CGImagePropertyOrientation 74 | 75 | init?(faceAnchor: ARFaceAnchor, camera: ARCamera, orientation: CGImagePropertyOrientation) { 76 | guard faceAnchor.isTracked else { return nil } 77 | let geometry = faceAnchor.geometry 78 | let vertices = geometry.vertices 79 | let size = camera.imageResolution 80 | let viewportSize = CGSize(width: size.height, height: size.width) 81 | let modelMatrix = faceAnchor.transform 82 | // https://stackoverflow.com/a/53255370/1131587 83 | textureCoordinates = vertices.lazy.map { (vertex) -> simd_float2 in 84 | let vertex4 = simd_float4(vertex.x, vertex.y, vertex.z, 1) 85 | let world_vertex4 = simd_mul(modelMatrix, vertex4) 86 | let world_vector3 = simd_float3(x: world_vertex4.x, y: world_vertex4.y, z: world_vertex4.z) 87 | let pt = camera.projectPoint(world_vector3, orientation: .portrait, viewportSize: viewportSize) 88 | let v = Float(pt.x) / Float(size.height) 89 | let u = Float(pt.y) / Float(size.width) 90 | let normalizedPoints = simd_float2(u, v) 91 | 92 | // ARKit default mirrored 93 | 94 | 95 | switch orientation { 96 | case .up: 97 | let flipMatrix = simd_float3x3(rows: [ 98 | .init(x: 1, y: 0, z: 0), 99 | .init(x: 0, y: -1, z: 1), 100 | .init(x: 0, y: 0, z: 1), 101 | ]) 102 | let flipped = simd_mul(flipMatrix, simd_float3(normalizedPoints.x, normalizedPoints.y, 1)) 103 | return simd_float2(x: flipped.x, y: flipped.y) 104 | //return simd_float2(normalizedPoints.x * 2, 1.0) - normalizedPoints 105 | case .right: 106 | let flipMatrix = simd_float3x3(rows: [ 107 | .init(x: -1, y: 0, z: 1), 108 | .init(x: 0, y: 1, z: 0), 109 | .init(x: 0, y: 0, z: 1), 110 | ]) 111 | let θ: Float = .pi / 2.0 //90 112 | let orientationMatrix = simd_float2x2(float2(x: cos(θ), y: sin(θ)), float2(x: -sin(θ), y: cos(θ))) 113 | let normalizedPoints = simd_mul(orientationMatrix, normalizedPoints) + simd_float2(1.0, 0.0) 114 | let flipped = simd_mul(flipMatrix, simd_float3(normalizedPoints.x, normalizedPoints.y, 1)) 115 | return simd_float2(x: flipped.x, y: flipped.y) 116 | default: 117 | preconditionFailure("not supported") 118 | } 119 | } 120 | self.orientation = orientation 121 | } 122 | 123 | open var allPoints: ARFaceLandmarkRegion2D? { 124 | return ARFaceLandmarkRegion2D(normalizedPoints: textureCoordinates) 125 | } 126 | 127 | open var faceContour: ARFaceLandmarkRegion2D? { 128 | let indices: [Int] = [ 129 | 940, 939, 938, 937, 936, 935, 934, 933, 932, 989, 988, 987, 986, 985, 984, 130 | 1049, 131 | 983, 982, 944, 992, 991, 990, 1007, 1006, 1005, 1004, 1003, 1002, 1001, 1000, 999 132 | ] 133 | return ARFaceLandmarkRegion2D(normalizedPoints: indices.compactMap({ textureCoordinates[$0] })) 134 | 135 | } 136 | 137 | open var leftEye: ARFaceLandmarkRegion2D? { 138 | let indices: [Int] = (1181...1204).map({ $0 }) 139 | return ARFaceLandmarkRegion2D(normalizedPoints: indices.compactMap({ textureCoordinates[$0] })) 140 | } 141 | 142 | open var rightEye: ARFaceLandmarkRegion2D? { 143 | let indices: [Int] = (1061...1084).map({ $0 }) 144 | return ARFaceLandmarkRegion2D(normalizedPoints: indices.compactMap({ textureCoordinates[$0] })) 145 | } 146 | 147 | open var leftEyebrow: ARFaceLandmarkRegion2D? { 148 | return nil 149 | } 150 | 151 | open var rightEyebrow: ARFaceLandmarkRegion2D? { 152 | return nil 153 | } 154 | 155 | open var nose: ARFaceLandmarkRegion2D? { 156 | return ARFaceLandmarkRegion2D(normalizedPoints: [textureCoordinates[8]] ) 157 | } 158 | 159 | open var noseCrest: ARFaceLandmarkRegion2D? { 160 | let indices: [Int] = [15, 14, 13, 12, 11, 10, 9, 8] 161 | return ARFaceLandmarkRegion2D(normalizedPoints: indices.compactMap({ textureCoordinates[$0] })) 162 | // 15 ~ 8 163 | } 164 | 165 | open var medianLine: ARFaceLandmarkRegion2D? { 166 | return nil 167 | } 168 | 169 | open var outerLips: ARFaceLandmarkRegion2D? { 170 | let indices: [Int] = [1, 90, 91, 98, 99, 100, 102, 185, 190, 120, 122, 278, 272, 263, 27, 698, 707, 723, 712, 681, 680, 679, 678, 551, 549, 548, 547, 540, 539] 171 | return ARFaceLandmarkRegion2D(normalizedPoints: indices.compactMap({ textureCoordinates[$0] })) 172 | } 173 | 174 | open var innerLips: ARFaceLandmarkRegion2D? { 175 | let indices: [Int] = [23, 93, 95, 97, 105, 106, 187, 189, 248, 247, 275, 290, 274, 265, 25, 700, 709, 725, 725, 710, 682, 683, 740, 684, 685, 686, 687, 688, 689, 690, 691] 176 | return ARFaceLandmarkRegion2D(normalizedPoints: indices.compactMap({ textureCoordinates[$0] })) 177 | } 178 | 179 | open var leftPupil: ARFaceLandmarkRegion2D? { 180 | return nil 181 | } 182 | 183 | open var rightPupil: ARFaceLandmarkRegion2D? { 184 | return nil 185 | } 186 | } 187 | 188 | import Vision 189 | 190 | public class ARFaceLandmarkRegion2D { 191 | public let normalizedPoints: [CGPoint] 192 | 193 | init(normalizedPoints: [simd_float2]) { 194 | self.normalizedPoints = normalizedPoints.lazy.map({ CGPoint(x: CGFloat($0.x), y: CGFloat($0.y)) }) 195 | } 196 | 197 | public func pointsInImage(imageSize: CGSize) -> [CGPoint] { 198 | return normalizedPoints.lazy.map({ $0.applying(.init(scaleX: imageSize.width, y: imageSize.height)) }) 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /AR2DFaceDetector/Classes/CGPoint+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGPoint+Extensions.swift 3 | // ARFaceLandmarks2D 4 | // 5 | // Created by beta on 2019/08/17. 6 | // 7 | 8 | import CoreGraphics 9 | import simd 10 | 11 | extension CGPoint { 12 | var simd: simd_float2 { 13 | return simd_float2(x: Float(x), y: Float(y)) 14 | } 15 | } 16 | 17 | extension simd_float2 { 18 | var point: CGPoint { 19 | return CGPoint(x: CGFloat(x), y: CGFloat(y)) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /AR2DFaceDetector/Classes/simd+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // simd+Extensions.swift 3 | // AR2DFaceDetector 4 | // 5 | // Created by beta on 2019/08/17. 6 | // 7 | 8 | import UIKit 9 | 10 | extension SIMD3 { 11 | var xy: SIMD2 { 12 | return SIMD2(x: x, y: y) 13 | } 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D0A1EBA81F37ED3F7678484 /* Pods_AR2DFaceDetector_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554653CA8F33EFE5F15FF7B1 /* Pods_AR2DFaceDetector_Tests.framework */; }; 11 | 39837316A38769C3BBFB0766 /* Pods_AR2DFaceDetector_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67FCD9FE512B7BA869C6BED9 /* Pods_AR2DFaceDetector_Example.framework */; }; 12 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 13 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 14 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 15 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 16 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 17 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 26 | remoteInfo = AR2DFaceDetector; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 17E47EC11C4365554264D406 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 32 | 4D17A6CCE426D7E11487FF2E /* Pods-AR2DFaceDetector_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AR2DFaceDetector_Example.debug.xcconfig"; path = "Target Support Files/Pods-AR2DFaceDetector_Example/Pods-AR2DFaceDetector_Example.debug.xcconfig"; sourceTree = ""; }; 33 | 554653CA8F33EFE5F15FF7B1 /* Pods_AR2DFaceDetector_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AR2DFaceDetector_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 607FACD01AFB9204008FA782 /* AR2DFaceDetector_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AR2DFaceDetector_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 38 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 40 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 41 | 607FACE51AFB9204008FA782 /* AR2DFaceDetector_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AR2DFaceDetector_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 44 | 67FCD9FE512B7BA869C6BED9 /* Pods_AR2DFaceDetector_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AR2DFaceDetector_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 7C42C3DC598F88F5184B6948 /* Pods-AR2DFaceDetector_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AR2DFaceDetector_Example.release.xcconfig"; path = "Target Support Files/Pods-AR2DFaceDetector_Example/Pods-AR2DFaceDetector_Example.release.xcconfig"; sourceTree = ""; }; 46 | 87A4494C2042016F8B90046E /* Pods-AR2DFaceDetector_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AR2DFaceDetector_Tests.release.xcconfig"; path = "Target Support Files/Pods-AR2DFaceDetector_Tests/Pods-AR2DFaceDetector_Tests.release.xcconfig"; sourceTree = ""; }; 47 | A6E91B7372CA44E77644CEBF /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 48 | A723AA3EB32EF4E47A03AABF /* Pods-AR2DFaceDetector_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AR2DFaceDetector_Tests.debug.xcconfig"; path = "Target Support Files/Pods-AR2DFaceDetector_Tests/Pods-AR2DFaceDetector_Tests.debug.xcconfig"; sourceTree = ""; }; 49 | D66D60691EFA73606821C251 /* AR2DFaceDetector.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = AR2DFaceDetector.podspec; path = ../AR2DFaceDetector.podspec; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 39837316A38769C3BBFB0766 /* Pods_AR2DFaceDetector_Example.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 1D0A1EBA81F37ED3F7678484 /* Pods_AR2DFaceDetector_Tests.framework in Frameworks */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 607FACC71AFB9204008FA782 = { 73 | isa = PBXGroup; 74 | children = ( 75 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 76 | 607FACD21AFB9204008FA782 /* Example for AR2DFaceDetector */, 77 | 607FACE81AFB9204008FA782 /* Tests */, 78 | 607FACD11AFB9204008FA782 /* Products */, 79 | D4D5088533DB8B85F5E7E421 /* Pods */, 80 | 6B9BE927D5656CD319CA8DEC /* Frameworks */, 81 | ); 82 | sourceTree = ""; 83 | }; 84 | 607FACD11AFB9204008FA782 /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 607FACD01AFB9204008FA782 /* AR2DFaceDetector_Example.app */, 88 | 607FACE51AFB9204008FA782 /* AR2DFaceDetector_Tests.xctest */, 89 | ); 90 | name = Products; 91 | sourceTree = ""; 92 | }; 93 | 607FACD21AFB9204008FA782 /* Example for AR2DFaceDetector */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 97 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 98 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 99 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 100 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 101 | 607FACD31AFB9204008FA782 /* Supporting Files */, 102 | ); 103 | name = "Example for AR2DFaceDetector"; 104 | path = AR2DFaceDetector; 105 | sourceTree = ""; 106 | }; 107 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 607FACD41AFB9204008FA782 /* Info.plist */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | 607FACE81AFB9204008FA782 /* Tests */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 119 | 607FACE91AFB9204008FA782 /* Supporting Files */, 120 | ); 121 | path = Tests; 122 | sourceTree = ""; 123 | }; 124 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 607FACEA1AFB9204008FA782 /* Info.plist */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | D66D60691EFA73606821C251 /* AR2DFaceDetector.podspec */, 136 | A6E91B7372CA44E77644CEBF /* README.md */, 137 | 17E47EC11C4365554264D406 /* LICENSE */, 138 | ); 139 | name = "Podspec Metadata"; 140 | sourceTree = ""; 141 | }; 142 | 6B9BE927D5656CD319CA8DEC /* Frameworks */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 67FCD9FE512B7BA869C6BED9 /* Pods_AR2DFaceDetector_Example.framework */, 146 | 554653CA8F33EFE5F15FF7B1 /* Pods_AR2DFaceDetector_Tests.framework */, 147 | ); 148 | name = Frameworks; 149 | sourceTree = ""; 150 | }; 151 | D4D5088533DB8B85F5E7E421 /* Pods */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 4D17A6CCE426D7E11487FF2E /* Pods-AR2DFaceDetector_Example.debug.xcconfig */, 155 | 7C42C3DC598F88F5184B6948 /* Pods-AR2DFaceDetector_Example.release.xcconfig */, 156 | A723AA3EB32EF4E47A03AABF /* Pods-AR2DFaceDetector_Tests.debug.xcconfig */, 157 | 87A4494C2042016F8B90046E /* Pods-AR2DFaceDetector_Tests.release.xcconfig */, 158 | ); 159 | path = Pods; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXGroup section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | 607FACCF1AFB9204008FA782 /* AR2DFaceDetector_Example */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AR2DFaceDetector_Example" */; 168 | buildPhases = ( 169 | F285C7C2FF1C856B47DCC3DF /* [CP] Check Pods Manifest.lock */, 170 | 607FACCC1AFB9204008FA782 /* Sources */, 171 | 607FACCD1AFB9204008FA782 /* Frameworks */, 172 | 607FACCE1AFB9204008FA782 /* Resources */, 173 | 33B89CDD891072BE82EB433B /* [CP] Embed Pods Frameworks */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = AR2DFaceDetector_Example; 180 | productName = AR2DFaceDetector; 181 | productReference = 607FACD01AFB9204008FA782 /* AR2DFaceDetector_Example.app */; 182 | productType = "com.apple.product-type.application"; 183 | }; 184 | 607FACE41AFB9204008FA782 /* AR2DFaceDetector_Tests */ = { 185 | isa = PBXNativeTarget; 186 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AR2DFaceDetector_Tests" */; 187 | buildPhases = ( 188 | E55FBE90A5A106C58C504E7C /* [CP] Check Pods Manifest.lock */, 189 | 607FACE11AFB9204008FA782 /* Sources */, 190 | 607FACE21AFB9204008FA782 /* Frameworks */, 191 | 607FACE31AFB9204008FA782 /* Resources */, 192 | ); 193 | buildRules = ( 194 | ); 195 | dependencies = ( 196 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 197 | ); 198 | name = AR2DFaceDetector_Tests; 199 | productName = Tests; 200 | productReference = 607FACE51AFB9204008FA782 /* AR2DFaceDetector_Tests.xctest */; 201 | productType = "com.apple.product-type.bundle.unit-test"; 202 | }; 203 | /* End PBXNativeTarget section */ 204 | 205 | /* Begin PBXProject section */ 206 | 607FACC81AFB9204008FA782 /* Project object */ = { 207 | isa = PBXProject; 208 | attributes = { 209 | LastSwiftUpdateCheck = 0830; 210 | LastUpgradeCheck = 0830; 211 | ORGANIZATIONNAME = CocoaPods; 212 | TargetAttributes = { 213 | 607FACCF1AFB9204008FA782 = { 214 | CreatedOnToolsVersion = 6.3.1; 215 | DevelopmentTeam = FBQ6Z8AF3U; 216 | LastSwiftMigration = 0900; 217 | }; 218 | 607FACE41AFB9204008FA782 = { 219 | CreatedOnToolsVersion = 6.3.1; 220 | DevelopmentTeam = FBQ6Z8AF3U; 221 | LastSwiftMigration = 0900; 222 | TestTargetID = 607FACCF1AFB9204008FA782; 223 | }; 224 | }; 225 | }; 226 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "AR2DFaceDetector" */; 227 | compatibilityVersion = "Xcode 3.2"; 228 | developmentRegion = English; 229 | hasScannedForEncodings = 0; 230 | knownRegions = ( 231 | English, 232 | en, 233 | Base, 234 | ); 235 | mainGroup = 607FACC71AFB9204008FA782; 236 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 237 | projectDirPath = ""; 238 | projectRoot = ""; 239 | targets = ( 240 | 607FACCF1AFB9204008FA782 /* AR2DFaceDetector_Example */, 241 | 607FACE41AFB9204008FA782 /* AR2DFaceDetector_Tests */, 242 | ); 243 | }; 244 | /* End PBXProject section */ 245 | 246 | /* Begin PBXResourcesBuildPhase section */ 247 | 607FACCE1AFB9204008FA782 /* Resources */ = { 248 | isa = PBXResourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 252 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 253 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | 607FACE31AFB9204008FA782 /* Resources */ = { 258 | isa = PBXResourcesBuildPhase; 259 | buildActionMask = 2147483647; 260 | files = ( 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | /* End PBXResourcesBuildPhase section */ 265 | 266 | /* Begin PBXShellScriptBuildPhase section */ 267 | 33B89CDD891072BE82EB433B /* [CP] Embed Pods Frameworks */ = { 268 | isa = PBXShellScriptBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | inputPaths = ( 273 | "${PODS_ROOT}/Target Support Files/Pods-AR2DFaceDetector_Example/Pods-AR2DFaceDetector_Example-frameworks.sh", 274 | "${BUILT_PRODUCTS_DIR}/AR2DFaceDetector/AR2DFaceDetector.framework", 275 | ); 276 | name = "[CP] Embed Pods Frameworks"; 277 | outputPaths = ( 278 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AR2DFaceDetector.framework", 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | shellPath = /bin/sh; 282 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AR2DFaceDetector_Example/Pods-AR2DFaceDetector_Example-frameworks.sh\"\n"; 283 | showEnvVarsInLog = 0; 284 | }; 285 | E55FBE90A5A106C58C504E7C /* [CP] Check Pods Manifest.lock */ = { 286 | isa = PBXShellScriptBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | inputFileListPaths = ( 291 | ); 292 | inputPaths = ( 293 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 294 | "${PODS_ROOT}/Manifest.lock", 295 | ); 296 | name = "[CP] Check Pods Manifest.lock"; 297 | outputFileListPaths = ( 298 | ); 299 | outputPaths = ( 300 | "$(DERIVED_FILE_DIR)/Pods-AR2DFaceDetector_Tests-checkManifestLockResult.txt", 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | shellPath = /bin/sh; 304 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 305 | showEnvVarsInLog = 0; 306 | }; 307 | F285C7C2FF1C856B47DCC3DF /* [CP] Check Pods Manifest.lock */ = { 308 | isa = PBXShellScriptBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | ); 312 | inputFileListPaths = ( 313 | ); 314 | inputPaths = ( 315 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 316 | "${PODS_ROOT}/Manifest.lock", 317 | ); 318 | name = "[CP] Check Pods Manifest.lock"; 319 | outputFileListPaths = ( 320 | ); 321 | outputPaths = ( 322 | "$(DERIVED_FILE_DIR)/Pods-AR2DFaceDetector_Example-checkManifestLockResult.txt", 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | shellPath = /bin/sh; 326 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 327 | showEnvVarsInLog = 0; 328 | }; 329 | /* End PBXShellScriptBuildPhase section */ 330 | 331 | /* Begin PBXSourcesBuildPhase section */ 332 | 607FACCC1AFB9204008FA782 /* Sources */ = { 333 | isa = PBXSourcesBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 337 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | 607FACE11AFB9204008FA782 /* Sources */ = { 342 | isa = PBXSourcesBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 346 | ); 347 | runOnlyForDeploymentPostprocessing = 0; 348 | }; 349 | /* End PBXSourcesBuildPhase section */ 350 | 351 | /* Begin PBXTargetDependency section */ 352 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 353 | isa = PBXTargetDependency; 354 | target = 607FACCF1AFB9204008FA782 /* AR2DFaceDetector_Example */; 355 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 356 | }; 357 | /* End PBXTargetDependency section */ 358 | 359 | /* Begin PBXVariantGroup section */ 360 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 361 | isa = PBXVariantGroup; 362 | children = ( 363 | 607FACDA1AFB9204008FA782 /* Base */, 364 | ); 365 | name = Main.storyboard; 366 | sourceTree = ""; 367 | }; 368 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 369 | isa = PBXVariantGroup; 370 | children = ( 371 | 607FACDF1AFB9204008FA782 /* Base */, 372 | ); 373 | name = LaunchScreen.xib; 374 | sourceTree = ""; 375 | }; 376 | /* End PBXVariantGroup section */ 377 | 378 | /* Begin XCBuildConfiguration section */ 379 | 607FACED1AFB9204008FA782 /* Debug */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ALWAYS_SEARCH_USER_PATHS = NO; 383 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 384 | CLANG_CXX_LIBRARY = "libc++"; 385 | CLANG_ENABLE_MODULES = YES; 386 | CLANG_ENABLE_OBJC_ARC = YES; 387 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 388 | CLANG_WARN_BOOL_CONVERSION = YES; 389 | CLANG_WARN_COMMA = YES; 390 | CLANG_WARN_CONSTANT_CONVERSION = YES; 391 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 392 | CLANG_WARN_EMPTY_BODY = YES; 393 | CLANG_WARN_ENUM_CONVERSION = YES; 394 | CLANG_WARN_INFINITE_RECURSION = YES; 395 | CLANG_WARN_INT_CONVERSION = YES; 396 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 397 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 399 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 400 | CLANG_WARN_STRICT_PROTOTYPES = YES; 401 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 405 | COPY_PHASE_STRIP = NO; 406 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 407 | ENABLE_STRICT_OBJC_MSGSEND = YES; 408 | ENABLE_TESTABILITY = YES; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_DYNAMIC_NO_PIC = NO; 411 | GCC_NO_COMMON_BLOCKS = YES; 412 | GCC_OPTIMIZATION_LEVEL = 0; 413 | GCC_PREPROCESSOR_DEFINITIONS = ( 414 | "DEBUG=1", 415 | "$(inherited)", 416 | ); 417 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | IPHONEOS_DEPLOYMENT_TARGET = 11; 425 | MTL_ENABLE_DEBUG_INFO = YES; 426 | ONLY_ACTIVE_ARCH = YES; 427 | SDKROOT = iphoneos; 428 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 429 | }; 430 | name = Debug; 431 | }; 432 | 607FACEE1AFB9204008FA782 /* Release */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ALWAYS_SEARCH_USER_PATHS = NO; 436 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 437 | CLANG_CXX_LIBRARY = "libc++"; 438 | CLANG_ENABLE_MODULES = YES; 439 | CLANG_ENABLE_OBJC_ARC = YES; 440 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 441 | CLANG_WARN_BOOL_CONVERSION = YES; 442 | CLANG_WARN_COMMA = YES; 443 | CLANG_WARN_CONSTANT_CONVERSION = YES; 444 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 445 | CLANG_WARN_EMPTY_BODY = YES; 446 | CLANG_WARN_ENUM_CONVERSION = YES; 447 | CLANG_WARN_INFINITE_RECURSION = YES; 448 | CLANG_WARN_INT_CONVERSION = YES; 449 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 450 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 452 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 453 | CLANG_WARN_STRICT_PROTOTYPES = YES; 454 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 455 | CLANG_WARN_UNREACHABLE_CODE = YES; 456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 458 | COPY_PHASE_STRIP = NO; 459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 460 | ENABLE_NS_ASSERTIONS = NO; 461 | ENABLE_STRICT_OBJC_MSGSEND = YES; 462 | GCC_C_LANGUAGE_STANDARD = gnu99; 463 | GCC_NO_COMMON_BLOCKS = YES; 464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 466 | GCC_WARN_UNDECLARED_SELECTOR = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 468 | GCC_WARN_UNUSED_FUNCTION = YES; 469 | GCC_WARN_UNUSED_VARIABLE = YES; 470 | IPHONEOS_DEPLOYMENT_TARGET = 11; 471 | MTL_ENABLE_DEBUG_INFO = NO; 472 | SDKROOT = iphoneos; 473 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 474 | VALIDATE_PRODUCT = YES; 475 | }; 476 | name = Release; 477 | }; 478 | 607FACF01AFB9204008FA782 /* Debug */ = { 479 | isa = XCBuildConfiguration; 480 | baseConfigurationReference = 4D17A6CCE426D7E11487FF2E /* Pods-AR2DFaceDetector_Example.debug.xcconfig */; 481 | buildSettings = { 482 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 483 | DEVELOPMENT_TEAM = FBQ6Z8AF3U; 484 | INFOPLIST_FILE = AR2DFaceDetector/Info.plist; 485 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 486 | MODULE_NAME = ExampleApp; 487 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 488 | PRODUCT_NAME = "$(TARGET_NAME)"; 489 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 490 | SWIFT_VERSION = 4.0; 491 | }; 492 | name = Debug; 493 | }; 494 | 607FACF11AFB9204008FA782 /* Release */ = { 495 | isa = XCBuildConfiguration; 496 | baseConfigurationReference = 7C42C3DC598F88F5184B6948 /* Pods-AR2DFaceDetector_Example.release.xcconfig */; 497 | buildSettings = { 498 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 499 | DEVELOPMENT_TEAM = FBQ6Z8AF3U; 500 | INFOPLIST_FILE = AR2DFaceDetector/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 502 | MODULE_NAME = ExampleApp; 503 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 504 | PRODUCT_NAME = "$(TARGET_NAME)"; 505 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 506 | SWIFT_VERSION = 4.0; 507 | }; 508 | name = Release; 509 | }; 510 | 607FACF31AFB9204008FA782 /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | baseConfigurationReference = A723AA3EB32EF4E47A03AABF /* Pods-AR2DFaceDetector_Tests.debug.xcconfig */; 513 | buildSettings = { 514 | DEVELOPMENT_TEAM = FBQ6Z8AF3U; 515 | FRAMEWORK_SEARCH_PATHS = ( 516 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 517 | "$(inherited)", 518 | ); 519 | GCC_PREPROCESSOR_DEFINITIONS = ( 520 | "DEBUG=1", 521 | "$(inherited)", 522 | ); 523 | INFOPLIST_FILE = Tests/Info.plist; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 525 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 528 | SWIFT_VERSION = 4.0; 529 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AR2DFaceDetector_Example.app/AR2DFaceDetector_Example"; 530 | }; 531 | name = Debug; 532 | }; 533 | 607FACF41AFB9204008FA782 /* Release */ = { 534 | isa = XCBuildConfiguration; 535 | baseConfigurationReference = 87A4494C2042016F8B90046E /* Pods-AR2DFaceDetector_Tests.release.xcconfig */; 536 | buildSettings = { 537 | DEVELOPMENT_TEAM = FBQ6Z8AF3U; 538 | FRAMEWORK_SEARCH_PATHS = ( 539 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 540 | "$(inherited)", 541 | ); 542 | INFOPLIST_FILE = Tests/Info.plist; 543 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 544 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 545 | PRODUCT_NAME = "$(TARGET_NAME)"; 546 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 547 | SWIFT_VERSION = 4.0; 548 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AR2DFaceDetector_Example.app/AR2DFaceDetector_Example"; 549 | }; 550 | name = Release; 551 | }; 552 | /* End XCBuildConfiguration section */ 553 | 554 | /* Begin XCConfigurationList section */ 555 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "AR2DFaceDetector" */ = { 556 | isa = XCConfigurationList; 557 | buildConfigurations = ( 558 | 607FACED1AFB9204008FA782 /* Debug */, 559 | 607FACEE1AFB9204008FA782 /* Release */, 560 | ); 561 | defaultConfigurationIsVisible = 0; 562 | defaultConfigurationName = Release; 563 | }; 564 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AR2DFaceDetector_Example" */ = { 565 | isa = XCConfigurationList; 566 | buildConfigurations = ( 567 | 607FACF01AFB9204008FA782 /* Debug */, 568 | 607FACF11AFB9204008FA782 /* Release */, 569 | ); 570 | defaultConfigurationIsVisible = 0; 571 | defaultConfigurationName = Release; 572 | }; 573 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "AR2DFaceDetector_Tests" */ = { 574 | isa = XCConfigurationList; 575 | buildConfigurations = ( 576 | 607FACF31AFB9204008FA782 /* Debug */, 577 | 607FACF41AFB9204008FA782 /* Release */, 578 | ); 579 | defaultConfigurationIsVisible = 0; 580 | defaultConfigurationName = Release; 581 | }; 582 | /* End XCConfigurationList section */ 583 | }; 584 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 585 | } 586 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector.xcodeproj/xcshareddata/xcschemes/AR2DFaceDetector-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 80 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 99 | 101 | 107 | 108 | 109 | 110 | 112 | 113 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AR2DFaceDetector 4 | // 5 | // Created by noppefoxwolf on 08/17/2019. 6 | // Copyright (c) 2019 noppefoxwolf. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector/Base.lproj/Main.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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | NSCameraUsageDescription 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/AR2DFaceDetector/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ARFaceLandmarks2D 4 | // 5 | // Created by noppefoxwolf on 08/15/2019. 6 | // Copyright (c) 2019 noppefoxwolf. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ARKit 11 | import AR2DFaceDetector 12 | 13 | class ViewController: UIViewController, ARSCNViewDelegate { 14 | 15 | @IBOutlet weak var imageView: UIImageView! 16 | 17 | private let session = ARSession() 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | session.delegate = self 22 | } 23 | 24 | override func viewWillAppear(_ animated: Bool) { 25 | super.viewWillAppear(animated) 26 | let configuration = ARFaceTrackingConfiguration() 27 | session.run(configuration) 28 | } 29 | 30 | override func viewWillDisappear(_ animated: Bool) { 31 | super.viewWillDisappear(animated) 32 | session.pause() 33 | } 34 | } 35 | 36 | extension ViewController: ARSessionDelegate { 37 | func session(_ session: ARSession, didUpdate frame: ARFrame) { 38 | let detector = AR2DFaceDetector(frame: frame, orientation: .right) 39 | let size = detector.capturedImage.extent.size 40 | 41 | UIGraphicsBeginImageContext(size) 42 | let context = UIGraphicsGetCurrentContext()! 43 | UIImage(ciImage: detector.capturedImage).draw(at: .zero, blendMode: .overlay, alpha: 0.5) 44 | 45 | if let landmarks = detector.faces.first?.landmarks { 46 | 47 | context.setStrokeColor(UIColor.red.cgColor) 48 | context.addLines(between: landmarks.faceContour!.pointsInImage(imageSize: size)) 49 | context.strokePath() 50 | 51 | context.setStrokeColor(UIColor.green.cgColor) 52 | context.addLines(between: landmarks.noseCrest!.pointsInImage(imageSize: size)) 53 | context.strokePath() 54 | 55 | context.setStrokeColor(UIColor.blue.cgColor) 56 | context.addLines(between: landmarks.leftEye!.pointsInImage(imageSize: size)) 57 | context.strokePath() 58 | 59 | context.setStrokeColor(UIColor.blue.cgColor) 60 | context.addLines(between: landmarks.rightEye!.pointsInImage(imageSize: size)) 61 | context.strokePath() 62 | 63 | context.setStrokeColor(UIColor.blue.cgColor) 64 | context.addLines(between: landmarks.innerLips!.pointsInImage(imageSize: size)) 65 | context.strokePath() 66 | 67 | context.setStrokeColor(UIColor.blue.cgColor) 68 | context.addLines(between: landmarks.outerLips!.pointsInImage(imageSize: size)) 69 | context.strokePath() 70 | } 71 | 72 | let result = UIGraphicsGetImageFromCurrentImageContext() 73 | UIGraphicsEndImageContext() 74 | DispatchQueue.main.async { 75 | self.imageView.image = result 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'AR2DFaceDetector_Example' do 4 | pod 'AR2DFaceDetector', :path => '../' 5 | 6 | target 'AR2DFaceDetector_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AR2DFaceDetector (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - AR2DFaceDetector (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | AR2DFaceDetector: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | AR2DFaceDetector: df88780e4ccf4aa04f252a458bff71a23eb2994e 13 | 14 | PODFILE CHECKSUM: 4d068f29fa56a77c118b3206c17664bb7147fdc6 15 | 16 | COCOAPODS: 1.7.5 17 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import AR2DFaceDetector 3 | 4 | class Tests: XCTestCase { 5 | 6 | override func setUp() { 7 | super.setUp() 8 | // Put setup code here. This method is called before the invocation of each test method in the class. 9 | } 10 | 11 | override func tearDown() { 12 | // Put teardown code here. This method is called after the invocation of each test method in the class. 13 | super.tearDown() 14 | } 15 | 16 | func testExample() { 17 | // This is an example of a functional test case. 18 | XCTAssert(true, "Pass") 19 | } 20 | 21 | func testPerformanceExample() { 22 | // This is an example of a performance test case. 23 | self.measure() { 24 | // Put the code you want to measure the time of here. 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 noppefoxwolf 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://github.com/noppefoxwolf/AR2DFaceDetector/blob/master/.github/Logo.png) 2 | 3 | ## Usage 4 | 5 | ```swift 6 | func session(_ session: ARSession, didUpdate frame: ARFrame) { 7 | let detector = AR2DFaceDetector(frame: frame, orientation: .right) 8 | let size = detector.capturedImage.extent.size 9 | detector.faces.first?.landmarks.faceContour?.normalizedPoints 10 | } 11 | ``` 12 | 13 | ## Example 14 | 15 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 16 | 17 | ## Requirements 18 | 19 | ## Installation 20 | 21 | AR2DFaceDetector is available through [CocoaPods](https://cocoapods.org). To install 22 | it, simply add the following line to your Podfile: 23 | 24 | ```ruby 25 | pod 'AR2DFaceDetector' 26 | ``` 27 | 28 | ## Author 29 | 30 | noppefoxwolf, noppelabs@gmail.com 31 | 32 | ## License 33 | 34 | AR2DFaceDetector is available under the MIT license. See the LICENSE file for more info. 35 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------