We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
private func cropImage(object: VNDetectedObjectObservation, padding: UIEdgeInsets) -> (image: CGImage, frame: CGRect)? { let width = object.boundingBox.width * CGFloat(detectable.width) let height = object.boundingBox.height * CGFloat(detectable.height) let x = object.boundingBox.origin.x * CGFloat(detectable.width) let y = (1 - object.boundingBox.origin.y) * CGFloat(detectable.height) - height let croppingRect = CGRect(x: x - padding.left, y: y - padding.top, width: width + (padding.left + padding.right), height: height + (padding.top + padding.bottom)) guard let image = self.detectable.cropping(to: croppingRect) else { return nil } return (image: image, frame: croppingRect) }
The text was updated successfully, but these errors were encountered:
There are 2 different coordinate systems we have to convert between.
I found that the Vision cannot fully recognize faces, so I added a padding property.
Sorry, something went wrong.
Thanks
No branches or pull requests
The text was updated successfully, but these errors were encountered: