/
constants.py
85 lines (77 loc) · 2.44 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DEFAULT_REGION = "us-central1"
SUPPORTED_REGIONS = {
"asia-east1",
"asia-east2",
"asia-northeast1",
"asia-northeast3",
"asia-south1",
"asia-southeast1",
"australia-southeast1",
"europe-west1",
"europe-west2",
"europe-west3",
"europe-west4",
"northamerica-northeast1",
"us-central1",
"us-east1",
"us-east4",
"us-west1",
"us-west2",
}
API_BASE_PATH = "aiplatform.googleapis.com"
PREDICTION_API_BASE_PATH = API_BASE_PATH
# Batch Prediction
BATCH_PREDICTION_INPUT_STORAGE_FORMATS = (
"jsonl",
"csv",
"tf-record",
"tf-record-gzip",
"bigquery",
"file-list",
)
BATCH_PREDICTION_OUTPUT_STORAGE_FORMATS = ("jsonl", "csv", "bigquery")
MOBILE_TF_MODEL_TYPES = {
"MOBILE_TF_LOW_LATENCY_1",
"MOBILE_TF_VERSATILE_1",
"MOBILE_TF_HIGH_ACCURACY_1",
}
# TODO(b/177079208): Use EPCL Enums for validating Model Types
# Defined by gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_image_*
# Format: "prediction_type": set() of model_type's
#
# NOTE: When adding a new prediction_type's, ensure it fits the pattern
# "automl_image_{prediction_type}_*" used by the YAML schemas on GCS
AUTOML_IMAGE_PREDICTION_MODEL_TYPES = {
"classification": {"CLOUD"} | MOBILE_TF_MODEL_TYPES,
"object_detection": {"CLOUD_HIGH_ACCURACY_1", "CLOUD_LOW_LATENCY_1"}
| MOBILE_TF_MODEL_TYPES,
}
AUTOML_VIDEO_PREDICTION_MODEL_TYPES = {
"classification": {"CLOUD"} | {"MOBILE_VERSATILE_1"},
"action_recognition": {"CLOUD"} | {"MOBILE_VERSATILE_1"},
"object_tracking": {"CLOUD"}
| {
"MOBILE_VERSATILE_1",
"MOBILE_CORAL_VERSATILE_1",
"MOBILE_CORAL_LOW_LATENCY_1",
"MOBILE_JETSON_VERSATILE_1",
"MOBILE_JETSON_LOW_LATENCY_1",
},
}
# Used in constructing the requests user_agent header for metrics reporting.
USER_AGENT_PRODUCT = "model-builder"