detrex
detrex copied to clipboard
Single Class detection
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.
You can train your own custom dataset with one class as follows:
- Convert your dataset annotation to
COCO
format - Register your own dataset follow: custom.py
- Modify the model config to
model.num_classes=1
- Modify the criterion config to
num_classes=1
how can I modify model.num_classes and num_classes? I have not found them. In advance thanks.
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: https://github.com/IDEA-Research/detrex/blob/f34380d3652c0dbc8f9de911626117943a8208c4/projects/dino_eva/configs/models/dino_r50.py#L76
@wwhhh2000
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:
https://github.com/IDEA-Research/detrex/blob/f34380d3652c0dbc8f9de911626117943a8208c4/projects/dino_eva/configs/models/dino_r50.py#L76
@wwhhh2000
Thank you so much!