use of com.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs in project java-aiplatform by googleapis.
the class CreateTrainingPipelineVideoActionRecognitionSample method createTrainingPipelineVideoActionRecognitionSample.
static void createTrainingPipelineVideoActionRecognitionSample(String project, String displayName, String datasetId, String modelDisplayName) throws IOException {
PipelineServiceSettings settings = PipelineServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
String location = "us-central1";
// the "close" method on the client to safely clean up any remaining background resources.
try (PipelineServiceClient client = PipelineServiceClient.create(settings)) {
AutoMlVideoActionRecognitionInputs trainingTaskInputs = AutoMlVideoActionRecognitionInputs.newBuilder().setModelType(ModelType.CLOUD).build();
InputDataConfig inputDataConfig = InputDataConfig.newBuilder().setDatasetId(datasetId).build();
Model modelToUpload = Model.newBuilder().setDisplayName(modelDisplayName).build();
TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().setDisplayName(displayName).setTrainingTaskDefinition("gs://google-cloud-aiplatform/schema/trainingjob/definition/" + "automl_video_action_recognition_1.0.0.yaml").setTrainingTaskInputs(ValueConverter.toValue(trainingTaskInputs)).setInputDataConfig(inputDataConfig).setModelToUpload(modelToUpload).build();
LocationName parent = LocationName.of(project, location);
TrainingPipeline response = client.createTrainingPipeline(parent, trainingPipeline);
System.out.format("response: %s\n", response);
System.out.format("Name: %s\n", response.getName());
}
}
Aggregations