Skip to content

Commit 4572971

Browse files
committed
fix(validate-image): convert ids from coco to numeric string
1 parent 60d9cdc commit 4572971

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

utils/asset_types/models.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class AoiGeometryAssetProperty(BaseModel):
2121

2222

2323
class ObjectImage(BaseModel):
24-
id: custom_fields.PydanticPositiveInt
24+
# NOTE: converting id and image_id to string as large integers are not supported
25+
id: custom_fields.PydanticId
2526
file_name: str
2627
license: custom_fields.PydanticPositiveInt | None = None
2728
coco_url: custom_fields.PydanticUrl | None = None
@@ -33,9 +34,11 @@ class ObjectImage(BaseModel):
3334

3435
class ObjectImageAnnotation(BaseModel):
3536
# NOTE: `id` is not required in coco format but we might need this to be required
36-
id: custom_fields.PydanticPositiveInt
37-
image_id: custom_fields.PydanticPositiveInt
38-
category_id: custom_fields.PydanticPositiveInt | None = None
37+
# NOTE: converting id and image_id to string as large integers are not supported
38+
id: custom_fields.PydanticId
39+
# NOTE: converting id and image_id to string as large integers are not supported
40+
image_id: custom_fields.PydanticId
41+
category_id: custom_fields.PydanticId | None = None
3942
iscrowd: custom_fields.PydanticPositiveInt | None = None
4043
segmentation: list[list[float]] | None = None
4144
area: custom_fields.PydanticPositiveFloat | None = None

0 commit comments

Comments
 (0)