googleapis / googleapis/python-aiplatform
New annotation set is created for dataset when images are added through api (but not through manual upload of same JSON)
- Dominant language
- Python
- Stars
- 905
- Forks
- 465
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 44
Description
#### Environment details
- OS type and version:
- Python version: 3.11
- pip version: 3.11
- `google-cloud-aiplatform` version: 1.33.0
#### Steps to reproduce
1. Retrieve image data set object using aiplatform.ImageDataset(f"projects/{project_id}/locations/us-central1/datasets/{dataset_id}")
2. Import some images with bounding boxes using dataset.import_data( gcs_source=[f"gs://{bucket_name}/{jsonl_file_name}"], import_schema_uri='gs://google-cloud-aiplatform/schema/dataset/ioformat/image_bounding_box_io_format_1.0.0.yaml')
3. Look at dataset in google cloud console, on first inspection images seem unlabelled, but looking more closely all the of the previously images have annotations in an annotation set called 'my_dataset_iod' whereas those imported with the import_data call have a new annotation set called something like 'my_dataset_image_bounding_box_2023_09_19_080419'. The labels appear in the cloud console when the relevant annotation set is selected, therefore the labels appear either on the newly imported images, or the ones that were there before (and had been manually uploaded through the console), but there is no way to have full set labelled simultaneously.
I've looked but so far failed to to find any reference to annotation sets anywhere in the api documentation
#### Code example
```python
from google.cloud import storage
from google.cloud import aiplatform
.....
current_datetime = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
jsonl_file_name = f"data_{current_datetime}.jsonl"
jsonl_blob = bucket.blob(jsonl_file_name)
jsonl_blob.upload_from_string(jsonl_string, content_type='application/jsonl')
dataset = aiplatform.ImageDataset(f"projects/{project_id}/locations/us-central1/datasets/{dataset_id}")
dataset.import_data( gcs_source=[f"gs://{bucket_name}/{jsonl_file_name}"], import_schema_uri='gs://google-cloud-aiplatform/schema/dataset/ioformat/image_bounding_box_io_format_1.0.0.yaml')
```
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
Contributor guide
Research direction
Start with the ImageDataset.import_data call and the image_bounding_box_io_format_1.0.0.yaml schema named in the report, then compare its behavior with the manual JSON upload path. Done means imported images and existing images use the expected annotation set together, with coverage for the reported reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, python
- Domain
- api, data, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100