Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,11 @@ dataset_object = client.create_dataset_object(
"value": "dog",
"type": "bbox" # type can be 'bbox', 'segmentation'.
}
]
],
custom_metadata={
"key": "value",
"metadata": "metadata-value"
}
)
```

Expand Down Expand Up @@ -2568,6 +2572,10 @@ See API docs for details.
"confidenceScore": -1
}
],
"customMetadata": {
"key": "value",
"metadata": "metadata-value"
},
'createdAt': '2022-10-30T08:32:20.748Z',
'updatedAt': '2022-10-30T08:32:20.748Z'
}
Expand Down
12 changes: 10 additions & 2 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4050,7 +4050,11 @@ async def __download(base_path: Path, _obj: dict):
exist_dataset_objects = json.load(open(output_path))
with Path(base_path / "annotations.json").open("w") as f:
annotations = [
{"name": obj["name"], "annotations": obj["annotations"]}
{
"name": obj["name"],
"annotations": obj["annotations"],
"customMetadata": obj["customMetadata"],
}
for obj in objects
]
json.dump(
Expand All @@ -4076,6 +4080,7 @@ def create_dataset_object(
file_path: str,
tags: List[str] = None,
annotations: List[dict] = None,
custom_metadata: Optional[dict[str, str]] = None,
) -> dict:
"""
Create a dataset object.
Expand All @@ -4102,6 +4107,8 @@ def create_dataset_object(
payload["tags"] = tags
if annotations:
payload["annotations"] = annotations
if custom_metadata:
payload["customMetadata"] = custom_metadata
return self.api.post_request(endpoint, payload=payload)

def delete_dataset_object(self, dataset_id: str, object_name: str) -> None:
Expand Down Expand Up @@ -4418,6 +4425,7 @@ def get_histories(

return self.api.get_request(endpoint, params=params)


def delete_extra_annotations_parameter(annotations: list) -> list:
for annotation in annotations:
annotation.pop("id", None)
Expand All @@ -4437,4 +4445,4 @@ def delete_extra_attributes_parameter(attributes: list) -> list:
attribute.pop("title", None)
attribute.pop("name", None)
attribute.pop("type", None)
return attributes
return attributes