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);
}
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);
}
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);
}
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());
}
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());
}
Aggregations