LookoutVision
Service object for interacting with AWS LookoutVision service.
public struct LookoutVision: AWSService
This is the Amazon Lookout for Vision API Reference. It provides descriptions of actions, data types, common parameters, and common errors.
Amazon Lookout for Vision enables you to find visual defects in industrial products, accurately and at scale. It uses computer vision to identify missing components in an industrial product, damage to vehicles or structures, irregularities in production lines, and even minuscule defects in silicon wafers — or any other physical item where quality is important such as a missing capacitor on printed circuit boards.
Inheritance
AWSService
Initializers
init(client:region:partition:endpoint:timeout:byteBufferAllocator:options:)
Initialize the LookoutVision client
public init(
client: AWSClient,
region: SotoCore.Region? = nil,
partition: AWSPartition = .aws,
endpoint: String? = nil,
timeout: TimeAmount? = nil,
byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
options: AWSServiceConfig.Options = []
)
Parameters
- client: AWSClient used to process requests
- region: Region of server you want to communicate with. This will override the partition parameter.
- partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
- endpoint: Custom endpoint URL to use instead of standard AWS servers
- timeout: Timeout value for HTTP requests
init(from:patch:)
Initializer required by AWSService.with(middlewares:timeout:byteBufferAllocator:options)
. You are not able to use this initializer directly as there are no public initializers for AWSServiceConfig.Patch
. Please use AWSService.with(middlewares:timeout:byteBufferAllocator:options)
instead.
public init(from: LookoutVision, patch: AWSServiceConfig.Patch)
Properties
client
Client used for communication with AWS
public let client: AWSClient
config
Service configuration
public let config: AWSServiceConfig
Methods
createDataset(_:logger:on:)
public func createDataset(_ input: CreateDatasetRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<CreateDatasetResponse>
Creates a new dataset in an Amazon Lookout for Vision project. CreateDataset
can create a
training or a test dataset from a valid dataset source (DatasetSource
).
If you want a single dataset project, specify train
for the value of
DatasetType
.
To have a project with separate training and test datasets, call CreateDataset
twice.
On the first call, specify train
for the value of
DatasetType
. On the second call, specify test
for the value of
DatasetType
.
This operation requires permissions to perform the
lookoutvision:CreateDataset
operation.
createModel(_:logger:on:)
public func createModel(_ input: CreateModelRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<CreateModelResponse>
Creates a new version of a model within an an Amazon Lookout for Vision project.
CreateModel
is an asynchronous operation in which Amazon Lookout for Vision trains, tests,
and evaluates a new version of a model.
To get the current status, check the Status
field returned
in the response from DescribeModel.
If the project has a single dataset, Amazon Lookout for Vision internally splits the dataset to create a training and a test dataset. If the project has a training and a test dataset, Lookout for Vision uses the respective datasets to train and test the model.
After training completes, the evaluation metrics are stored at the location specified in
OutputConfig
.
This operation requires permissions to perform the
lookoutvision:CreateModel
operation. If you want to tag your model, you also require
permission to the lookoutvision:TagResource
operation.
createProject(_:logger:on:)
public func createProject(_ input: CreateProjectRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<CreateProjectResponse>
Creates an empty Amazon Lookout for Vision project. After you create the project, add a dataset by calling CreateDataset.
This operation requires permissions to perform the
lookoutvision:CreateProject
operation.
deleteDataset(_:logger:on:)
public func deleteDataset(_ input: DeleteDatasetRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DeleteDatasetResponse>
Deletes an existing Amazon Lookout for Vision dataset
.
If your the project has a single dataset, you must create a new dataset before you can create a model.
If you project has a training dataset and a test dataset consider the following.
-
If you delete the test dataset, your project reverts to a single dataset project. If you then train the model, Amazon Lookout for Vision internally splits the remaining dataset into a training and test dataset.
-
If you delete the training dataset, you must create a training dataset before you can create a model.
This operation requires permissions to perform the
lookoutvision:DeleteDataset
operation.
deleteModel(_:logger:on:)
public func deleteModel(_ input: DeleteModelRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DeleteModelResponse>
Deletes an Amazon Lookout for Vision model. You can't delete a running model. To stop a running model, use the StopModel operation.
It might take a few seconds to delete a model. To determine if a model has been deleted, call
ListModels and check if the version of the model (ModelVersion
) is in the
Models
array.
This operation requires permissions to perform the
lookoutvision:DeleteModel
operation.
deleteProject(_:logger:on:)
public func deleteProject(_ input: DeleteProjectRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DeleteProjectResponse>
Deletes an Amazon Lookout for Vision project.
To delete a project, you must first delete each version of the model associated with the project. To delete a model use the DeleteModel operation.
You also have to delete the dataset(s) associated with the model. For more information, see DeleteDataset. The images referenced by the training and test datasets aren't deleted.
This operation requires permissions to perform the
lookoutvision:DeleteProject
operation.
describeDataset(_:logger:on:)
public func describeDataset(_ input: DescribeDatasetRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DescribeDatasetResponse>
Describe an Amazon Lookout for Vision dataset.
This operation requires permissions to perform the
lookoutvision:DescribeDataset
operation.
describeModel(_:logger:on:)
public func describeModel(_ input: DescribeModelRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DescribeModelResponse>
Describes a version of an Amazon Lookout for Vision model.
This operation requires permissions to perform the
lookoutvision:DescribeModel
operation.
describeModelPackagingJob(_:logger:on:)
public func describeModelPackagingJob(_ input: DescribeModelPackagingJobRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DescribeModelPackagingJobResponse>
Describes an Amazon Lookout for Vision model packaging job.
This operation requires permissions to perform the
lookoutvision:DescribeModelPackagingJob
operation.
<p>For more information, see
<i>Using your Amazon Lookout for Vision model on an edge device</i> in the Amazon Lookout for Vision Developer Guide. </p>
describeProject(_:logger:on:)
public func describeProject(_ input: DescribeProjectRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DescribeProjectResponse>
Describes an Amazon Lookout for Vision project.
This operation requires permissions to perform the
lookoutvision:DescribeProject
operation.
detectAnomalies(_:logger:on:)
public func detectAnomalies(_ input: DetectAnomaliesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DetectAnomaliesResponse>
Detects anomalies in an image that you supply.
The response from DetectAnomalies
includes a boolean prediction
that the image contains one or more anomalies and a confidence value for the prediction.
Before calling DetectAnomalies
, you must first start your model with the StartModel operation.
You are charged for the amount of time, in minutes, that a model runs and for the number of anomaly detection units that your
model uses. If you are not using a model, use the StopModel operation to stop your model.
This operation requires permissions to perform the
lookoutvision:DetectAnomalies
operation.
listDatasetEntries(_:logger:on:)
public func listDatasetEntries(_ input: ListDatasetEntriesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListDatasetEntriesResponse>
Lists the JSON Lines within a dataset. An Amazon Lookout for Vision JSON Line contains the anomaly information for a single image, including the image location and the assigned label.
This operation requires permissions to perform the
lookoutvision:ListDatasetEntries
operation.
listModelPackagingJobs(_:logger:on:)
public func listModelPackagingJobs(_ input: ListModelPackagingJobsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListModelPackagingJobsResponse>
Lists the model packaging jobs created for an Amazon Lookout for Vision project.
This operation requires permissions to perform the
lookoutvision:ListModelPackagingJobs
operation.
<p>For more information, see
<i>Using your Amazon Lookout for Vision model on an edge device</i> in the Amazon Lookout for Vision Developer Guide. </p>
listModels(_:logger:on:)
public func listModels(_ input: ListModelsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListModelsResponse>
Lists the versions of a model in an Amazon Lookout for Vision project.
The ListModels
operation is eventually consistent.
Recent calls to CreateModel
might
take a while to appear in the response from ListProjects
.
This operation requires permissions to perform the
lookoutvision:ListModels
operation.
listProjects(_:logger:on:)
public func listProjects(_ input: ListProjectsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListProjectsResponse>
Lists the Amazon Lookout for Vision projects in your AWS account.
The ListProjects
operation is eventually consistent.
Recent calls to CreateProject
and DeleteProject
might
take a while to appear in the response from ListProjects
.
This operation requires permissions to perform the
lookoutvision:ListProjects
operation.
listTagsForResource(_:logger:on:)
public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListTagsForResourceResponse>
Returns a list of tags attached to the specified Amazon Lookout for Vision model.
This operation requires permissions to perform the
lookoutvision:ListTagsForResource
operation.
startModel(_:logger:on:)
public func startModel(_ input: StartModelRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<StartModelResponse>
Starts the running of the version of an Amazon Lookout for Vision model. Starting a model takes a while to complete. To check the current state of the model, use DescribeModel.
A model is ready to use when its status is HOSTED
.
Once the model is running, you can detect custom labels in new images by calling DetectAnomalies.
You are charged for the amount of time that the model is running. To stop a running model, call StopModel.
This operation requires permissions to perform the
lookoutvision:StartModel
operation.
startModelPackagingJob(_:logger:on:)
The model packaging job is complete if the value of Status
is SUCCEEDED
.
To deploy the component to the target device, use the component name and component version with the AWS IoT Greengrass CreateDeployment API.
This operation requires the following permissions:
-
lookoutvision:StartModelPackagingJob
-
s3:PutObject
-
s3:GetBucketLocation
-
greengrass:CreateComponentVersion
-
greengrass:DescribeComponent
-
(Optional)
greengrass:TagResource
. Only required if you want to tag the component.
public func startModelPackagingJob(_ input: StartModelPackagingJobRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<StartModelPackagingJobResponse>
Starts an Amazon Lookout for Vision model packaging job. A model packaging job creates an AWS IoT Greengrass component for a Lookout for Vision model. You can use the component to deploy your model to an edge device managed by Greengrass.
<p>Use the <a>DescribeModelPackagingJob</a> API to determine the current status of the job.
<p>For more information, see
<i>Using your Amazon Lookout for Vision model on an edge device</i> in the Amazon Lookout for Vision Developer Guide. </p>
stopModel(_:logger:on:)
public func stopModel(_ input: StopModelRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<StopModelResponse>
Stops the hosting of a running model. The operation might take a while to complete. To check the current status, call DescribeModel.
After the model hosting stops, the Status
of the model is TRAINED
.
This operation requires permissions to perform the
lookoutvision:StopModel
operation.
tagResource(_:logger:on:)
public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<TagResourceResponse>
Adds one or more key-value tags to an Amazon Lookout for Vision model. For more information, see Tagging a model in the Amazon Lookout for Vision Developer Guide.
This operation requires permissions to perform the
lookoutvision:TagResource
operation.
untagResource(_:logger:on:)
public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<UntagResourceResponse>
Removes one or more tags from an Amazon Lookout for Vision model. For more information, see Tagging a model in the Amazon Lookout for Vision Developer Guide.
This operation requires permissions to perform the
lookoutvision:UntagResource
operation.
updateDatasetEntries(_:logger:on:)
public func updateDatasetEntries(_ input: UpdateDatasetEntriesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<UpdateDatasetEntriesResponse>
Adds or updates one or more JSON Line entries in a dataset. A JSON Line includes information about an image used for training or testing an Amazon Lookout for Vision model.
To update an existing JSON Line, use the source-ref
field to identify the JSON Line. The JSON line
that you supply replaces the existing JSON line. Any existing annotations that are not in the new JSON line are removed from the dataset.
<p>For more information, see
<i>Defining JSON lines for anomaly classification</i> in the Amazon Lookout for Vision Developer Guide. </p>
<note>
<p>The images you reference in the <code>source-ref</code> field of a JSON line, must be
in the same S3 bucket as the existing images in the dataset. </p>
</note>
<p>Updating a dataset might take a while to complete. To check the current status, call <a>DescribeDataset</a> and
check the <code>Status</code> field in the response.</p>
<p>This operation requires permissions to perform the
<code>lookoutvision:UpdateDatasetEntries</code> operation.</p>
listDatasetEntriesPaginator(_:logger:on:)
compiler(>=5.5.2) && canImport(_Concurrency)
public func listDatasetEntriesPaginator( _ input: ListDatasetEntriesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil ) -> AWSClient.PaginatorSequence<ListDatasetEntriesRequest, ListDatasetEntriesResponse>
Lists the JSON Lines within a dataset. An Amazon Lookout for Vision JSON Line contains the anomaly information for a single image, including the image location and the assigned label.
This operation requires permissions to perform the
Return PaginatorSequence for operation. - Parameters: - input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process onlookoutvision:ListDatasetEntries
operation.
listModelPackagingJobsPaginator(_:logger:on:)
compiler(>=5.5.2) && canImport(_Concurrency)
-
Return PaginatorSequence for operation.
public func listModelPackagingJobsPaginator( _ input: ListModelPackagingJobsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil ) -> AWSClient.PaginatorSequence<ListModelPackagingJobsRequest, ListModelPackagingJobsResponse>
Lists the model packaging jobs created for an Amazon Lookout for Vision project.
This operation requires permissions to perform the
lookoutvision:ListModelPackagingJobs
operation.<p>For more information, see <i>Using your Amazon Lookout for Vision model on an edge device</i> in the Amazon Lookout for Vision Developer Guide. </p>
Parameters
- input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process on
listModelsPaginator(_:logger:on:)
compiler(>=5.5.2) && canImport(_Concurrency)
public func listModelsPaginator( _ input: ListModelsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil ) -> AWSClient.PaginatorSequence<ListModelsRequest, ListModelsResponse>
Lists the versions of a model in an Amazon Lookout for Vision project.
The
ListModels
operation is eventually consistent. Recent calls toCreateModel
might take a while to appear in the response fromListProjects
.This operation requires permissions to perform the
Return PaginatorSequence for operation. - Parameters: - input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process onlookoutvision:ListModels
operation.
listProjectsPaginator(_:logger:on:)
compiler(>=5.5.2) && canImport(_Concurrency)
public func listProjectsPaginator( _ input: ListProjectsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil ) -> AWSClient.PaginatorSequence<ListProjectsRequest, ListProjectsResponse>
Lists the Amazon Lookout for Vision projects in your AWS account.
The
ListProjects
operation is eventually consistent. Recent calls toCreateProject
andDeleteProject
might take a while to appear in the response fromListProjects
.This operation requires permissions to perform the
Return PaginatorSequence for operation. - Parameters: - input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process onlookoutvision:ListProjects
operation.
listDatasetEntriesPaginator(_:_:logger:on:onPage:)
Provide paginated results to closure `onPage` for it to combine them into one result.
This works in a similar manner to `Array.reducepublic func listDatasetEntriesPaginator<Result>(
_ input: ListDatasetEntriesRequest,
_ initialValue: Result,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (Result, ListDatasetEntriesResponse, EventLoop) -> EventLoopFuture<(Bool, Result)>
) -> EventLoopFuture<Result>
Lists the JSON Lines within a dataset. An Amazon Lookout for Vision JSON Line contains the anomaly information for a single image, including the image location and the assigned label.
This operation requires permissions to perform the
lookoutvision:ListDatasetEntries
operation.
listDatasetEntriesPaginator(_:logger:on:onPage:)
Provide paginated results to closure `onPage`.public func listDatasetEntriesPaginator(
_ input: ListDatasetEntriesRequest,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (ListDatasetEntriesResponse, EventLoop) -> EventLoopFuture<Bool>
) -> EventLoopFuture<Void>
Parameters
- input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process on - onPage: closure called with each block of entries. Returns boolean indicating whether we should continue.listModelPackagingJobsPaginator(_:_:logger:on:onPage:)
Provide paginated results to closure `onPage` for it to combine them into one result.
This works in a similar manner to `Array.reducepublic func listModelPackagingJobsPaginator<Result>(
_ input: ListModelPackagingJobsRequest,
_ initialValue: Result,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (Result, ListModelPackagingJobsResponse, EventLoop) -> EventLoopFuture<(Bool, Result)>
) -> EventLoopFuture<Result>
Lists the model packaging jobs created for an Amazon Lookout for Vision project.
This operation requires permissions to perform the
lookoutvision:ListModelPackagingJobs
operation.
<p>For more information, see
<i>Using your Amazon Lookout for Vision model on an edge device</i> in the Amazon Lookout for Vision Developer Guide. </p>
Parameters:
- input: Input for request
- initialValue: The value to use as the initial accumulating value. `initialValue` is passed to `onPage` the first time it is called.
- logger: Logger used flot logging
- eventLoop: EventLoop to run this process on
- onPage: closure called with each paginated response. It combines an accumulating result with the contents of response. This combined result is then returned
along with a boolean indicating if the paginate operation should continue.listModelPackagingJobsPaginator(_:logger:on:onPage:)
Provide paginated results to closure `onPage`.public func listModelPackagingJobsPaginator(
_ input: ListModelPackagingJobsRequest,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (ListModelPackagingJobsResponse, EventLoop) -> EventLoopFuture<Bool>
) -> EventLoopFuture<Void>
Parameters
- input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process on - onPage: closure called with each block of entries. Returns boolean indicating whether we should continue.listModelsPaginator(_:_:logger:on:onPage:)
Provide paginated results to closure `onPage` for it to combine them into one result.
This works in a similar manner to `Array.reducepublic func listModelsPaginator<Result>(
_ input: ListModelsRequest,
_ initialValue: Result,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (Result, ListModelsResponse, EventLoop) -> EventLoopFuture<(Bool, Result)>
) -> EventLoopFuture<Result>
Lists the versions of a model in an Amazon Lookout for Vision project.
The ListModels
operation is eventually consistent.
Recent calls to CreateModel
might
take a while to appear in the response from ListProjects
.
This operation requires permissions to perform the
lookoutvision:ListModels
operation.
listModelsPaginator(_:logger:on:onPage:)
Provide paginated results to closure `onPage`.public func listModelsPaginator(
_ input: ListModelsRequest,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (ListModelsResponse, EventLoop) -> EventLoopFuture<Bool>
) -> EventLoopFuture<Void>
Parameters
- input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process on - onPage: closure called with each block of entries. Returns boolean indicating whether we should continue.listProjectsPaginator(_:_:logger:on:onPage:)
Provide paginated results to closure `onPage` for it to combine them into one result.
This works in a similar manner to `Array.reducepublic func listProjectsPaginator<Result>(
_ input: ListProjectsRequest,
_ initialValue: Result,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (Result, ListProjectsResponse, EventLoop) -> EventLoopFuture<(Bool, Result)>
) -> EventLoopFuture<Result>
Lists the Amazon Lookout for Vision projects in your AWS account.
The ListProjects
operation is eventually consistent.
Recent calls to CreateProject
and DeleteProject
might
take a while to appear in the response from ListProjects
.
This operation requires permissions to perform the
lookoutvision:ListProjects
operation.
listProjectsPaginator(_:logger:on:onPage:)
Provide paginated results to closure `onPage`.public func listProjectsPaginator(
_ input: ListProjectsRequest,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (ListProjectsResponse, EventLoop) -> EventLoopFuture<Bool>
) -> EventLoopFuture<Void>