Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong class name while running annotate.py script #14

Open
AgriMechatronic opened this issue Feb 4, 2023 · 6 comments
Open

Wrong class name while running annotate.py script #14

AgriMechatronic opened this issue Feb 4, 2023 · 6 comments

Comments

@AgriMechatronic
Copy link

Hello, first of all thanks a lot for this repo, I have one question:
I am doing my own object detection using your google colab, I load my dataset and train it using your script. But when I run the annotate.py, it is doing detection good but name should not be pistol. When I run model with different script I can see that model is detecting with good class name. But when I run with annotate.py, class name is wrong. Why this happens?
Thanks.

@AgriMechatronic AgriMechatronic changed the title Bad class name while running annotate.py script Wrong class name while running annotate.py script Feb 4, 2023
@dnth
Copy link
Owner

dnth commented Feb 6, 2023

When you train the model, what do you have in the .yaml file? For example, here's mine

https://github.com/dnth/yolov5-deepsparse-blogpost/blob/main/yolov5-train/data/pistols.yaml

@Agri-Mechatronic
Copy link

Yaml file is similar, instead of pistols in path, I have my weeds directory, and names:[‘Weeds’]

Algorithm is detecting weeds but class name is pistol. When I run trained model with different(not with annotate.py) script with torch engine, class name is correct. I tried to edit pistols.yaml file and train but result was same, I also tried changing yaml file in training script with my own yaml file (data.yaml), I tried to do training without ‘weights’ parameter, and finally I tried to do training with yolov5s.pt as weights parameter(I got it from official yolov5 repository) but results are same. When the training is done, in that directory we can find files and photos about training and validation. In training photos I saw that class name is 0. In validation photos class name is Weeds, so it’s correct. Could be anything wrong with annotate.py script? I can send dataset link from roboflow if you want to try.
Thank you.

@dnth
Copy link
Owner

dnth commented Feb 6, 2023

In that case you might want to change this line

@AgriMechatronic
Copy link
Author

It worked thanks a lot, I have one more question:
How can I get the values about bounding box (x,y,w,h) from annotate.py file?
I want to get that values and send them via USB.
Thank you again.

@TDBTECHNO
Copy link

it will come from deepsparse_utils.py on annotate function

@Agri-Mechatronic
Copy link

Agri-Mechatronic commented Apr 23, 2023

Thanks a lot, I will try it. Do I need a linux system in order to run script locally(in vscode or pycharm,not in google colab)?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants