导入vertexai图像对象检测后未标记的图像未标记

发布于 2025-02-13 13:43:10 字数 1992 浏览 1 评论 0原文

我正在使用此示例将我的图像和注释数据(JSONL文件)导入到我的Vertexai数据集中: https://cloud.google.com/vertex-ai/docs/samples/aiplatform-import-import-import-import-image-image-image-object-detection-sample-sample

from google.cloud import aiplatform
import os

#https://cloud.google.com/vertex-ai/docs/samples/aiplatform-import-data-image-object-detection-sample
def import_data_image_object_detection_sample(
        project: str = proj,
        dataset_id: str = datasetID,
        gcs_source_uri: str = cloudURIToInputFile,
        location: str = "us-central1",
        api_endpoint: str = "us-central1-aiplatform.googleapis.com",
        timeout: int = 1800,
):
    # The AI Platform services require regional API endpoints.
    client_options = {"api_endpoint": api_endpoint}
    # Initialize client that will be used to create and send requests.
    # This client only needs to be created once, and can be reused for multiple requests.
    client = aiplatform.gapic.DatasetServiceClient(client_options=client_options)
    import_configs = [
        {
            "gcs_source": {"uris": [gcs_source_uri]},
            "import_schema_uri": "gs://google-cloud-aiplatform/schema/dataset/ioformat/image_bounding_box_io_format_1.0.0.yaml",
        }
    ]
    name = client.dataset_path(project=project, location=location, dataset=dataset_id)
    response = client.import_data(name=name, import_configs=import_configs)
    print("Long running operation:", response.operation.name)
    import_data_response = response.result(timeout=timeout)
    print("import_data_response:", import_data_response)


import_data_image_object_detection_sample()

运行此操作后,所有图像都成功上传了,但是图像上没有标签显示。前几天,我能够成功地用标签导入它们,因此我不确定现在正在发生什么。谢谢

I'm using this example to import my images and annotation data (JSONL file) into my vertexAI dataset:
https://cloud.google.com/vertex-ai/docs/samples/aiplatform-import-data-image-object-detection-sample

from google.cloud import aiplatform
import os

#https://cloud.google.com/vertex-ai/docs/samples/aiplatform-import-data-image-object-detection-sample
def import_data_image_object_detection_sample(
        project: str = proj,
        dataset_id: str = datasetID,
        gcs_source_uri: str = cloudURIToInputFile,
        location: str = "us-central1",
        api_endpoint: str = "us-central1-aiplatform.googleapis.com",
        timeout: int = 1800,
):
    # The AI Platform services require regional API endpoints.
    client_options = {"api_endpoint": api_endpoint}
    # Initialize client that will be used to create and send requests.
    # This client only needs to be created once, and can be reused for multiple requests.
    client = aiplatform.gapic.DatasetServiceClient(client_options=client_options)
    import_configs = [
        {
            "gcs_source": {"uris": [gcs_source_uri]},
            "import_schema_uri": "gs://google-cloud-aiplatform/schema/dataset/ioformat/image_bounding_box_io_format_1.0.0.yaml",
        }
    ]
    name = client.dataset_path(project=project, location=location, dataset=dataset_id)
    response = client.import_data(name=name, import_configs=import_configs)
    print("Long running operation:", response.operation.name)
    import_data_response = response.result(timeout=timeout)
    print("import_data_response:", import_data_response)


import_data_image_object_detection_sample()

After I run this, all of the images are uploaded successfully, but none of the labels show up on the images. I was able to import them all successfully with the labels the other day, so I am not sure what is happening now. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文