xingyizhou / CenterNet2

Two-stage CenterNet
Apache License 2.0
1.19k stars 189 forks source link

Initialization of bias of "bbox_pred" in CenterNetHead #71

Open greatwallet opened 2 years ago

greatwallet commented 2 years ago

📚 Documentation

Hi! Thank you for your inspiring work!

Currently I am doing some modification upon the codes and before that I have to understand them. I have run into the initialization code above. Why do you initialize bbox_pred.bias with 8? Is this some magic number?

xingyizhou commented 2 years ago

Hi, Thank you for your interest and sorry for my delayed response. The motivation to init bias to 8 is to provide initialization for the IoU-based setting (when MODEL.CENTERNET.MORE_POS is on). 8 is from the anchor-size in anchor-based detectors (8 * FPN_stride = anchor_size). It does not improve the performance, but without it, I observed NaN when MODEL.CENTERNET.MORE_POS is on.