diff --git a/iOS/Frameworks/dir.placeholder b/iOS/Frameworks/dir.placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/iOS/ModelRunner/AppDelegate.h b/iOS/ModelRunner/AppDelegate.h deleted file mode 100644 index 1b65b8fb..00000000 --- a/iOS/ModelRunner/AppDelegate.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface AppDelegate : UIResponder - -@property(nonatomic) UIWindow *window; - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOS/ModelRunner/AppDelegate.m b/iOS/ModelRunner/AppDelegate.m deleted file mode 100644 index 7cba102e..00000000 --- a/iOS/ModelRunner/AppDelegate.m +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#import "AppDelegate.h" - -NS_ASSUME_NONNULL_BEGIN - -@implementation AppDelegate -@end - -NS_ASSUME_NONNULL_END diff --git a/iOS/ModelRunner/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOS/ModelRunner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65..00000000 --- a/iOS/ModelRunner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/iOS/ModelRunner/Assets.xcassets/Contents.json b/iOS/ModelRunner/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/iOS/ModelRunner/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/iOS/ModelRunner/Base.lproj/LaunchScreen.storyboard b/iOS/ModelRunner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 6848cd7f..00000000 --- a/iOS/ModelRunner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOS/ModelRunner/Base.lproj/Main.storyboard b/iOS/ModelRunner/Base.lproj/Main.storyboard deleted file mode 100644 index 6390954a..00000000 --- a/iOS/ModelRunner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOS/ModelRunner/Info.plist b/iOS/ModelRunner/Info.plist deleted file mode 100644 index 78c07d2c..00000000 --- a/iOS/ModelRunner/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - - - diff --git a/iOS/ModelRunner/OrtSession.h b/iOS/ModelRunner/OrtSession.h deleted file mode 100644 index f2ac6193..00000000 --- a/iOS/ModelRunner/OrtSession.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#ifndef ort_session_h -#define ort_session_h - -#import - -// @class TFLInterpreterOptions; -// @class TFLTensor; - -NS_ASSUME_NONNULL_BEGIN - - -/** - * An OnnxRuntime Session - */ -@interface OrtMobileSession : NSObject - -- (nullable instancetype)initWithModelPath:(NSString *)modelPath error:(NSError **)error; -- (NSString*)run: (NSMutableData *)buff mname:(NSString*)mname error:(NSError **)error; - -@end - -NS_ASSUME_NONNULL_END - - -#endif /* ort_session_h */ diff --git a/iOS/ModelRunner/OrtSession.mm b/iOS/ModelRunner/OrtSession.mm deleted file mode 100644 index 30503cfd..00000000 --- a/iOS/ModelRunner/OrtSession.mm +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#import "OrtSession.h" - -#include -#include -#include - -#include - - -NS_ASSUME_NONNULL_BEGIN - - -static std::string run_mobilenet(Ort::Session* session) { - static const int width_ = 224; - static const int height_ = 224; - static const int classes = 1000; - - auto& input_image_ = *(new std::array()); - auto& results_ = *(new std::array); - - std::array input_shape_{1, 3, width_, height_}; - std::array output_shape_{1, classes}; - - auto memory_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU); - - auto input_tensor = Ort::Value::CreateTensor(memory_info, input_image_.data(), input_image_.size(), input_shape_.data(), input_shape_.size()); - auto output_tensor = Ort::Value::CreateTensor(memory_info, results_.data(), results_.size(), output_shape_.data(), output_shape_.size()); - - const char* input_names[] = {"data"}; - const char* output_names[] = {"mobilenetv20_output_flatten0_reshape0"}; - - // Start measuring time - auto begin = std::chrono::high_resolution_clock::now(); - session->Run(Ort::RunOptions{nullptr}, input_names, &input_tensor, 1, output_names, &output_tensor, 1); - - // Stop measuring time and calculate the elapsed time - auto end = std::chrono::high_resolution_clock::now(); - auto elapsed = std::chrono::duration_cast(end - begin); - - Ort::OrtRelease(input_tensor.release()); - Ort::OrtRelease(output_tensor.release()); - delete &input_image_; - delete &results_; - - std::ostringstream output; - output << "Total time: " << static_cast(elapsed.count() * 1e-3) << std::endl; - return output.str(); -} - -static std::string run_nlp(Ort::Session* session) { - auto memory_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU); - - auto input_shape = std::vector({5, 6}); - auto input = new std::array(); - std::generate(input->begin(), input->end(), []{return std::rand() % 109;}); - - auto output_shape = std::vector({5, 26}); - auto result = new std::array(); - - auto input_tensor = Ort::Value::CreateTensor(memory_info, input->data(), input->size(), input_shape.data(), input_shape.size()); - auto output_tensor = Ort::Value::CreateTensor(memory_info, result->data(), result->size(), output_shape.data(), output_shape.size()); - - const char* input_names[] = {"input_1"}; - const char* output_names[] = {"dense_1"}; - - // Start measuring time - auto begin = std::chrono::high_resolution_clock::now(); - session->Run(Ort::RunOptions{nullptr}, input_names, &input_tensor, 1, output_names, &output_tensor, 1); - - // Stop measuring time and calculate the elapsed time - auto end = std::chrono::high_resolution_clock::now(); - auto elapsed = std::chrono::duration_cast(end - begin); - - delete input; - delete result; - - std::ostringstream output; - output << "Total time: " << static_cast(elapsed.count() * 1e-3) << std::endl; - return output.str(); -} - -@interface OrtMobileSession () - -@property(nonatomic, nullable) Ort::Session* pOrtApiSession; - -@property(nonatomic, nullable) Ort::Value* input_tensor; - -@property(nonatomic, nullable) Ort::Value* output_tensor; - -@end - - -@implementation OrtMobileSession - -#pragma mark - NSObject - -- (void)dealloc { - if (_pOrtApiSession != nullptr) { - delete _pOrtApiSession; - _pOrtApiSession = nullptr; - } -} - -#pragma mark - Public - -static std::unique_ptr ort_env; - -- (nullable instancetype)initWithModelPath:(NSString *)modelPath error:(NSError **)error { - - self = [super init]; - if (_pOrtApiSession != nullptr) { - delete _pOrtApiSession; - _pOrtApiSession = nullptr; - } - ort_env.reset(); - - ort_env.reset(new Ort::Env(ORT_LOGGING_LEVEL_INFO, "Default")); - Ort::SessionOptions so(nullptr); - const char* model_path = [modelPath UTF8String]; - _pOrtApiSession = new Ort::Session(*ort_env, model_path, so); - return self; -} - -- (NSString* )run:(nonnull NSMutableData *)buff mname:(NSString*)mname error:(NSError *__autoreleasing _Nullable * _Nullable)error { - std::string sinfo; - if ([mname isEqualToString:@"mobilenet"]) { - sinfo = run_mobilenet(_pOrtApiSession); - } - else if ([mname isEqualToString:@"nlp"]) { - sinfo = run_nlp(_pOrtApiSession); - } - - NSString *resultMsg = [NSString stringWithCString:sinfo.c_str() - encoding:[NSString defaultCStringEncoding]]; - return resultMsg; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOS/ModelRunner/ViewController.h b/iOS/ModelRunner/ViewController.h deleted file mode 100644 index ace41f2c..00000000 --- a/iOS/ModelRunner/ViewController.h +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface ViewController : UIViewController -@end - -NS_ASSUME_NONNULL_END diff --git a/iOS/ModelRunner/ViewController.m b/iOS/ModelRunner/ViewController.m deleted file mode 100644 index ba217452..00000000 --- a/iOS/ModelRunner/ViewController.m +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#import "ViewController.h" - -#import "OrtSession.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - * Safely dispatches the given `block` on the main thread. If already on the main thread, the given - * block is executed immediately; otherwise, dispatches the block asynchronously on the main thread. - * - * @param block The block to dispatch on the main thread. - */ -void TLTSafeDispatchOnMain(dispatch_block_t block) { - if (block == nil) return; - if (NSThread.isMainThread) { - block(); - } else { - dispatch_async(dispatch_get_main_queue(), block); - } -} - -static NSString *const kModelNameMobileNet = @"mobilenetv2-7"; - -static NSString *const kModelNameQuantized = @"mobilenetv2-7"; - -static NSString *const kModelNameNLP = @"nlp"; - -/** Model resource type. */ -static NSString *const kModelType = @"ort"; - -/** The label for the serial queue for synchronizing runtime calls. */ -static const char *kRuntimeSerialQueueLabel = "com.onnxruntime.testapp"; - -static NSString *const kNilRuntimeError = - @"Failed to invoke the runtime because the runtime was nil."; -static NSString *const kInvokeRuntimeError = @"Failed to invoke ONNX Runtime due to error: %@."; - -/** Model paths. */ -static NSArray *arrModelPaths; - -@interface ViewController () - -/** Serial queue for synchronizing runtime calls. */ -@property(nonatomic) dispatch_queue_t runtimeSerialQueue; - -/** ONNXRuntime for the currently selected model. */ -@property(nonatomic) OrtMobileSession *runtime; - -@property(weak, nonatomic) IBOutlet UISegmentedControl *modelControl; -@property(weak, nonatomic) IBOutlet UIBarButtonItem *invokeButton; -@property(weak, nonatomic) IBOutlet UITextView *resultsTextView; - -@end - -@implementation ViewController - -#pragma mark - NSObject - -+ (void)initialize { - if (self == [ViewController self]) { - arrModelPaths = @[ - [NSBundle.mainBundle pathForResource:kModelNameMobileNet ofType:kModelType], - [NSBundle.mainBundle pathForResource:kModelNameQuantized ofType:kModelType], - [NSBundle.mainBundle pathForResource:kModelNameNLP ofType:kModelType], - ]; - } -} - -#pragma mark - UIViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - self.runtimeSerialQueue = - dispatch_queue_create(kRuntimeSerialQueueLabel, DISPATCH_QUEUE_SERIAL); - self.invokeButton.enabled = NO; - [self updateResultsText:[NSString stringWithFormat:@"Using ONNXRuntime runtime version %@.", @"1.5.0"]]; - [self loadModel]; -} - -#pragma mark - IBActions - -- (IBAction)modelChanged:(id)sender { - self.invokeButton.enabled = NO; - NSString *results = [NSString - stringWithFormat:@"Switched to the %@ model.", - [self.modelControl - titleForSegmentAtIndex:self.modelControl.selectedSegmentIndex]]; - [self updateResultsText:results]; - [self loadModel]; - -} - -- (IBAction)invokeRuntime:(id)sender { - switch (self.modelControl.selectedSegmentIndex) { - case 0: - [self invokeMobileNet]; - break; - case 1: - [self invokeQuantized]; - break; - case 2: - [self invokeNLP]; - } -} - -#pragma mark - Private - -/** Path of the currently selected model. */ -- (nullable NSString *)currentModelPath { - return self.modelControl.selectedSegmentIndex == UISegmentedControlNoSegment - ? nil - : arrModelPaths[self.modelControl.selectedSegmentIndex]; -} - -- (void)loadModel { - NSString *modelPath = [self currentModelPath]; - if (modelPath.length == 0) { - [self updateResultsText:@"No model is selected."]; - return; - } - - __weak typeof(self) weakSelf = self; - dispatch_async(self.runtimeSerialQueue, ^{ - NSError *error; - weakSelf.runtime = [[OrtMobileSession alloc] initWithModelPath:modelPath - error:&error]; - if (weakSelf.runtime == nil || error != nil) { - NSString *results = - [NSString stringWithFormat:@"Failed to create the runtime due to error:%@", - error.localizedDescription]; - [weakSelf updateResultsText:results]; - } else { - TLTSafeDispatchOnMain(^{ - weakSelf.invokeButton.enabled = YES; - }); - } - }); -} - -- (void)invokeMobileNet { - __weak typeof(self) weakSelf = self; - dispatch_async(self.runtimeSerialQueue, ^{ - if (weakSelf.runtime == nil) { - [weakSelf updateResultsText:kNilRuntimeError]; - return; - } - - NSError* error; - NSMutableData* data = [NSMutableData alloc]; - NSString *resultMsg = [weakSelf.runtime run:data mname:@"mobilenet" error:&error]; - [weakSelf updateResultsText:resultMsg]; - - }); -} - -- (void)invokeQuantized { - __weak typeof(self) weakSelf = self; - dispatch_async(self.runtimeSerialQueue, ^{ - if (weakSelf.runtime == nil) { - [weakSelf updateResultsText:kNilRuntimeError]; - return; - } - }); -} - -- (void)invokeNLP { - __weak typeof(self) weakSelf = self; - dispatch_async(self.runtimeSerialQueue, ^{ - if (weakSelf.runtime == nil) { - [weakSelf updateResultsText:kNilRuntimeError]; - return; - } - NSError* error; - NSMutableData* data = [NSMutableData alloc]; - NSString *resultMsg = [weakSelf.runtime run:data mname:@"nlp" error:&error]; - [weakSelf updateResultsText:resultMsg]; - }); -} - -- (void)updateResultsText:(NSString *)text { - __weak typeof(self) weakSelf = self; - TLTSafeDispatchOnMain(^{ - weakSelf.resultsTextView.text = text; - }); -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/iOS/ModelRunner/main.m b/iOS/ModelRunner/main.m deleted file mode 100644 index 33d7df9a..00000000 --- a/iOS/ModelRunner/main.m +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/iOS/Models/dir.placeholder b/iOS/Models/dir.placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/iOS/ONNXModelRunner.xcodeproj/project.pbxproj b/iOS/ONNXModelRunner.xcodeproj/project.pbxproj deleted file mode 100644 index 669c8f0d..00000000 --- a/iOS/ONNXModelRunner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,405 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - 61202FC924F7357100DCF250 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61202FC624F7357100DCF250 /* ViewController.m */; }; - 61202FCA24F7357100DCF250 /* OrtSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = 61202FC824F7357100DCF250 /* OrtSession.mm */; }; - 614B6546250C2DFF00570B69 /* nlp.ort in Resources */ = {isa = PBXBuildFile; fileRef = 614B6545250C2DFF00570B69 /* nlp.ort */; }; - 614B6548250C2E4900570B69 /* mobilenetv2-7.ort in Resources */ = {isa = PBXBuildFile; fileRef = 614B6547250C2E4900570B69 /* mobilenetv2-7.ort */; }; - 61B7341324F9AAD8009C4F8C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B210BD962291D78D00572163 /* Main.storyboard */; }; - 61B7341424F9AAD8009C4F8C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B210BD9B2291D78F00572163 /* LaunchScreen.storyboard */; }; - 61DFBA262519190800114A5C /* libonnxruntime.1.5.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 61DFBA252519190800114A5C /* libonnxruntime.1.5.0.dylib */; }; - 61DFBA2825191A4900114A5C /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 61DFBA2725191A4800114A5C /* README.md */; }; - 61DFBA2925191BD900114A5C /* libonnxruntime.1.5.0.dylib in Copy Files */ = {isa = PBXBuildFile; fileRef = 61DFBA252519190800114A5C /* libonnxruntime.1.5.0.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - B210BD922291D78D00572163 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B210BD912291D78D00572163 /* AppDelegate.m */; }; - B210BD9A2291D78E00572163 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B210BD992291D78E00572163 /* Assets.xcassets */; }; - B210BDA02291D78F00572163 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B210BD9F2291D78F00572163 /* main.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 614954D424F784EA00605437 /* Copy Files */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 61DFBA2925191BD900114A5C /* libonnxruntime.1.5.0.dylib in Copy Files */, - ); - name = "Copy Files"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 61202FC624F7357100DCF250 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 61202FC724F7357100DCF250 /* OrtSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrtSession.h; sourceTree = ""; }; - 61202FC824F7357100DCF250 /* OrtSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OrtSession.mm; sourceTree = ""; }; - 614B6545250C2DFF00570B69 /* nlp.ort */ = {isa = PBXFileReference; lastKnownFileType = file; name = nlp.ort; path = Models/nlp.ort; sourceTree = ""; }; - 614B6547250C2E4900570B69 /* mobilenetv2-7.ort */ = {isa = PBXFileReference; lastKnownFileType = file; name = "mobilenetv2-7.ort"; path = "Models/mobilenetv2-7.ort"; sourceTree = ""; }; - 61DFBA252519190800114A5C /* libonnxruntime.1.5.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libonnxruntime.1.5.0.dylib; path = "../../build/iOS/MinSizeRel/MinSizeRel-iphoneos/libonnxruntime.1.5.0.dylib"; sourceTree = ""; }; - 61DFBA2725191A4800114A5C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - B210BD8D2291D78D00572163 /* ONNXModelRunner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ONNXModelRunner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - B210BD902291D78D00572163 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - B210BD912291D78D00572163 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - B210BD932291D78D00572163 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - B210BD972291D78D00572163 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - B210BD992291D78E00572163 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - B210BD9C2291D78F00572163 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - B210BD9E2291D78F00572163 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B210BD9F2291D78F00572163 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - B210BD8A2291D78D00572163 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 61DFBA262519190800114A5C /* libonnxruntime.1.5.0.dylib in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 614954C424F76DF100605437 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 61DFBA252519190800114A5C /* libonnxruntime.1.5.0.dylib */, - ); - name = Frameworks; - sourceTree = ""; - }; - 61B7341524F9B775009C4F8C /* Models */ = { - isa = PBXGroup; - children = ( - 614B6547250C2E4900570B69 /* mobilenetv2-7.ort */, - 614B6545250C2DFF00570B69 /* nlp.ort */, - ); - name = Models; - sourceTree = ""; - }; - B210BD842291D78D00572163 = { - isa = PBXGroup; - children = ( - 61DFBA2725191A4800114A5C /* README.md */, - 61B7341524F9B775009C4F8C /* Models */, - B210BD8F2291D78D00572163 /* ModelRunner */, - B210BD8E2291D78D00572163 /* Products */, - 614954C424F76DF100605437 /* Frameworks */, - ); - sourceTree = ""; - }; - B210BD8E2291D78D00572163 /* Products */ = { - isa = PBXGroup; - children = ( - B210BD8D2291D78D00572163 /* ONNXModelRunner.app */, - ); - name = Products; - sourceTree = ""; - }; - B210BD8F2291D78D00572163 /* ModelRunner */ = { - isa = PBXGroup; - children = ( - 61202FC724F7357100DCF250 /* OrtSession.h */, - 61202FC824F7357100DCF250 /* OrtSession.mm */, - 61202FC624F7357100DCF250 /* ViewController.m */, - B210BD902291D78D00572163 /* AppDelegate.h */, - B210BD912291D78D00572163 /* AppDelegate.m */, - B210BD932291D78D00572163 /* ViewController.h */, - B210BD962291D78D00572163 /* Main.storyboard */, - B210BD992291D78E00572163 /* Assets.xcassets */, - B210BD9B2291D78F00572163 /* LaunchScreen.storyboard */, - B210BD9E2291D78F00572163 /* Info.plist */, - B210BD9F2291D78F00572163 /* main.m */, - ); - path = ModelRunner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - B210BD8C2291D78D00572163 /* ONNXModelRunner */ = { - isa = PBXNativeTarget; - buildConfigurationList = B210BDA32291D78F00572163 /* Build configuration list for PBXNativeTarget "ONNXModelRunner" */; - buildPhases = ( - B210BD892291D78D00572163 /* Sources */, - B210BD8A2291D78D00572163 /* Frameworks */, - B210BD8B2291D78D00572163 /* Resources */, - 614954D424F784EA00605437 /* Copy Files */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ONNXModelRunner; - productName = TestApp; - productReference = B210BD8D2291D78D00572163 /* ONNXModelRunner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - B210BD852291D78D00572163 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1010; - ORGANIZATIONNAME = Microsoft; - TargetAttributes = { - B210BD8C2291D78D00572163 = { - CreatedOnToolsVersion = 10.1; - }; - }; - }; - buildConfigurationList = B210BD882291D78D00572163 /* Build configuration list for PBXProject "ONNXModelRunner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = B210BD842291D78D00572163; - productRefGroup = B210BD8E2291D78D00572163 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - B210BD8C2291D78D00572163 /* ONNXModelRunner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - B210BD8B2291D78D00572163 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 61DFBA2825191A4900114A5C /* README.md in Resources */, - 614B6548250C2E4900570B69 /* mobilenetv2-7.ort in Resources */, - 614B6546250C2DFF00570B69 /* nlp.ort in Resources */, - 61B7341324F9AAD8009C4F8C /* Main.storyboard in Resources */, - 61B7341424F9AAD8009C4F8C /* LaunchScreen.storyboard in Resources */, - B210BD9A2291D78E00572163 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - B210BD892291D78D00572163 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 61202FC924F7357100DCF250 /* ViewController.m in Sources */, - B210BDA02291D78F00572163 /* main.m in Sources */, - 61202FCA24F7357100DCF250 /* OrtSession.mm in Sources */, - B210BD922291D78D00572163 /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - B210BD962291D78D00572163 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - B210BD972291D78D00572163 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - B210BD9B2291D78F00572163 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - B210BD9C2291D78F00572163 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - B210BDA12291D78F00572163 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - B210BDA22291D78F00572163 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B210BDA42291D78F00572163 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 0.0.2; - DEVELOPMENT_TEAM = QBMN2BBW3K; - HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../../include/onnxruntime"; - INFOPLIST_FILE = "$(SRCROOT)/ModelRunner/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.onnxruntime.TestApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Debug; - }; - B210BDA52291D78F00572163 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 0.0.2; - DEVELOPMENT_TEAM = QBMN2BBW3K; - FRAMEWORK_SEARCH_PATHS = ""; - HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../../include/onnxruntime"; - INFOPLIST_FILE = "$(SRCROOT)/ModelRunner/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.onnxruntime.TestApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B210BD882291D78D00572163 /* Build configuration list for PBXProject "ONNXModelRunner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B210BDA12291D78F00572163 /* Debug */, - B210BDA22291D78F00572163 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B210BDA32291D78F00572163 /* Build configuration list for PBXNativeTarget "ONNXModelRunner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B210BDA42291D78F00572163 /* Debug */, - B210BDA52291D78F00572163 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = B210BD852291D78D00572163 /* Project object */; -} diff --git a/iOS/ONNXModelRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOS/ONNXModelRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index a917c598..00000000 --- a/iOS/ONNXModelRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/iOS/ONNXModelRunner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/iOS/ONNXModelRunner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/iOS/ONNXModelRunner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/iOS/ONNXModelRunner.xcodeproj/xcshareddata/xcschemes/ModelRunner.xcscheme b/iOS/ONNXModelRunner.xcodeproj/xcshareddata/xcschemes/ModelRunner.xcscheme deleted file mode 100644 index 27974e6e..00000000 --- a/iOS/ONNXModelRunner.xcodeproj/xcshareddata/xcschemes/ModelRunner.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOS/README.md b/iOS/README.md deleted file mode 100644 index a323ed05..00000000 --- a/iOS/README.md +++ /dev/null @@ -1,10 +0,0 @@ -## ONNXRuntime iOS Sample - - -**Before build the app** - -1. create a soft link to the libonnxruntime.1.4.0.dylib to Framework directory. -2. Cook the reduced size ORT model by following the manual. And the model file names could be found are "mobilenetv2-7.ort" and "nlp.ort" which are temporary. - - -**open it as the xcode project, build and run the app**