( projectId = 'YOUR_PROJECT_ID', location = 'us-central1', modelId = 'YOUR_MODEL_ID', modelEvaluationId = 'YOUR_MODEL_EVALUATION_ID' )
| 15 | 'use strict'; |
| 16 | |
| 17 | function main( |
| 18 | projectId = 'YOUR_PROJECT_ID', |
| 19 | location = 'us-central1', |
| 20 | modelId = 'YOUR_MODEL_ID', |
| 21 | modelEvaluationId = 'YOUR_MODEL_EVALUATION_ID' |
| 22 | ) { |
| 23 | // [START automl_video_classification_get_model_evaluation_beta] |
| 24 | // [START automl_video_object_tracking_get_model_evaluation_beta] |
| 25 | /** |
| 26 | * TODO(developer): Uncomment these variables before running the sample. |
| 27 | */ |
| 28 | // const projectId = 'YOUR_PROJECT_ID'; |
| 29 | // const location = 'us-central1'; |
| 30 | // const modelId = 'YOUR_MODEL_ID'; |
| 31 | // const modelEvaluationId = 'YOUR_MODEL_EVALUATION_ID'; |
| 32 | |
| 33 | // Imports the Google Cloud AutoML library |
| 34 | const {AutoMlClient} = require('@google-cloud/automl').v1beta1; |
| 35 | |
| 36 | // Instantiates a client |
| 37 | const client = new AutoMlClient(); |
| 38 | |
| 39 | async function getModelEvaluation() { |
| 40 | // Construct request |
| 41 | const request = { |
| 42 | name: client.modelEvaluationPath( |
| 43 | projectId, |
| 44 | location, |
| 45 | modelId, |
| 46 | modelEvaluationId |
| 47 | ), |
| 48 | }; |
| 49 | |
| 50 | const [response] = await client.getModelEvaluation(request); |
| 51 | |
| 52 | console.log(`Model evaluation name: ${response.name}`); |
| 53 | console.log(`Model annotation spec id: ${response.annotationSpecId}`); |
| 54 | console.log(`Model display name: ${response.displayName}`); |
| 55 | console.log('Model create time'); |
| 56 | console.log(`\tseconds ${response.createTime.seconds}`); |
| 57 | console.log(`\tnanos ${response.createTime.nanos / 1e9}`); |
| 58 | console.log(`Evaluation example count: ${response.evaluatedExampleCount}`); |
| 59 | // [END automl_video_object_tracking_get_model_evaluation_beta] |
| 60 | // [END automl_video_classification_get_model_evaluation_beta] |
| 61 | |
| 62 | // [START automl_video_classification_get_model_evaluation_beta] |
| 63 | console.log( |
| 64 | `Video classification model evaluation metrics: ${response.videoClassificationEvaluationMetrics}` |
| 65 | ); |
| 66 | // [END automl_video_classification_get_model_evaluation_beta] |
| 67 | |
| 68 | // [START automl_video_object_tracking_get_model_evaluation_beta] |
| 69 | console.log( |
| 70 | `Video object tracking model evaluation metrics: ${response.videoObjectTrackingEvaluationMetrics}` |
| 71 | ); |
| 72 | |
| 73 | // [START automl_video_classification_get_model_evaluation_beta] |
| 74 | } |
no test coverage detected