Skip to content

Instantly share code, notes, and snippets.

@jbadger3
Created June 12, 2020 04:28
Show Gist options
  • Save jbadger3/f6aa954b0c0a4235e80c3b1b29b153bc to your computer and use it in GitHub Desktop.
Save jbadger3/f6aa954b0c0a4235e80c3b1b29b153bc to your computer and use it in GitHub Desktop.
let requestHandler = VNImageRequestHandler(url: inputImageURL)
let request = VNDetectRectanglesRequest { request, error in
self.completedVisionRequest(request, error: error)
}
// perform additional request configuration
request.usesCPUOnly = false //allow Vision to utilize the GPU
DispatchQueue.global().async {
do {
try requestHandler.perform([request])
} catch {
print("Error: Rectangle detection failed - vision request failed.")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment