unitlab 2.4.3__tar.gz → 2.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unitlab-2.4.3 → unitlab-2.4.5}/PKG-INFO +1 -1
- {unitlab-2.4.3 → unitlab-2.4.5}/pyproject.toml +1 -1
- {unitlab-2.4.3 → unitlab-2.4.5}/src/unitlab/cli.py +6 -9
- {unitlab-2.4.3 → unitlab-2.4.5}/src/unitlab/client.py +15 -10
- {unitlab-2.4.3 → unitlab-2.4.5}/.claude/settings.local.json +0 -0
- {unitlab-2.4.3 → unitlab-2.4.5}/.gitignore +0 -0
- {unitlab-2.4.3 → unitlab-2.4.5}/LICENSE.md +0 -0
- {unitlab-2.4.3 → unitlab-2.4.5}/README.md +0 -0
- {unitlab-2.4.3 → unitlab-2.4.5}/src/unitlab/__init__.py +0 -0
- {unitlab-2.4.3 → unitlab-2.4.5}/src/unitlab/__main__.py +0 -0
- {unitlab-2.4.3 → unitlab-2.4.5}/src/unitlab/_config.py +0 -0
- {unitlab-2.4.3 → unitlab-2.4.5}/src/unitlab/exceptions.py +0 -0
|
@@ -37,12 +37,6 @@ class DownloadType(str, Enum):
|
|
|
37
37
|
files = "files"
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
class DatasetSplit(str, Enum):
|
|
41
|
-
train = "train"
|
|
42
|
-
validation = "validation"
|
|
43
|
-
test = "test"
|
|
44
|
-
|
|
45
|
-
|
|
46
40
|
@app.command(help="Configure the credentials")
|
|
47
41
|
def configure(
|
|
48
42
|
api_key: Annotated[
|
|
@@ -124,11 +118,14 @@ def dataset_download(
|
|
|
124
118
|
typer.Option(help="Export type (e.g. COCO, YOLOv8, YOLOv5, UUEF)"),
|
|
125
119
|
] = "COCO",
|
|
126
120
|
split_type: Annotated[
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
str | None,
|
|
122
|
+
typer.Option(
|
|
123
|
+
help="Dataset split (e.g. train, validation). Auto-detected if omitted."
|
|
124
|
+
),
|
|
125
|
+
] = None,
|
|
129
126
|
):
|
|
130
127
|
if download_type == DownloadType.annotation:
|
|
131
|
-
get_client(api_key).dataset_download(str(pk), export_type, split_type
|
|
128
|
+
get_client(api_key).dataset_download(str(pk), export_type, split_type)
|
|
132
129
|
else:
|
|
133
130
|
typer.echo(get_client(api_key).dataset_download_files(str(pk)))
|
|
134
131
|
|
|
@@ -309,16 +309,19 @@ class UnitlabClient:
|
|
|
309
309
|
return self._get(f"/api/sdk/datasets/?pretty={pretty}")
|
|
310
310
|
|
|
311
311
|
def dataset_download(
|
|
312
|
-
self,
|
|
312
|
+
self,
|
|
313
|
+
dataset_id: str,
|
|
314
|
+
export_type: str,
|
|
315
|
+
split_type: str | None = None,
|
|
313
316
|
) -> str:
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
)
|
|
317
|
+
data: dict[str, Any] = {
|
|
318
|
+
"download_type": "annotation",
|
|
319
|
+
"export_type": export_type,
|
|
320
|
+
}
|
|
321
|
+
if split_type is not None:
|
|
322
|
+
data["split_type"] = split_type
|
|
323
|
+
|
|
324
|
+
response = self._post(f"/api/sdk/datasets/{dataset_id}/", data=data)
|
|
322
325
|
|
|
323
326
|
file_url = response["file"]
|
|
324
327
|
try:
|
|
@@ -397,7 +400,9 @@ class UnitlabClient:
|
|
|
397
400
|
|
|
398
401
|
async def main() -> None:
|
|
399
402
|
with tqdm.tqdm(total=len(files_to_download), ncols=80) as pbar:
|
|
400
|
-
async with httpx.AsyncClient(
|
|
403
|
+
async with httpx.AsyncClient(
|
|
404
|
+
timeout=600.0, follow_redirects=True
|
|
405
|
+
) as client:
|
|
401
406
|
tasks = [
|
|
402
407
|
download_file(client=client, dataset_file=df)
|
|
403
408
|
for df in files_to_download
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|