HumanSignal / HumanSignal/label-studio-sdk

How can I use export_snapshot_create & export_snapshot_download to download a zip including images?

Open
#128 7 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
192
Forks
127
Avg merge
1d 18h
Merged PRs (30d)
1

Description

Hi! I encountered an issue when I use label studio SDK for Python. I use export_snapshot_create & export_snapshot_download to download project task results in type of YOLO as a zipfile, but no image files in it, my code as following:

```Python
# Define the URL where Label Studio is accessible and the API key for your user account
LABEL_STUDIO_URL = 'http://172.16.250.101:31010' # 'http://mlops-ls-app:80'
API_KEY = '3f968a3eefd3d17aa1f4fb70dc13e677995f88f8'

# Import the SDK and the client module
from label_studio_sdk import Client

# Connect to the Label Studio API and check the connection
ls = Client(url=LABEL_STUDIO_URL, api_key=API_KEY)
ls.check_connection()

PROJECT_ID = 1
'''
https://github.com/heartexlabs/label-studio-converter/blob/master/label_studio_converter/converter.py#L44

SUPPORTED FORMATS:
JSON = 1
JSON_MIN = 2
CSV = 3
TSV = 4
CONLL2003 = 5
COCO = 6
VOC = 7
BRUSH_TO_NUMPY = 8
BRUSH_TO_PNG = 9
ASR_MANIFEST = 10
YOLO = 11
CSV_OLD = 12
'''
EXPORT_TYPE = 'YOLO'

project = ls.get_project(PROJECT_ID)

result = project.export_snapshot_create(
title='export-test-01',
task_filter_options={
'view': 1,
'finished': 'only', # include all finished tasks (is_labeled = true)
'annotated': 'only', # include all tasks with at least one not skipped annotation
}
)
print('create snapshot for project {}: {}'.format(PROJECT_ID, result['status']))

result = project.export_snapshot_download(
export_id=result['id'],
export_type=EXPORT_TYPE,
path='.'
)
status, zip_file_path = result
print('download snapshot for project {}: {}'.format(PROJECT_ID, status))
```

I successfully downloaded a YOLO annotation result zipfile, but it has no any files in image folder. What parameters can I set to do this?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.