Skip to content

CoreML watchOS xcode9 beta4

Sebastien Pouliot edited this page Jul 24, 2017 · 2 revisions

#CoreML.framework

diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes	2017-06-30 04:26:01.000000000 -0400
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes	2017-07-14 17:31:43.000000000 -0400
@@ -26,6 +26,9 @@
     - Selector: 'predictionFromFeatures:error:'
       SwiftName: prediction(from:)
       MethodKind: Instance
+    - Selector: 'predictionFromFeatures:options:error:'
+      SwiftName: prediction(from:options:)
+      MethodKind: Instance
 Protocols:
   - Name: MLFeatureProvider
     Methods:
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.h	2017-06-30 04:26:01.000000000 -0400
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/CoreML.h	2017-07-14 17:31:43.000000000 -0400
@@ -14,8 +14,15 @@
 #import <CoreML/MLDictionaryFeatureProvider.h>
 #import <CoreML/MLMultiArray.h>
 
+#import <CoreML/MLMultiArrayConstraint.h>
+#import <CoreML/MLImageConstraint.h>
+#import <CoreML/MLDictionaryConstraint.h>
+
 #import <CoreML/MLModel.h>
 #import <CoreML/MLModelDescription.h>
 #import <CoreML/MLModelMetadataKeys.h>
+#import <CoreML/MLPredictionOptions.h>
+
+#import <CoreML/MLModel+MLModelCompilation.h>
 
 #import <CoreML/MLModelError.h>
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLDictionaryConstraint.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLDictionaryConstraint.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLDictionaryConstraint.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLDictionaryConstraint.h	2017-07-14 17:31:43.000000000 -0400
@@ -0,0 +1,27 @@
+//
+//  MLDictionaryConstraint.h
+//  CoreML
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <CoreML/MLFeatureType.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+ * MLDictionaryConstraint
+ *
+ * Constraint describing expected NSDictionary properties
+ */
+API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0))
+@interface MLDictionaryConstraint : NSObject
+
+/// Required key type, described as MLFeatureType
+@property (readonly, nonatomic) MLFeatureType keyType;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureDescription.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureDescription.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureDescription.h	2017-06-30 04:26:01.000000000 -0400
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureDescription.h	2017-07-14 17:31:43.000000000 -0400
@@ -8,7 +8,9 @@
 #import <Foundation/Foundation.h>
 #import <CoreML/MLFeatureType.h>
 #import <CoreML/MLFeatureValue.h>
-
+#import <CoreML/MLDictionaryConstraint.h>
+#import <CoreML/MLMultiArrayConstraint.h>
+#import <CoreML/MLImageConstraint.h>
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -32,4 +34,21 @@
 
 @end
 
+/*!
+ * Feature value constraints for specific types
+ */
+API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0))
+@interface MLFeatureDescription (MLFeatureValueConstraints)
+
+/// Constraint when type == MLFeatureTypeMultiArray, nil otherwise
+@property (readwrite, nullable, nonatomic) MLMultiArrayConstraint *multiArrayConstraint;
+
+/// Constraint when type == MLFeatureTypeImage, nil otherwise
+@property (readwrite, nullable, nonatomic) MLImageConstraint *imageConstraint;
+
+/// Constraint when type == MLFeatureTypeDictionary, nil otherwise
+@property (readwrite, nullable, nonatomic) MLDictionaryConstraint *dictionaryConstraint;
+
+@end
+
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLImageConstraint.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLImageConstraint.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLImageConstraint.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLImageConstraint.h	2017-07-14 17:31:43.000000000 -0400
@@ -0,0 +1,31 @@
+//
+//  MLImageConstraint.h
+//  CoreML
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+ * MLImageConstraint
+ *
+ * Constraint on image properties.
+ */
+API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0))
+@interface MLImageConstraint : NSObject
+
+/// The required height of the image
+@property (readonly, nonatomic) NSInteger pixelsHigh;
+
+/// The required width of the image
+@property (readonly, nonatomic) NSInteger pixelsWide;
+
+/// The accepted kCVPixelFormatType for the image.
+@property (readonly, nonatomic) OSType pixelFormatType;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel+MLModelCompilation.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel+MLModelCompilation.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel+MLModelCompilation.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel+MLModelCompilation.h	2017-07-14 17:31:43.000000000 -0400
@@ -0,0 +1,41 @@
+//
+//  MLModel+MLModelCompilation.h
+//  CoreML
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+#import <Foundation/Foundation.h>
+#import <CoreML/MLModel.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+ * MLModel (MLModelCompilation)
+ *
+ * Class with utilties for performing .mlmodel compilation
+ */
+@interface MLModel (MLModelCompilation)
+
+/*!
+ * Compile a .mlmodel for this device
+ *
+ * @param modelURL URL file path to .mlmodel file you wish to compile
+ * @param error Any errors are surfaced here
+ *
+ * @returns a URL to the compiled .mlmodelc bundle if successful
+ * The model is compiled to a temporary location on disk
+ * You must move the compiled model to a permenant location if you wish to keep it
+ *
+ * @discussion the returned model can be loaded using:
+ * @code
+ * [MLModel modelWithContentsOfURL:error:]
+ * @endcode
+ *
+ */
++ (nullable NSURL *)compileModelAtURL:(NSURL *)modelURL
+                                error:(NSError **)error
+                                API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0)) __WATCHOS_UNAVAILABLE;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel.h	2017-06-30 04:26:01.000000000 -0400
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModel.h	2017-07-14 17:31:43.000000000 -0400
@@ -8,6 +8,7 @@
 #import <Foundation/Foundation.h>
 #import <CoreML/MLModelDescription.h>
 #import <CoreML/MLFeatureProvider.h>
+#import <CoreML/MLPredictionOptions.h>
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -32,6 +33,10 @@
 - (nullable id<MLFeatureProvider>)predictionFromFeatures:(id<MLFeatureProvider>)input
                                                    error:(NSError **)error;
 
+/// Prediction with explict options
+- (nullable id<MLFeatureProvider>)predictionFromFeatures:(id<MLFeatureProvider>)input
+                                                 options:(MLPredictionOptions *)options
+                                                   error:(NSError **)error;
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModelError.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModelError.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModelError.h	2017-06-30 04:26:01.000000000 -0400
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLModelError.h	2017-07-14 17:31:43.000000000 -0400
@@ -14,7 +14,6 @@
 typedef enum MLModelError : NSInteger {
     MLModelErrorGeneric = 0,
     MLModelErrorFeatureType = 1,
-    MLModelErrorDescriptionMismatch = 2,
     MLModelErrorIO = 3,
 } MLModelError API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArrayConstraint.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArrayConstraint.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArrayConstraint.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArrayConstraint.h	2017-07-14 17:31:43.000000000 -0400
@@ -0,0 +1,27 @@
+//
+//  MLMultiArrayConstraint.h
+//  CoreML
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <CoreML/MLMultiArray.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+ * Constraint describing expected MLMultiArray properties
+ */
+@interface MLMultiArrayConstraint : NSObject
+
+/// Required shape of array
+@property (readonly, nonatomic) NSArray<NSNumber *> *shape;
+
+/// Required dataType
+@property (readonly, nonatomic) MLMultiArrayDataType dataType;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
diff -ruN /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLPredictionOptions.h /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLPredictionOptions.h
--- /Applications/Xcode9-beta3.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLPredictionOptions.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta4.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/CoreML.framework/Headers/MLPredictionOptions.h	2017-07-14 17:31:43.000000000 -0400
@@ -0,0 +1,26 @@
+//
+//  MLPredictionOptions.h
+//  CoreML
+//
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/*!
+ * MLPredictionOptions
+ *
+ * An object to hold options / controls / parameters of how
+ * model prediction is performed
+ */
+API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0))
+@interface MLPredictionOptions : NSObject
+
+// Set to YES to force computation to be on the CPU only
+@property (readwrite, nonatomic) BOOL usesCPUOnly;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
Clone this wiki locally