Created
August 16, 2017 16:27
-
-
Save boaerosuke/f58352ec342d376df06c91971527bd2f to your computer and use it in GitHub Desktop.
Perform a VNCoreMLRequest with VNImageRequestHandler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary *options_dict = [[NSDictionary alloc] init]; | |
NSArray *request_array = @[request]; | |
VNImageRequestHandler *handler = [[VNImageRequestHandler alloc] initWithCIImage:self.imageToDetect options:options_dict]; | |
dispatch_queue_t myCustomQueue; | |
myCustomQueue = dispatch_queue_create("com.aname.VNImageRequestHandlerQueue", NULL); | |
self.resultLabel.text = @"Predicting..."; | |
dispatch_sync(myCustomQueue, ^{ | |
[handler performRequests:request_array error:nil]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment