HumanSignal / label-studio-ml-backend

Configs and boilerplates for Label Studio's Machine Learning backend
Apache License 2.0
534 stars 240 forks source link

Validation Error Arising from Label Mismatch between Grounding DINO Detection and Label Studio Configuration #430

Open Buckler89 opened 8 months ago

Buckler89 commented 8 months ago

Hello,

I'm currently facing a validation error in my Label Studio project, which seems to stem from a discrepancy between the labels detected by the Grounding DINO model and those defined in my Label Studio configuration.

Label Studio Configuration:

My Label Studio configuration, aimed at classifying various ship types, is as follows:

<View>
  <Image name="image" value="$image" zoom="true" zoomControl="true"/>
  <View className="prompt">
    <TextArea name="prompt" toName="image" editable="true" rows="2" maxSubmissions="1" showSubmitButton="true"/>
  </View>
  <!-- Define the bounding box tool -->
  <RectangleLabels name="bbox" toName="image">
    <Label value="Tug" background="#FFA39E"/>
    <Label value="Container" background="#D4380D"/>
    <Label value="Tanker" background="#FFC069"/>
    <Label value="Bulker" background="#AD8B00"/>
    <Label value="Military" background="#D3F261"/>
    <Label value="Cargo" background="#389E0D"/>
    <Label value="Passenger" background="#5CDBD3"/>
    <Label value="Unknown" background="#096DD9"/>
  </RectangleLabels>
  <BrushLabels name="mask" toName="image">
    <Label value="Tug" background="#FFA39E"/>
    <Label value="Container" background="#D4380D"/>
    <Label value="Tanker" background="#FFC069"/>
    <Label value="Bulker" background="#AD8B00"/>
    <Label value="Military" background="#D3F261"/>
    <Label value="Cargo" background="#389E0D"/>
    <Label value="Passenger" background="#5CDBD3"/>
    <Label value="Unknown" background="#096DD9"/>
  </BrushLabels>
</View>

Issue Description:

The issue emerges when the Grounding DINO model is employed to detect objects that don't precisely align with the class labels specified in the configuration. Specifically, the model is utilized for the identification of generic "boat" objects (including 'boats' and 'containers' as additional examples) during the ship classification task. Following the detection of these objects by Grounding DINO, I manually assign the correct class to these detections from my configured list.

However, this process results in the following validation error in Label Studio:

Validation error 57f5c527-1603-477f-91b8-839ee07b5fb1
These labels still exist in annotations or drafts:
boat (2 drafts)
boats (15 drafts)
containers (1 draft)
Please add labels to tag with name="bbox".

It seems that the 'boat', 'boats', and 'containers' labels, identified by the Grounding DINO model, are not included in the final list of labels and are triggering validation issues due to their absence in the configuration. Complicating matters, these annotations are not visible in the Label Studio interface, posing a direct challenge to rectifying the issue.

Request for Assistance:

I am seeking guidance or solutions to align the labels detected by the Grounding DINO model with the labels defined in my Label Studio configuration and to address the aforementioned validation error. Additionally, any advice on handling annotations that are affecting validation but are not visible within the Label Studio interface would be highly beneficial.

Thank you for your attention to this matter.

imaginaryBuddy commented 4 months ago

Hi, I am facing some validation error issues as well, and it occurs when I want to change the interface/ some fields. Are there any updates or assistance on this?

I'd like some assistance into explaining what this validation error means: image

Does that mean that somehow the Quality tag is required? I've already put required="false" for Quality, and have no idea why this is still occurring.

ofekp commented 3 weeks ago

I have the same issue image seems to be things I wrote as prompt for the backend ML and they stick around somewhere.