Open puranjay123 opened 1 year ago
I also had a similar error as you. I don't know if my experience will be helpful, but I'm writing this in hopes of your luck. My case is as follows: CLASSES =["van","car"]
Grounddino generated a "van car" phrase that I did not specify, and an error occurred because it was not in CLASSES =["van","car"].
My solution is to change 'van car' to 'van'.
The following code was inserted at line 201 of the groundingdino/util/inference.py file.
phrases_copy = phrases.copy()
for index_phrase,phrase in enumerate(phrases_copy):
if phrase.find(' ') != -1:
phrases[index_phrase] = phrase[:phrase.find(' ')]
@3942368 why this occur?
@yxchng When gronding-dino thinks there are different labels in the same image area, it creates a new label.
In my case, 'car' and 'van'were created in the exact same area of the image, and gronding-dino created a new label called 'van car' that I did not specify.
So an error occurred.
In my case, the' van' and 'car' labels caused the problem. The superior probably had 'snacks', 'candy' that caused the problem.
Anyway, the new label created by gronding-dino is created as a combination of the labels I created, so my idea is to change the label created by gronding-dino to the label I created
Hi, @rentainhe
I am trying to run grounding-dino-sam notebook when I tried with custom data ,it is giving error(stated below):
What I think and found: I found out that When the labels I have written and the labels detected by the model even mismatch by a little bit the code throws an error stated below. In a normal scenario there should be multiple labels and if there is a mismatch in Class labels and labels getting out from the model it should simply ignore the mismatched labels. When I try with default class the output is getting just fine
CLASSES = ['car', 'dog', 'person', 'nose', 'chair', 'shoe', 'ear']
when I used my CLASSES labels it is throwing error stated below:CLASSES = ['dog' , 'paper' , 'cup' , 'Snack' , 'Candy' , 'Bag', 'Wrapper']
here is the link of my collab notebook here in which I encountered the error.here is the list of the original collab notebook: here
here is the link for images that I used: here