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

Regarding tnc and combine_classes and detection head #85

Open
AkshatDogra opened this issue Sep 27, 2024 · 4 comments
Open

Regarding tnc and combine_classes and detection head #85

AkshatDogra opened this issue Sep 27, 2024 · 4 comments

Comments

@AkshatDogra
Copy link

Hi,
a.Suppose in my model.train my args are like this:
device=[1,2],
classes=[0, 2, 3, 4, 7, 8, 10, 11],
combine_class=[2, 3, 4],
single_cls=False,

Can you please tell me what should be my:
1.tnc
2.nc_list
3. Value of detection head in model.yaml file.
be?

b. Also if I want to merge multiple classes into 2 subclasses like [2,3,4] into 1 and [7,8] into another, should my val for combine_class be
[[2,3,4],[7,8]] ?

@JiayuanWang-JW
Copy link
Owner

  1. 8
  2. I do not know how many detection and segmentation tasks you have and how many heads you used. So please provide more information about what I mentioned.
  3. I think you only have one detection head and classes 2, 3, 4 for the detection task, right? If so, you should be set 3.

b. You need to modify the code to implement the function you mentioned. This is an advanced work.

@AkshatDogra
Copy link
Author

Hi,
Sorry for the late reply.
I only have 1 detection head and 2 segmentation heads and I want to use [0, 2, 3, 4, 7, 8] for detection. In which I want to merge [2,3,4] into a single class.

@JiayuanWang-JW
Copy link
Owner

  1. 8
  2. [6,1,1]
  3. 6

combine_class do not effect the training stage. Only effect in val stage. That means, during training, the model will learn 0 2 3 4 7 8 separately, only in val stage, the model will combine 2 3 4 into class 2 to calculate the metrics.

If you set single_cls as True, that is another story.

@AkshatDogra
Copy link
Author

Hi,
I tried doing this but I am getting this error.
This is happening whenever I set single_cls to False.
I tried a fresh git clone and created a new env with the steps that you mentioned, double checked the python and the torch version. And tried this on the default ultralytics/train.py script but changed single_cls to false from the default True.

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

2 participants