label-studio icon indicating copy to clipboard operation
label-studio copied to clipboard

specifying ids when export data does not work

Open Lynxiayel opened this issue 1 year ago • 3 comments

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:

  1. 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>]

  1. 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.

Lynxiayel avatar Sep 01 '24 19:09 Lynxiayel

Hi @Lynxiayel - to clarify, does this issue occur only when download_resources is set to True?

jombooth avatar Sep 04 '24 23:09 jombooth

Hi @jombooth. No, whatever the value of download_resources is, the id filter isn't working, all annotations are exported.

Lynxiayel avatar Sep 10 '24 13:09 Lynxiayel

same problem here.

freedreamer82 avatar Sep 13 '24 09:09 freedreamer82

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

jhawson avatar Mar 31 '25 13:03 jhawson