specifying ids when export data does not work
Per the document, when export data of a project, we can specify the ids param to indicate the tasks of interest and only export data relevant to these tasks.
Docs for using SDK here
Docs for using API here
But when I actually specified ids, the exports always contained all annotations and relevant resources( if download_resources set to true)
To Reproduce Steps to reproduce the behavior:
- Using API:
curl -G http://<host>:<port>/api/projects/<project_id>/export \
-H "Authorization: Token <api_key>" \
-d export_type=VOC \
-d download_all_tasks=false \
-d download_resources=true \
-d ids=[<some int ids>]
- Using SDK:
# python version 3.12.2
# SDK version 1.0.5
from label_studio_sdk import Client
ls = Client(url=url, api_key=key)
project = ls.get_project(projectID)
results = project.export_tasks(
export_type=VOC,
download_resources=True,
download_all_tasks=False,
ids=[list of task ids],
export_location=<location>,
)
Any ideas why the ids not taking effect and it always export all data?
I tested export formats of both JSON and VOC, got same results.
Help appreciated.
Hi @Lynxiayel - to clarify, does this issue occur only when download_resources is set to True?
Hi @jombooth. No, whatever the value of download_resources is, the id filter isn't working, all annotations are exported.
same problem here.
The issue appears to be that label studio is using a somewhat unconventional style for specifying the id query parameters. Instead of this:
export?ids=123,456
You need this:
export?ids[]=123&ids[]=456