label-studio: Exception in Export to YOLO

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to Project
  2. Click on Export
  3. Select format YOLO
  4. After some seconds have exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/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 181, 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.8/dist-packages/label_studio_converter/converter.py", line 174, in convert
    self.convert_to_yolo(input_data, output_data, output_image_dir=image_dir,
  File "/usr/local/lib/python3.8/dist-packages/label_studio_converter/converter.py", line 597, in convert_to_yolo
    category_name = label['rectanglelabels'][0]
IndexError: list index out of range

Expected behavior zip file with exported labels downloaded

Environment (please complete the following information):

  • OS: docker
  • Label Studio Version 1.4

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 31 (8 by maintainers)

Most upvoted comments

嘿,我遇到了同样的问题。 你是怎么解决的? 我在数据中找不到空注释结果。

https://github.com/heartexlabs/label-studio/issues/1841#issuecomment-1000986987

Please check my reply and modify the code I marked