Search in sources :

Example 1 with Slice

use of com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice in project java-aiplatform by googleapis.

the class GetModelEvaluationVideoClassificationSample method getModelEvaluationVideoClassification.

static void getModelEvaluationVideoClassification(String project, String modelId, String evaluationId) throws IOException {
    ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
    // the "close" method on the client to safely clean up any remaining background resources.
    try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
        String location = "us-central1";
        ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
        ModelEvaluation modelEvaluation = modelServiceClient.getModelEvaluation(modelEvaluationName);
        System.out.println("Get Model Evaluation Video Classification Response");
        System.out.format("Name: %s\n", modelEvaluation.getName());
        System.out.format("Metrics Schema Uri: %s\n", modelEvaluation.getMetricsSchemaUri());
        System.out.format("Metrics: %s\n", modelEvaluation.getMetrics());
        System.out.format("Create Time: %s\n", modelEvaluation.getCreateTime());
        System.out.format("Slice Dimensions: %s\n", modelEvaluation.getSliceDimensionsList());
    }
}
Also used : ModelEvaluationName(com.google.cloud.aiplatform.v1.ModelEvaluationName) ModelEvaluation(com.google.cloud.aiplatform.v1.ModelEvaluation) ModelServiceSettings(com.google.cloud.aiplatform.v1.ModelServiceSettings) ModelServiceClient(com.google.cloud.aiplatform.v1.ModelServiceClient)

Example 2 with Slice

use of com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice in project java-aiplatform by googleapis.

the class GetModelEvaluationVideoObjectTrackingSample method getModelEvaluationVideoObjectTracking.

static void getModelEvaluationVideoObjectTracking(String project, String modelId, String evaluationId) throws IOException {
    ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
    // the "close" method on the client to safely clean up any remaining background resources.
    try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
        String location = "us-central1";
        ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
        ModelEvaluation modelEvaluation = modelServiceClient.getModelEvaluation(modelEvaluationName);
        System.out.println("Get Model Evaluation Video Object Tracking Response");
        System.out.format("Name: %s\n", modelEvaluation.getName());
        System.out.format("Metrics Schema Uri: %s\n", modelEvaluation.getMetricsSchemaUri());
        System.out.format("Metrics: %s\n", modelEvaluation.getMetrics());
        System.out.format("Create Time: %s\n", modelEvaluation.getCreateTime());
        System.out.format("Slice Dimensions: %s\n", modelEvaluation.getSliceDimensionsList());
    }
}
Also used : ModelEvaluationName(com.google.cloud.aiplatform.v1.ModelEvaluationName) ModelEvaluation(com.google.cloud.aiplatform.v1.ModelEvaluation) ModelServiceSettings(com.google.cloud.aiplatform.v1.ModelServiceSettings) ModelServiceClient(com.google.cloud.aiplatform.v1.ModelServiceClient)

Example 3 with Slice

use of com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice in project java-aiplatform by googleapis.

the class ListModelEvaluationSliceSample method listModelEvaluationSliceSample.

static void listModelEvaluationSliceSample(String project, String modelId, String evaluationId) throws IOException {
    ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
    // the "close" method on the client to safely clean up any remaining background resources.
    try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
        String location = "us-central1";
        ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
        for (ModelEvaluationSlice modelEvaluationSlice : modelServiceClient.listModelEvaluationSlices(modelEvaluationName).iterateAll()) {
            System.out.format("Model Evaluation Slice Name: %s\n", modelEvaluationSlice.getName());
            System.out.format("Metrics Schema Uri: %s\n", modelEvaluationSlice.getMetricsSchemaUri());
            System.out.format("Metrics: %s\n", modelEvaluationSlice.getMetrics());
            System.out.format("Create Time: %s\n", modelEvaluationSlice.getCreateTime());
            Slice slice = modelEvaluationSlice.getSlice();
            System.out.format("Slice Dimensions: %s\n", slice.getDimension());
            System.out.format("Slice Value: %s\n\n", slice.getValue());
        }
    }
}
Also used : ModelEvaluationName(com.google.cloud.aiplatform.v1.ModelEvaluationName) ModelEvaluationSlice(com.google.cloud.aiplatform.v1.ModelEvaluationSlice) Slice(com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice) ModelServiceSettings(com.google.cloud.aiplatform.v1.ModelServiceSettings) ModelServiceClient(com.google.cloud.aiplatform.v1.ModelServiceClient) ModelEvaluationSlice(com.google.cloud.aiplatform.v1.ModelEvaluationSlice)

Example 4 with Slice

use of com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice in project java-aiplatform by googleapis.

the class GetModelEvaluationImageClassificationSample method getModelEvaluationImageClassificationSample.

static void getModelEvaluationImageClassificationSample(String project, String modelId, String evaluationId) throws IOException {
    ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
    // the "close" method on the client to safely clean up any remaining background resources.
    try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
        String location = "us-central1";
        ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
        ModelEvaluation modelEvaluation = modelServiceClient.getModelEvaluation(modelEvaluationName);
        System.out.println("Get Model Evaluation Image Classification Response");
        System.out.format("Model Name: %s\n", modelEvaluation.getName());
        System.out.format("Metrics Schema Uri: %s\n", modelEvaluation.getMetricsSchemaUri());
        System.out.format("Metrics: %s\n", modelEvaluation.getMetrics());
        System.out.format("Create Time: %s\n", modelEvaluation.getCreateTime());
        System.out.format("Slice Dimensions: %s\n", modelEvaluation.getSliceDimensionsList());
    }
}
Also used : ModelEvaluationName(com.google.cloud.aiplatform.v1.ModelEvaluationName) ModelEvaluation(com.google.cloud.aiplatform.v1.ModelEvaluation) ModelServiceSettings(com.google.cloud.aiplatform.v1.ModelServiceSettings) ModelServiceClient(com.google.cloud.aiplatform.v1.ModelServiceClient)

Example 5 with Slice

use of com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice in project java-aiplatform by googleapis.

the class GetModelEvaluationSample method getModelEvaluationSample.

static void getModelEvaluationSample(String project, String modelId, String evaluationId) throws IOException {
    ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
    // the "close" method on the client to safely clean up any remaining background resources.
    try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
        String location = "us-central1";
        ModelEvaluationName modelEvaluationName = ModelEvaluationName.of(project, location, modelId, evaluationId);
        ModelEvaluation modelEvaluation = modelServiceClient.getModelEvaluation(modelEvaluationName);
        System.out.println("Get Model Evaluation Response");
        System.out.format("Model Name: %s\n", modelEvaluation.getName());
        System.out.format("Metrics Schema Uri: %s\n", modelEvaluation.getMetricsSchemaUri());
        System.out.format("Metrics: %s\n", modelEvaluation.getMetrics());
        System.out.format("Create Time: %s\n", modelEvaluation.getCreateTime());
        System.out.format("Slice Dimensions: %s\n", modelEvaluation.getSliceDimensionsList());
    }
}
Also used : ModelEvaluationName(com.google.cloud.aiplatform.v1.ModelEvaluationName) ModelEvaluation(com.google.cloud.aiplatform.v1.ModelEvaluation) ModelServiceSettings(com.google.cloud.aiplatform.v1.ModelServiceSettings) ModelServiceClient(com.google.cloud.aiplatform.v1.ModelServiceClient)

Aggregations

ModelServiceClient (com.google.cloud.aiplatform.v1.ModelServiceClient)6 ModelServiceSettings (com.google.cloud.aiplatform.v1.ModelServiceSettings)6 ModelEvaluationName (com.google.cloud.aiplatform.v1.ModelEvaluationName)5 ModelEvaluation (com.google.cloud.aiplatform.v1.ModelEvaluation)4 ModelEvaluationSlice (com.google.cloud.aiplatform.v1.ModelEvaluationSlice)2 Slice (com.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice)2 ModelEvaluationSliceName (com.google.cloud.aiplatform.v1.ModelEvaluationSliceName)1