Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Updated to latest XCode 9 beta and found a couple of issues #1

Open
enzyme69 opened this issue Sep 2, 2017 · 5 comments
Open

Updated to latest XCode 9 beta and found a couple of issues #1

enzyme69 opened this issue Sep 2, 2017 · 5 comments

Comments

@enzyme69
Copy link

enzyme69 commented Sep 2, 2017

Revision: if let points = landmark?.normalizedPoints, let count = landmark?.pointCount {

But getting more errors:
Cannot convert value of type '[CGPoint]' to expected argument type 'UnsafePointer<vector_float2>' (aka 'UnsafePointer')

@pr0n
Copy link

pr0n commented Sep 10, 2017

Did you resolve the problem? If yes, can you share or commit your method?

@djk12587
Copy link

Replace the convertPointsForFace with below, and it will work.

func convertPointsForFace(_ landmark: VNFaceLandmarkRegion2D?, _ boundingBox: CGRect) {
        if let points = landmark?.normalizedPoints {
            let faceLandmarkPoints = points.map { (point: CGPoint) -> (x: CGFloat, y: CGFloat) in
                let pointX = point.x * boundingBox.width + boundingBox.origin.x
                let pointY = point.y * boundingBox.height + boundingBox.origin.y
                
                return (x: pointX, y: pointY)
            }
            
            DispatchQueue.main.async {
                self.draw(points: faceLandmarkPoints)
            }
        }
    }

@pr0n
Copy link

pr0n commented Sep 15, 2017

Thanks for your sharing!

@pournam
Copy link

pournam commented Nov 24, 2017

Im still getting this with the new function:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-
[VNFaceLandmarkRegion2D normalizedPoints]: unrecognized selector sent to instance

Any ideas?

@panky8070
Copy link

Thanks for sharing the code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants