Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to export tasks as VOC which were created using api #5875

Closed
LouisDealX opened this issue May 13, 2024 · 2 comments
Closed

Unable to export tasks as VOC which were created using api #5875

LouisDealX opened this issue May 13, 2024 · 2 comments

Comments

@LouisDealX
Copy link

Describe the bug
Tasks with images were uploaded via the api/tasks endpoint. An image was converted to a base 64 string and then attached as image data. Tasks with images appear in UI and I was able to annotate however exporting to VOC I get the following error:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/django/utils/decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "/label-studio/label_studio/data_export/api.py", line 200, in get export_stream, content_type, filename = DataExport.generate_export_file( File "/label-studio/label_studio/data_export/models.py", line 161, in generate_export_file converter.convert(input_json, tmp_dir, output_format, is_dir=False) File "/usr/local/lib/python3.10/dist-packages/label_studio_converter/converter.py", line 230, in convert self.convert_to_voc( File "/usr/local/lib/python3.10/dist-packages/label_studio_converter/converter.py", line 1100, in convert_to_voc with io.open(xml_filepath, mode='w', encoding='utf8') as fout: OSError: [Errno 36] File name too long: '/tmp/tmpikbmhpt8/Annotations/P37t179uzZwsJCJkVJSalPnz4LFizA4GkKAoEcAAAAAAAAAAAAAIBfWnZ2dlhYWFpamo6OjoODQ3mnhIfvCoEcAAAAAAAAAAAAAAAABYU5cgAAAAAAAAAAAAAAABQUAjkAAAAAAAAAAAAAAAAKCoEcAAAAAAAAAAAAAAAABYVADgAAAAAAAAAAAAAAgIJCIAcAAAAAAAAAAAAAAEBBIZADAAAAAAAAAAAAAACgoBDIAQAAAAAAAAAAAAAAUFAI5AAAAAAAAAAAAAAAACgoBHIAAAAAAAAAAAAAAAAUFAI5AAAAAAAAAAAAAAAACgqBHAAAAAAAAAAAAAAAAAWFQA4AAAAAAAAAAAAAAICCQiAHAAAAAAAAAAAAAABAQSGQAwAAAAAAAAAAAAAAoKAQyAEAAAAAAAAAAAAAAFBQCOQAAAAAAAAAAAAAAAAoKARyAAAAAAAAAAAAAAAAFBQCOQAAAAAAAAAAAAAAAAoKgRwAAAAAAAAAAAAAAAAFhUAOAAAAAAAAAAAAAACAgkIgBwAAAAAAAAAAAAAAQEEhkAMAAAAAAAAAAAAAAKCgEMgBAAAAAAAAAAAAAABQUAjkAAAAAAAAAAAAAAAAKCgEcgAAAAAAAAAAAAAAABQUAjkAAAAAAAAAAAAAAAAKCoEcAAAAAAAAAAAAAAAABYVADgAAAAAAAAAAAAAAgIJCIAcAAAAAAAAAAAAAAEBBIZADAAAAAAAAAAAAAACgoBDIAQAAAAAAAAAAAAAAUFAI5AAAAAAAAAAAAAAAACgoBHIAAAAAAAAAAAAAAAAUFAI5AAAAAAAAAAAAAAAACgqBHAAAAAAAAAAAAAAAAAWFQA4AAAAAAAAAAAAAAICCQiAHAAAAAAAAAAAAAABAQf0PXkGnuqSq0gAAAAAASUVORK5CYII=.xml'

Expected behavior
Tasks with annotations should be exported in VOC format and downloaded as a zip file,

Screenshots
image

Environment (please complete the following information):

  • OS: Docker Image
  • Label Studio Version 1.12.0
@LouisDealX LouisDealX changed the title Unable to export as VOC which was created using api Unable to export tasks as VOC which was created using api May 13, 2024
@LouisDealX LouisDealX changed the title Unable to export tasks as VOC which was created using api Unable to export tasks as VOC which were created using api May 13, 2024
@LouisDealX
Copy link
Author

Payload used:
payload = { "data": { "image": f"data:image/png;base64,{base64_image}", }, "project": project }

@makseq
Copy link
Member

makseq commented May 13, 2024

It won't be possible to export images to other formats when you use base64 directly in task data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants