deepinsight / deepinsight/insightface

How to make the head of each branch have a different name loss_cls?

Open
#2,097 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

I printed the model structure.
```python
(bbox_head): SCRFDHead(
(loss_cls): QualityFocalLoss()
(loss_bbox): DIoULoss()
(relu): ReLU(inplace=True)
(cls_stride_convs): ModuleDict(
((8, 8)): ModuleList(
(0): DepthwiseSeparableConvModule(
(depthwise_conv): ConvModule(
(conv): Conv2d(24, 24, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=24, bias=False)
(bn): BatchNorm2d(24, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(activate): ReLU(inplace=True)
```
And then I read the model layer by layer. I found that the loss cls of each head branch is called the same name.
**I want to use different names to distinguish the loss of each branch**, like the `cls_stride_convs`, which uses the `(8, 8), (16, 16), (32, 32)` to distinguish each branch.

The result I want may be like this:
```python
(loss_cls): ModuleDict(
(8, 8): QualityFocalLoss()
(16,16): QualityFocalLoss()
(32,32): QualityFocalLoss()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.