Search in sources :

Example 96 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project java-automl by googleapis.

the class LanguageTextClassificationPredictTest method setUp.

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException {
    // Verify that the model is deployed for prediction
    try (AutoMlClient client = AutoMlClient.create()) {
        ModelName modelFullId = ModelName.of(PROJECT_ID, "us-central1", MODEL_ID);
        Model model = client.getModel(modelFullId);
        if (model.getDeploymentState() == Model.DeploymentState.UNDEPLOYED) {
            // Deploy the model if not deployed
            DeployModelRequest request = DeployModelRequest.newBuilder().setName(modelFullId.toString()).build();
            client.deployModelAsync(request).get();
        }
    }
    bout = new ByteArrayOutputStream();
    out = new PrintStream(bout);
    originalPrintStream = System.out;
    System.setOut(out);
}
Also used : DeployModelRequest(com.google.cloud.automl.v1.DeployModelRequest) PrintStream(java.io.PrintStream) ModelName(com.google.cloud.automl.v1.ModelName) Model(com.google.cloud.automl.v1.Model) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AutoMlClient(com.google.cloud.automl.v1.AutoMlClient) Before(org.junit.Before)

Example 97 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project java-automl by googleapis.

the class LanguageEntityExtractionPredictTest method setUp.

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException {
    // Verify that the model is deployed for prediction
    try (AutoMlClient client = AutoMlClient.create()) {
        ModelName modelFullId = ModelName.of(PROJECT_ID, "us-central1", MODEL_ID);
        Model model = client.getModel(modelFullId);
        if (model.getDeploymentState() == Model.DeploymentState.UNDEPLOYED) {
            // Deploy the model if not deployed
            DeployModelRequest request = DeployModelRequest.newBuilder().setName(modelFullId.toString()).build();
            client.deployModelAsync(request).get();
        }
    }
    bout = new ByteArrayOutputStream();
    out = new PrintStream(bout);
    originalPrintStream = System.out;
    System.setOut(out);
}
Also used : DeployModelRequest(com.google.cloud.automl.v1.DeployModelRequest) PrintStream(java.io.PrintStream) ModelName(com.google.cloud.automl.v1.ModelName) Model(com.google.cloud.automl.v1.Model) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AutoMlClient(com.google.cloud.automl.v1.AutoMlClient) Before(org.junit.Before)

Example 98 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project java-automl by googleapis.

the class VisionClassificationPredictTest method setUp.

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException {
    // Verify that the model is deployed for prediction
    try (AutoMlClient client = AutoMlClient.create()) {
        ModelName modelFullId = ModelName.of(PROJECT_ID, "us-central1", MODEL_ID);
        Model model = client.getModel(modelFullId);
        if (model.getDeploymentState() == Model.DeploymentState.UNDEPLOYED) {
            // Deploy the model if not deployed
            DeployModelRequest request = DeployModelRequest.newBuilder().setName(modelFullId.toString()).build();
            client.deployModelAsync(request).get();
        }
    }
    bout = new ByteArrayOutputStream();
    out = new PrintStream(bout);
    originalPrintStream = System.out;
    System.setOut(out);
}
Also used : DeployModelRequest(com.google.cloud.automl.v1.DeployModelRequest) PrintStream(java.io.PrintStream) ModelName(com.google.cloud.automl.v1.ModelName) Model(com.google.cloud.automl.v1.Model) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AutoMlClient(com.google.cloud.automl.v1.AutoMlClient) Before(org.junit.Before)

Example 99 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project ddf by codice.

the class KmlModelToJtsPointConverterTest method setupClass.

@BeforeClass
public static void setupClass() {
    InputStream stream = KmlModelToJtsPointConverterTest.class.getResourceAsStream("/kmlModel.kml");
    Kml kml = Kml.unmarshal(stream);
    testKmlModel = ((Model) ((Placemark) kml.getFeature()).getGeometry());
}
Also used : InputStream(java.io.InputStream) Model(de.micromata.opengis.kml.v_2_2_0.Model) Kml(de.micromata.opengis.kml.v_2_2_0.Kml) BeforeClass(org.junit.BeforeClass)

Example 100 with com.google.api.services.cloudresourcemanager.v3.model

use of com.google.api.services.cloudresourcemanager.v3.model in project ddf by codice.

the class KmlModelToJtsPointConverterTest method testConvertEmptyKmlModelReturnsNullPoint.

@Test
public void testConvertEmptyKmlModelReturnsNullPoint() {
    Point jtsPoint = KmlModelToJtsPointConverter.from(new Model());
    assertThat(jtsPoint, nullValue());
}
Also used : Model(de.micromata.opengis.kml.v_2_2_0.Model) Point(org.locationtech.jts.geom.Point) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)48 Model (org.eclipse.xtext.valueconverter.bug250313.Model)30 Model (com.google.cloud.aiplatform.v1.Model)16 AutoMlClient (com.google.cloud.automl.v1.AutoMlClient)16 Model (com.google.cloud.automl.v1.Model)16 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)16 LocationName (com.google.cloud.aiplatform.v1.LocationName)14 PipelineServiceClient (com.google.cloud.aiplatform.v1.PipelineServiceClient)14 PipelineServiceSettings (com.google.cloud.aiplatform.v1.PipelineServiceSettings)14 TrainingPipeline (com.google.cloud.aiplatform.v1.TrainingPipeline)14 InputDataConfig (com.google.cloud.aiplatform.v1.InputDataConfig)13 ModelContainerSpec (com.google.cloud.aiplatform.v1.ModelContainerSpec)13 FilterSplit (com.google.cloud.aiplatform.v1.FilterSplit)11 FractionSplit (com.google.cloud.aiplatform.v1.FractionSplit)11 PredefinedSplit (com.google.cloud.aiplatform.v1.PredefinedSplit)11 TimestampSplit (com.google.cloud.aiplatform.v1.TimestampSplit)11 Status (com.google.rpc.Status)11 Model (com.microsoft.z3.Model)11 DeployedModelRef (com.google.cloud.aiplatform.v1.DeployedModelRef)10 EnvVar (com.google.cloud.aiplatform.v1.EnvVar)10