startProjectVersion method

Future<StartProjectVersionResponse> startProjectVersion({
  1. required int minInferenceUnits,
  2. required String projectVersionArn,
})

Starts the running of the version of a model. Starting a model takes a while to complete. To check the current state of the model, use DescribeProjectVersions.

Once the model is running, you can detect custom labels in new images by calling DetectCustomLabels. This operation requires permissions to perform the rekognition:StartProjectVersion action.

May throw ResourceNotFoundException. May throw ResourceInUseException. May throw LimitExceededException. May throw InvalidParameterException. May throw AccessDeniedException. May throw InternalServerError. May throw ThrottlingException. May throw ProvisionedThroughputExceededException.

Parameter minInferenceUnits : The minimum number of inference units to use. A single inference unit represents 1 hour of processing and can support up to 5 Transaction Pers Second (TPS). Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.

Parameter projectVersionArn : The Amazon Resource Name(ARN) of the model version that you want to start.

Implementation

Future<StartProjectVersionResponse> startProjectVersion({
  required int minInferenceUnits,
  required String projectVersionArn,
}) async {
  ArgumentError.checkNotNull(minInferenceUnits, 'minInferenceUnits');
  _s.validateNumRange(
    'minInferenceUnits',
    minInferenceUnits,
    1,
    1152921504606846976,
    isRequired: true,
  );
  ArgumentError.checkNotNull(projectVersionArn, 'projectVersionArn');
  _s.validateStringLength(
    'projectVersionArn',
    projectVersionArn,
    20,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RekognitionService.StartProjectVersion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MinInferenceUnits': minInferenceUnits,
      'ProjectVersionArn': projectVersionArn,
    },
  );

  return StartProjectVersionResponse.fromJson(jsonResponse.body);
}