Skip to content

Commit

Permalink
link necessary libraries in predictions test targets
Browse files Browse the repository at this point in the history
  • Loading branch information
atierian committed Oct 9, 2023
1 parent 80d5334 commit ac40901
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@
90542370291425630000D108 /* testImageCeleb.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542363291425630000D108 /* testImageCeleb.jpg */; };
90542371291425630000D108 /* testImageTextForms.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542364291425630000D108 /* testImageTextForms.jpg */; };
90542372291425630000D108 /* audio.wav in Resources */ = {isa = PBXBuildFile; fileRef = 90542365291425630000D108 /* audio.wav */; };
90CF304A2AD47A71006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30492AD47A71006B6FF3 /* Amplify */; };
90CF304C2AD47A74006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304B2AD47A74006B6FF3 /* Amplify */; };
90CF304E2AD47A78006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304D2AD47A78006B6FF3 /* Amplify */; };
90CF30502AD47B0E006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */; };
90CF30522AD47B0E006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */; };
90CF30542AD47B0E006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */; };
90CF30562AD47B19006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */; };
90CF30582AD47B19006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */; };
90CF305A2AD47B19006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */; };
90CF305C2AD47B24006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */; };
90CF305E2AD47B24006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */; };
90CF30602AD47B24006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -125,6 +137,10 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
90CF30602AD47B24006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */,
90CF304E2AD47A78006B6FF3 /* Amplify in Frameworks */,
90CF305E2AD47B24006B6FF3 /* AWSPredictionsPlugin in Frameworks */,
90CF305C2AD47B24006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -143,13 +159,21 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
90CF30542AD47B0E006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */,
90CF304A2AD47A71006B6FF3 /* Amplify in Frameworks */,
90CF30522AD47B0E006B6FF3 /* AWSPredictionsPlugin in Frameworks */,
90CF30502AD47B0E006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
903555F529141355004B83C2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
90CF305A2AD47B19006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */,
90CF304C2AD47A74006B6FF3 /* Amplify in Frameworks */,
90CF30582AD47B19006B6FF3 /* AWSPredictionsPlugin in Frameworks */,
90CF30562AD47B19006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -312,6 +336,10 @@
);
name = AWSPredictionsPluginIntegrationTestsWatch;
packageProductDependencies = (
90CF304D2AD47A78006B6FF3 /* Amplify */,
90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */,
90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */,
90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */,
);
productName = AWSPredictionsPluginIntegrationTests;
productReference = 6875F9242A3CCCB7001C9AAF /* AWSPredictionsPluginIntegrationTestsWatch.xctest */;
Expand Down Expand Up @@ -355,6 +383,12 @@
90283038291402D500897087 /* PBXTargetDependency */,
);
name = CoreMLPredictionsPluginIntegrationTests;
packageProductDependencies = (
90CF30492AD47A71006B6FF3 /* Amplify */,
90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */,
90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */,
90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */,
);
productName = CoreMLPredictionsPluginIntegrationTests;
productReference = 90283033291402D500897087 /* CoreMLPredictionsPluginIntegrationTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
Expand All @@ -374,6 +408,10 @@
);
name = AWSPredictionsPluginIntegrationTests;
packageProductDependencies = (
90CF304B2AD47A74006B6FF3 /* Amplify */,
90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */,
90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */,
90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */,
);
productName = AWSPredictionsPluginIntegrationTests;
productReference = 903555F829141355004B83C2 /* AWSPredictionsPluginIntegrationTests.xctest */;
Expand Down Expand Up @@ -1118,6 +1156,54 @@
isa = XCSwiftPackageProductDependency;
productName = CoreMLPredictionsPlugin;
};
90CF30492AD47A71006B6FF3 /* Amplify */ = {
isa = XCSwiftPackageProductDependency;
productName = Amplify;
};
90CF304B2AD47A74006B6FF3 /* Amplify */ = {
isa = XCSwiftPackageProductDependency;
productName = Amplify;
};
90CF304D2AD47A78006B6FF3 /* Amplify */ = {
isa = XCSwiftPackageProductDependency;
productName = Amplify;
};
90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = AWSCognitoAuthPlugin;
};
90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = AWSPredictionsPlugin;
};
90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = CoreMLPredictionsPlugin;
};
90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = AWSCognitoAuthPlugin;
};
90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = AWSPredictionsPlugin;
};
90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = CoreMLPredictionsPlugin;
};
90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = AWSCognitoAuthPlugin;
};
90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = AWSPredictionsPlugin;
};
90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = CoreMLPredictionsPlugin;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 90282FFA2914027000897087 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import SwiftUI
import Amplify

struct ContentView: View {


var body: some View {
VStack {
Image(systemName: "globe")
Expand All @@ -22,70 +20,6 @@ struct ContentView: View {
.accessibilityLabel("foobar")
.padding()
}

func convert() async throws {
let url = URL(string: "")!
let textToSpeech = try await Amplify.Predictions.convert(.textToSpeech("hello, world!"))
_ = textToSpeech
let speechToText = try await Amplify.Predictions.convert(.speechToText(url: url))
_ = speechToText
}

func identify() async throws {
let imageURL = URL(string: "")!
let identifyTextOptions = Predictions.Identify.Options(
defaultNetworkPolicy: .auto,
uploadToRemote: false,
pluginOptions: nil
)

let text = try await Amplify.Predictions.identify(
.text,
in: imageURL,
options: identifyTextOptions
)

_ = text
let celebrities = try await Amplify.Predictions.identify(.celebrities, in: imageURL)
_ = celebrities
let entities = try await Amplify.Predictions.identify(.entities, in: imageURL)
_ = entities
let entitiesFromCollection = try await Amplify.Predictions.identify(
.entitiesFromCollection(withID: ""),
in: imageURL
)
_ = entitiesFromCollection
let allLabels = try await Amplify.Predictions.identify(
.labels(type: .all),
in: imageURL
)
_ = allLabels
let labels = try await Amplify.Predictions.identify(
.labels(type: .labels),
in: imageURL
)
_ = labels
let moderationLabels = try await Amplify.Predictions.identify(
.labels(type: .moderation),
in: imageURL
)
_ = moderationLabels
let textFromDocAll = try await Amplify.Predictions.identify(
.textInDocument(textFormatType: .all),
in: imageURL
)
_ = textFromDocAll
let textFromDocForm = try await Amplify.Predictions.identify(
.textInDocument(textFormatType: .form),
in: imageURL
)
_ = textFromDocForm
let textFromDocTable = try await Amplify.Predictions.identify(
.textInDocument(textFormatType: .table),
in: imageURL
)
_ = textFromDocTable
}
}

struct ContentView_Previews: PreviewProvider {
Expand Down

0 comments on commit ac40901

Please sign in to comment.