Skip to content

Commit 7575046

Browse files
Ark-kuncopybara-github
authored andcommitted
feat: LVM - Released ImageCaptioningModel to GA
PiperOrigin-RevId: 556991273
1 parent 593b54f commit 7575046

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

tests/system/aiplatform/test_vision_models.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
from google.cloud import aiplatform
2424
from tests.system.aiplatform import e2e_base
25+
from vertexai import vision_models as ga_vision_models
2526
from vertexai.preview import vision_models
2627
from PIL import Image as PIL_Image
2728

@@ -45,7 +46,7 @@ class VisionModelTestSuite(e2e_base.TestEndToEnd):
4546
def test_image_captioning_model_get_captions(self):
4647
aiplatform.init(project=e2e_base._PROJECT, location=e2e_base._LOCATION)
4748

48-
model = vision_models.ImageCaptioningModel.from_pretrained("imagetext")
49+
model = ga_vision_models.ImageCaptioningModel.from_pretrained("imagetext")
4950
image = _create_blank_image()
5051
captions = model.get_captions(
5152
image=image,

tests/unit/aiplatform/test_vision_models.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from google.cloud.aiplatform.compat.types import (
3636
publisher_model as gca_publisher_model,
3737
)
38+
from vertexai import vision_models as ga_vision_models
3839
from vertexai.preview import vision_models
3940

4041
from PIL import Image as PIL_Image
@@ -102,7 +103,9 @@ def test_get_captions(self):
102103
attribute="get_publisher_model",
103104
return_value=gca_publisher_model(_IMAGE_TEXT_PUBLISHER_MODEL_DICT),
104105
):
105-
model = vision_models.ImageCaptioningModel.from_pretrained("imagetext@001")
106+
model = ga_vision_models.ImageCaptioningModel.from_pretrained(
107+
"imagetext@001"
108+
)
106109

107110
image_captions = [
108111
"Caption 1",

vertexai/vision_models/__init__.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
"""Classes for working with vision models."""
16+
17+
from vertexai.vision_models._vision_models import (
18+
Image,
19+
ImageCaptioningModel,
20+
)
21+
22+
__all__ = [
23+
"Image",
24+
"ImageCaptioningModel",
25+
]

0 commit comments

Comments
 (0)