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

incompatible annotations with provided labeling schema

Open OverFitted opened this issue 10 months ago • 0 comments

Describe the bug Labeling scheme is giving "Created annotations are incompatible with provided labeling schema, we found: 12101 with ..." which is impossible as I only have: Tasks: 10436 Annotations: 1186 Predictions: 1497

The project's labeling schema was working perfectly fine at least one month ago (I'm not sure, if label studio was updated during this time period)

To Reproduce Steps to reproduce the behavior:

  1. Go to project
  2. Click on "Settings"
  3. Click on "Labeling Interface"
  4. See error

Expected behavior Labeling scheme rendering properly

Screenshots Screenshot 2024-04-23 at 22 14 47

Environment (please complete the following information):

  • OS: Ubuntu 20.04
  • Label Studio Version 1.12.0

Additional information: Label scheme:

<View>
  <Image name="image" value="$ocr" zoom="true" zoomControl="false"
         rotateControl="true" width="100%" height="100%"
         maxHeight="auto" maxWidth="auto"/>

  <RectangleLabels name="bbox" toName="image" strokeWidth="1" smart="true">
    <Label value="First name" background="#FFA39E"/>
    <Label value="Last name" background="#D4380D"/>
    ...
  </RectangleLabels>

  <TextArea name="transcription" toName="image" 
            editable="true" perRegion="true" required="false" 
            maxSubmissions="1" rows="5" placeholder="Recognized Text" 
            displayMode="region-list"/>
</View>

Annotation format:

...
box_annotations = {
    "id": id_gen,
    "original_width": img_width,
    "original_height": img_height,
    "image_rotation": 0,
    "score": conf.item(),
    "value": {
        "x": bbox[0] / img_width * 100,
        "y": bbox[1] / img_height * 100,
        "width": (bbox[2] - bbox[0]) / img_width * 100,
        "height": (bbox[3] - bbox[1]) / img_height * 100,
        "rotation": 0,
        "rectanglelabels": [self.labels[box_cls]],
    },
    "from_name": "bbox",
    "to_name": "image",
    "type": "rectangle",
    "origin": "manual",
}

text_annotations = {
    "id": id_gen,
    "original_width": img_width,
    "original_height": img_height,
    "image_rotation": 0,
    "value": {
        "x": bbox[0] / img_width * 100,
        "y": bbox[1] / img_height * 100,
        "width": (bbox[2] - bbox[0]) / img_width * 100,
        "height": (bbox[3] - bbox[1]) / img_height * 100,
        "rotation": 0,
        "text": txt,
    },
    "from_name": "transcription",
    "to_name": "image",
    "type": "textarea",
    "origin": "manual",
}

results.extend([box_annotations, text_annotations])
...

OverFitted avatar Apr 23 '24 19:04 OverFitted