diff --git a/mmdet/models/detectors/grounding_dino.py b/mmdet/models/detectors/grounding_dino.py index 69d398bec8f..24518e62edd 100644 --- a/mmdet/models/detectors/grounding_dino.py +++ b/mmdet/models/detectors/grounding_dino.py @@ -113,7 +113,11 @@ def get_tokens_and_prompts( return tokenized, caption_string, tokens_positive, entities def get_positive_map(self, tokenized, tokens_positive): - positive_map = create_positive_map(tokenized, tokens_positive) + positive_map = create_positive_map( + tokenized, + tokens_positive, + max_num_entities=self.bbox_head.cls_branches[ + self.decoder.num_layers].max_text_len) positive_map_label_to_token = create_positive_map_label_to_token( positive_map, plus=1) return positive_map_label_to_token, positive_map