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