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

Single Class detection #267

Open
CloudRider-pixel opened this issue May 29, 2023 · 4 comments
Open

Single Class detection #267

CloudRider-pixel opened this issue May 29, 2023 · 4 comments

Comments

@CloudRider-pixel
Copy link

Hi,

I successfully train detr_50 on my custom dataset.
Nevertheless, it's a single-class one.
What I have to change in order to train this model on a single class problem ?
For example in projects/detr_r50 I saw that the number of classes is harcoded to 80 (coco), also loss is CE which normally is not suited.

In advance thanks,

Max.

@rentainhe
Copy link
Collaborator

You can train your own custom dataset with one class as follows:

  1. Convert your dataset annotation to COCO format
  2. Register your own dataset follow: custom.py
  3. Modify the model config to model.num_classes=1
  4. Modify the criterion config to num_classes=1

@wwhhh2000
Copy link

how can I modify model.num_classes and num_classes? I have not found them.
In advance thanks.

@rentainhe
Copy link
Collaborator

how can I modify model.num_classes and num_classes? I have not found them. In advance thanks.

They have been defined in the model config, you can find them here:

@wwhhh2000

@wwhhh2000
Copy link

how can I modify model.num_classes and num_classes? I have not found them. In advance thanks.

They have been defined in the model config, you can find them here:

@wwhhh2000

Thank you so much!

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

3 participants