playground icon indicating copy to clipboard operation
playground copied to clipboard

Export data error

Open TonyMacedonia opened this issue 2 years ago • 4 comments

When I select the COCO format to export, the following error occurs.

Traceback (most recent call last): File "F:\Anaconda\anaconda\envs\rtmdet-sam\lib\site-packages\rest_framework\views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "F:\Anaconda\anaconda\envs\rtmdet-sam\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "F:\Anaconda\anaconda\envs\rtmdet-sam\lib\site-packages\label_studio\data_export\api.py", line 183, in get export_stream, content_type, filename = DataExport.generate_export_file( File "F:\Anaconda\anaconda\envs\rtmdet-sam\lib\site-packages\label_studio\data_export\models.py", line 161, in generate_export_file converter.convert(input_json, tmp_dir, output_format, is_dir=False) File "F:\Anaconda\anaconda\envs\rtmdet-sam\lib\site-packages\label_studio_converter\converter.py", line 209, in convert self.convert_to_coco( File "F:\Anaconda\anaconda\envs\rtmdet-sam\lib\site-packages\label_studio_converter\converter.py", line 700, in convert_to_coco (x / 100 * width, y / 100 * height) for x, y in label["points"] KeyError: 'points'

TonyMacedonia avatar May 06 '23 03:05 TonyMacedonia

Maybe you need to check your xml configuration.

<View>
  <Image name="image" value="$image" zoom="true"/>
  <KeyPointLabels name="KeyPointLabels" toName="image">
    <Label value="cat" smart="true" background="#e51515" showInline="true"/>
    <Label value="person" smart="true" background="#412cdd" showInline="true"/>
  </KeyPointLabels>
  <RectangleLabels name="RectangleLabels" toName="image">
  	<Label value="cat" background="#FF0000"/>
  	<Label value="person" background="#0d14d3"/>
  </RectangleLabels>
  <PolygonLabels name="PolygonLabels" toName="image">
  	<Label value="cat" background="#FF0000"/>
  	<Label value="person" background="#0d14d3"/>
  </PolygonLabels>
  <BrushLabels name="BrushLabels" toName="image">
  	<Label value="cat" background="#FF0000"/>
  	<Label value="person" background="#0d14d3"/>
  </BrushLabels>
</View>

JimmyMa99 avatar May 07 '23 13:05 JimmyMa99

I got the same error. I don't see much difference between my XML and your example configuration.

jianzhangru avatar May 11 '23 23:05 jianzhangru

Can you provide the xml for inspection?

JimmyMa99 avatar May 12 '23 02:05 JimmyMa99

Sure.

<View>
  <Image name="image" value="$image" zoom="true"/>
  <KeyPointLabels name="KeyPointLabels" toName="image">
    <Label value="object" smart="true" background="red" showInline="true"/>
  </KeyPointLabels>
  <RectangleLabels name="RectangleLabels" toName="image">
  	<Label value="object" background="blue"/>
  </RectangleLabels>
  <PolygonLabels name="PolygonLabels" toName="image">
  	<Label value="object" background="green"/>
  </PolygonLabels>
  <BrushLabels name="BrushLabels" toName="image">
  	<Label value="object" background="#8F4000"/>
  </BrushLabels>
</View>

jianzhangru avatar May 12 '23 02:05 jianzhangru