diff --git a/README.md b/README.md index 822b329..3d685b8 100644 --- a/README.md +++ b/README.md @@ -2409,7 +2409,6 @@ dataset = client.create_dataset( name="object-detection", # Only lowercase alphanumeric characters + hyphen is available tags=["cat", "dog"], # max 5 tags per dataset. visibility="workspace", # visibility can be 'workspace' or 'public' or 'organization' - license="The MIT License" # Optional ) ``` @@ -2455,7 +2454,6 @@ You can filter by keywords and visibility, tags. datasets = client.get_datasets( keyword="dog", tags=["cat", "dog"], # max 5 tags per dataset. - license="mit", visibility="workspace", # visibility can be 'workspace' or 'public' or 'organization'. ) ``` @@ -2499,6 +2497,7 @@ dataset_object = client.create_dataset_object( name="brushwood_dog.jpg", file_path="./brushwood_dog.jpg", tags=["dog"], # max 5 tags per dataset object. + licenses=["MIT", "my-license"], # max 10 licenses per dataset object annotations=[ { "keypoints": [ @@ -2633,13 +2632,14 @@ dataset_objects = client.get_dataset_objects(dataset="YOUR_DATASET_NAME") The success response is the same as when created, but it is an array. -You can filter by version or revision_id and tags. +You can filter by version or revision_id, licenses and tags. ```python dataset_objects = client.get_dataset_objects( dataset="YOUR_DATASET_NAME", version="latest", # default is "latest" tags=["cat"], + licenses=["MIT"] ) ``` @@ -2672,6 +2672,7 @@ dataset_object = client.update_dataset_object( dataset_id="YOUR_DATASET_ID", object_name="brushwood_dog.jpg", tags=["dog"], # max 5 tags per dataset object. + licenses=["MIT", "my-license"], # max 10 licenses per dataset object annotations=[ { "keypoints": [ diff --git a/examples/create_dataset.py b/examples/create_dataset.py index 151169d..44671a5 100644 --- a/examples/create_dataset.py +++ b/examples/create_dataset.py @@ -4,6 +4,6 @@ client = fastlabel.Client() -dataset = client.create_dataset(name="object-detection", license="The MIT License") +dataset = client.create_dataset(name="object-detection") pprint(dataset) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 5adb4b1..ee4fee5 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -3881,7 +3881,7 @@ def get_datasets( return self.api.get_request(endpoint, params=params) def create_dataset( - self, name: str, tags: List[str] = [], visibility: str = None, license: str = "" + self, name: str, tags: List[str] = [], visibility: str = None ) -> dict: """ Create a dataset. @@ -3889,10 +3889,9 @@ def create_dataset( name is name of your dataset. Only lowercase alphanumeric characters + hyphen is available (Required). tags is a list of tag (Optional). visibility are search terms in the dataset visibility.(Optional). - license is a license name of your dataset. (Optional) """ endpoint = "datasets-v2" - payload = {"name": name, "license": license} + payload = {"name": name} if tags: payload["tags"] = tags if visibility: @@ -3959,7 +3958,8 @@ def get_dataset_objects( self, dataset: str, version: str = None, - tags: List[str] = None, + tags: Optional[List[str]] = None, + licenses: Optional[List[str]] = None, revision_id: str = None, offset: int = 0, limit: int = 1000, @@ -3991,6 +3991,8 @@ def get_dataset_objects( tags = tags or [] if tags: params["tags"] = tags + if licenses: + params["licenses"] = licenses return self.api.get_request(endpoint, params=params) def download_dataset_objects( @@ -4088,6 +4090,7 @@ def create_dataset_object( name: str, file_path: str, tags: List[str] = None, + licenses: List[str] = None, annotations: List[dict] = None, custom_metadata: Optional[Dict[str, str]] = None, ) -> dict: @@ -4114,6 +4117,8 @@ def create_dataset_object( } if tags: payload["tags"] = tags + if licenses: + payload["licenses"] = licenses if annotations: payload["annotations"] = annotations if custom_metadata: @@ -4125,6 +4130,7 @@ def update_dataset_object( dataset_id: str, object_name: str, tags: Optional[List[str]] = None, + licenses: Optional[List[str]] = None, annotations: Optional[List[dict]] = None, custom_metadata: Optional[dict] = None, ) -> dict: @@ -4132,6 +4138,8 @@ def update_dataset_object( payload = {"datasetId": dataset_id, "objectName": object_name} if tags is not None: payload["tags"] = tags + if licenses is not None: + payload["licenses"] = licenses if annotations is not None: payload["annotations"] = annotations if custom_metadata is not None: