use of com.google.cloud.aiplatform.v1.DatasetServiceClient in project java-aiplatform by googleapis.
the class ImportDataVideoObjectTrackingSampleTest method tearDown.
@After
public void tearDown() throws InterruptedException, ExecutionException, IOException {
// delete the temp dataset
if (datasetId != null) {
DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
DatasetName datasetName = DatasetName.of(PROJECT, LOCATION, datasetId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = datasetServiceClient.deleteDatasetAsync(datasetName);
operationFuture.get();
}
}
System.out.flush();
System.setOut(originalPrintStream);
}
use of com.google.cloud.aiplatform.v1.DatasetServiceClient in project java-aiplatform by googleapis.
the class ImportDataVideoObjectTrackingSampleTest method setUp.
@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException, IOException {
bout = new ByteArrayOutputStream();
out = new PrintStream(bout);
originalPrintStream = System.out;
System.setOut(out);
// create a temp dataset for importing data
DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
String metadataSchemaUri = "gs://google-cloud-aiplatform/schema/dataset/metadata/video_1.0.0.yaml";
LocationName locationName = LocationName.of(PROJECT, LOCATION);
Dataset dataset = Dataset.newBuilder().setDisplayName("test_dataset_display_name").setMetadataSchemaUri(metadataSchemaUri).build();
OperationFuture<Dataset, CreateDatasetOperationMetadata> datasetFuture = datasetServiceClient.createDatasetAsync(locationName, dataset);
Dataset datasetResponse = datasetFuture.get(300, TimeUnit.SECONDS);
String[] datasetValues = datasetResponse.getName().split("/");
datasetId = datasetValues[datasetValues.length - 1];
}
}
use of com.google.cloud.aiplatform.v1.DatasetServiceClient in project java-aiplatform by googleapis.
the class ImportDataImageObjectDetectionSampleTest method setUp.
@Before
public void setUp() throws InterruptedException, ExecutionException, TimeoutException, IOException {
bout = new ByteArrayOutputStream();
out = new PrintStream(bout);
originalPrintStream = System.out;
System.setOut(out);
// create a temp dataset for importing data
DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
String metadataSchemaUri = "gs://google-cloud-aiplatform/schema/dataset/metadata/image_1.0.0.yaml";
LocationName locationName = LocationName.of(PROJECT, LOCATION);
Dataset dataset = Dataset.newBuilder().setDisplayName("test_dataset_display_name").setMetadataSchemaUri(metadataSchemaUri).build();
OperationFuture<Dataset, CreateDatasetOperationMetadata> datasetFuture = datasetServiceClient.createDatasetAsync(locationName, dataset);
Dataset datasetResponse = datasetFuture.get(120, TimeUnit.SECONDS);
String[] datasetValues = datasetResponse.getName().split("/");
datasetId = datasetValues[datasetValues.length - 1];
}
}
use of com.google.cloud.aiplatform.v1.DatasetServiceClient in project java-aiplatform by googleapis.
the class ImportDataImageObjectDetectionSampleTest method tearDown.
@After
public void tearDown() throws InterruptedException, ExecutionException, IOException, TimeoutException {
// delete the temp dataset
DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
DatasetName datasetName = DatasetName.of(PROJECT, LOCATION, datasetId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = datasetServiceClient.deleteDatasetAsync(datasetName);
operationFuture.get();
}
System.out.flush();
System.setOut(originalPrintStream);
}
use of com.google.cloud.aiplatform.v1.DatasetServiceClient in project java-aiplatform by googleapis.
the class ImportDataVideoActionRecognitionSampleTest method tearDown.
@After
public void tearDown() throws InterruptedException, ExecutionException, IOException {
// delete the temp dataset
DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
DatasetName datasetName = DatasetName.of(PROJECT, LOCATION, datasetId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = datasetServiceClient.deleteDatasetAsync(datasetName);
operationFuture.get();
}
System.out.flush();
System.setOut(originalPrintStream);
}
Aggregations