diff --git a/label_studio_ml/examples/grounding_sam/dino.py b/label_studio_ml/examples/grounding_sam/dino.py index d359aa5c..95274f7b 100644 --- a/label_studio_ml/examples/grounding_sam/dino.py +++ b/label_studio_ml/examples/grounding_sam/dino.py @@ -135,6 +135,10 @@ def predict(self, tasks: List[Dict], context: Optional[Dict] = None, **kwargs) - if not context or not context.get('result'): # if there is no context, no interaction has happened yet return [] + + if len(context['result'][0]['value']['text']) > 1: + # workaround for labelstudio running interactive annotations on submit + return [] from_name_r, to_name_r, value = self.get_first_tag_occurence('RectangleLabels', 'Image') from_name_b, to_name_b, _ = self.get_first_tag_occurence('BrushLabels', 'Image')