Search in sources :

Example 36 with DataSet

use of org.idempiere.adInterface.x10.DataSet in project olca-modules by GreenDelta.

the class DataSetIterator method next.

@Override
public DataSet next() {
    DataSet current = next;
    moveNext();
    return current;
}
Also used : DataSet(spold2.DataSet)

Example 37 with DataSet

use of org.idempiere.adInterface.x10.DataSet in project java-aiplatform by googleapis.

the class ImportDataImageClassificationSampleTest method setUp.

@Before
public void setUp() throws IOException, InterruptedException, ExecutionException, TimeoutException {
    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];
    }
}
Also used : PrintStream(java.io.PrintStream) DatasetServiceSettings(com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings) CreateDatasetOperationMetadata(com.google.cloud.aiplatform.v1beta1.CreateDatasetOperationMetadata) Dataset(com.google.cloud.aiplatform.v1beta1.Dataset) DatasetServiceClient(com.google.cloud.aiplatform.v1beta1.DatasetServiceClient) ByteArrayOutputStream(java.io.ByteArrayOutputStream) LocationName(com.google.cloud.aiplatform.v1beta1.LocationName) Before(org.junit.Before)

Example 38 with DataSet

use of org.idempiere.adInterface.x10.DataSet in project java-aiplatform by googleapis.

the class ImportDataVideoActionRecognitionSampleTest method setUp.

@Before
public void setUp() throws IOException, InterruptedException, ExecutionException, TimeoutException {
    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];
    }
}
Also used : PrintStream(java.io.PrintStream) DatasetServiceSettings(com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings) CreateDatasetOperationMetadata(com.google.cloud.aiplatform.v1beta1.CreateDatasetOperationMetadata) Dataset(com.google.cloud.aiplatform.v1beta1.Dataset) DatasetServiceClient(com.google.cloud.aiplatform.v1beta1.DatasetServiceClient) ByteArrayOutputStream(java.io.ByteArrayOutputStream) LocationName(com.google.cloud.aiplatform.v1beta1.LocationName) Before(org.junit.Before)

Example 39 with DataSet

use of org.idempiere.adInterface.x10.DataSet in project java-aiplatform by googleapis.

the class ImportDataVideoClassificationSampleTest method setUp.

@Before
public void setUp() throws IOException, InterruptedException, ExecutionException, TimeoutException {
    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];
    }
}
Also used : PrintStream(java.io.PrintStream) DatasetServiceSettings(com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings) CreateDatasetOperationMetadata(com.google.cloud.aiplatform.v1beta1.CreateDatasetOperationMetadata) Dataset(com.google.cloud.aiplatform.v1beta1.Dataset) DatasetServiceClient(com.google.cloud.aiplatform.v1beta1.DatasetServiceClient) ByteArrayOutputStream(java.io.ByteArrayOutputStream) LocationName(com.google.cloud.aiplatform.v1beta1.LocationName) Before(org.junit.Before)

Example 40 with DataSet

use of org.idempiere.adInterface.x10.DataSet in project java-aiplatform by googleapis.

the class CreateDatasetImageSample method createDatasetImageSample.

static void createDatasetImageSample(String project, String datasetDisplayName) throws IOException, InterruptedException, ExecutionException, TimeoutException {
    DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
    // the "close" method on the client to safely clean up any remaining background resources.
    try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
        String location = "us-central1";
        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(datasetDisplayName).setMetadataSchemaUri(metadataSchemaUri).build();
        OperationFuture<Dataset, CreateDatasetOperationMetadata> datasetFuture = datasetServiceClient.createDatasetAsync(locationName, dataset);
        System.out.format("Operation name: %s\n", datasetFuture.getInitialFuture().get().getName());
        System.out.println("Waiting for operation to finish...");
        Dataset datasetResponse = datasetFuture.get(120, TimeUnit.SECONDS);
        System.out.println("Create Image Dataset Response");
        System.out.format("Name: %s\n", datasetResponse.getName());
        System.out.format("Display Name: %s\n", datasetResponse.getDisplayName());
        System.out.format("Metadata Schema Uri: %s\n", datasetResponse.getMetadataSchemaUri());
        System.out.format("Metadata: %s\n", datasetResponse.getMetadata());
        System.out.format("Create Time: %s\n", datasetResponse.getCreateTime());
        System.out.format("Update Time: %s\n", datasetResponse.getUpdateTime());
        System.out.format("Labels: %s\n", datasetResponse.getLabelsMap());
    }
}
Also used : DatasetServiceSettings(com.google.cloud.aiplatform.v1.DatasetServiceSettings) CreateDatasetOperationMetadata(com.google.cloud.aiplatform.v1.CreateDatasetOperationMetadata) Dataset(com.google.cloud.aiplatform.v1.Dataset) DatasetServiceClient(com.google.cloud.aiplatform.v1.DatasetServiceClient) LocationName(com.google.cloud.aiplatform.v1.LocationName)

Aggregations

IOException (java.io.IOException)14 ByteArrayOutputStream (java.io.ByteArrayOutputStream)10 PrintStream (java.io.PrintStream)10 Before (org.junit.Before)10 Dataset (com.google.cloud.datalabeling.v1beta1.Dataset)9 ArrayList (java.util.ArrayList)9 AutoMlClient (com.google.cloud.automl.v1.AutoMlClient)8 Dataset (com.google.cloud.automl.v1.Dataset)8 LocationName (com.google.cloud.automl.v1.LocationName)7 DataLabelingServiceClient (com.google.cloud.datalabeling.v1beta1.DataLabelingServiceClient)7 ProjectName (com.google.cloud.datalabeling.v1beta1.ProjectName)7 CreateDatasetOperationMetadata (com.google.cloud.aiplatform.v1.CreateDatasetOperationMetadata)6 Dataset (com.google.cloud.aiplatform.v1.Dataset)6 DatasetServiceClient (com.google.cloud.aiplatform.v1.DatasetServiceClient)6 DatasetServiceSettings (com.google.cloud.aiplatform.v1.DatasetServiceSettings)6 LocationName (com.google.cloud.aiplatform.v1.LocationName)6 OperationMetadata (com.google.cloud.automl.v1.OperationMetadata)6 AutoMlClient (com.google.cloud.automl.v1beta1.AutoMlClient)6 Dataset (com.google.cloud.automl.v1beta1.Dataset)6 LocationName (com.google.cloud.automl.v1beta1.LocationName)6