xingyizhou / CenterNet2

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

Use mmdet to reproduce the model #59

Open zhaoxin111 opened 3 years ago

zhaoxin111 commented 3 years ago

First of all, CenterNet is a very meaningful work, and the author has also done a wealth of experimental papers on the effectiveness of this work.

I tried to use mmdetection to reproduce this work. First, I replaced the RPN with retinanet and reproduced the comparative results of the ablation experiment in the paper. The results showed that the increase point is very obvious.

When I reproduced centernet, I found that the model was quite different from the original centerNet. It seemed that only the centernet set was used for heat map loss. I reproduced the model and loss, only the data enhancement is not aligned, and the reproduced centernet is only 33.9 in the map.

Is anyone else reappearing, and exchange experiences.

LMerCy commented 2 years ago

Have you ever increase the positive iou threshold for rcnn, and increase the nms threhold of retinanet for more proposals?

Following Wang et al.(2019), we increase the positive IoU threshold in the second stage from 0.5 to 0.6 for Faster RCNN
 (and 0.6, 0.7, 0.8 for CascadeRCNN) to compensate for the IoU distribution change in the second stage. We use a maximum of 256 pro-
posal boxes in the second stage for probabilistic two-stage detectors, and use the default 1K boxes for RPN-based models
unless stated otherwise. We also increase the NMS threshold from 0.5 to 0.7 for our probabilistic detectors as we use fewer
proposals. These hyperparameter-changes is necessary for probabilistic detectors, but we found they do not improve the RPN-
based detector in our experiments.
zhaoxin111 commented 2 years ago

Have you ever increase the positive iou threshold for rcnn, and increase the nms threhold of retinanet for more proposals?

Following Wang et al.(2019), we increase the positive IoU threshold in the second stage from 0.5 to 0.6 for Faster RCNN
 (and 0.6, 0.7, 0.8 for CascadeRCNN) to compensate for the IoU distribution change in the second stage. We use a maximum of 256 pro-
posal boxes in the second stage for probabilistic two-stage detectors, and use the default 1K boxes for RPN-based models
unless stated otherwise. We also increase the NMS threshold from 0.5 to 0.7 for our probabilistic detectors as we use fewer
proposals. These hyperparameter-changes is necessary for probabilistic detectors, but we found they do not improve the RPN-
based detector in our experiments.

Yes,all settings are referred to the paper and source code.

LMerCy commented 2 years ago

@zhaoxin111 Hello, would you open source your reimplementation of retinanet+rcnn?

zhaoxin111 commented 2 years ago

@zhaoxin111 Hello, would you open source your reimplementation of retinanet+rcnn?

The code will be open sourced after I finish it.

BjoernNieth commented 2 years ago

Hey, I am happy to see, that someone else is also trying to use CenterNet2 in mmdetection.

As for now, I didn't manage to get a running version of my CenterNet2 implementation in mmdetection. Since I am facing a lot of difficulties and I am also farly new to the computer vision enviroment, I wanted to ask, what was your approach to get your CenterNet2 running.

Did you copied the original source code from the detectron2 implementation and just changed the code to run on mmdetection or did you reimpelemented the modules from scratch?

zhaoxin111 commented 2 years ago

Hey, I am happy to see, that someone else is also trying to use CenterNet2 in mmdetection.

As for now, I didn't manage to get a running version of my CenterNet2 implementation in mmdetection. Since I am facing a lot of difficulties and I am also farly new to the computer vision enviroment, I wanted to ask, what was your approach to get your CenterNet2 running.

Did you copied the original source code from the detectron2 implementation and just changed the code to run on mmdetection or did you reimpelemented the modules from scratch?

Most of the code refers to what the original author wrote, but many details need to be aligned with mmdet.

xingyizhou commented 2 years ago

Hi, Thanks a lot for your effort in reproducing our work on mmdetection and sorry for my very delayed response (I didn't check Github issues regularly. For detailed or urgent issues, sending me an email is more effective).

When I reproduced centernet*, I found that the model was quite different from the original centerNet. It seemed that only the centernet set was used for heat map loss.

I agree the code is very different. For a clearer illustration, it is easier to first understand the original CenterNet (stride 4) --> CenterNet-FPN. In the FPN mode, we have multiple outputs, and we need to separate the positive loss and negative loss for different FPN levels. Negative losses (all pixels) are applied to all FPN levels, but positive losses are only applied to selected levels (based on object size).

Next, from CenterNet-FPN to CenterNet*. The only difference is now we add more positive pixels (whose IoU is already large). See this function for more details.

I reproduced the model and loss, only the data enhancement is not aligned, and the reproduced centernet* is only 33.9 in the map.

Sorry I didn't understand this question. What do you mean by data enhancement is not aligned? Data augmentation? Our main models in the paper use the same augmentation as mmdetection (640-800 x 1333). If you send me an email, I am happy to share my wechat so that we can communicate more efficiently in Chinese.

Best, Xingyi