chensnathan / YOLOF

You Only Look One-level Feature (YOLOF), CVPR2021, Detectron2
MIT License
271 stars 28 forks source link

The Uniform Matching part of the paper and the code are inconsistent #2

Closed hhaAndroid closed 3 years ago

hhaAndroid commented 3 years ago

Very good job, but I don't know why The Uniform Matching part of the paper and the code are inconsistent?

paper:

  1. adopting the k nearest anchor as positive anchors for each ground-truth box
  2. set IoU thresholds in Uniform Matching to ignore large IoU (>0:7) negative anchors and small IoU (<0.15) positive anchors

code:

# positive indices when matching predict boxes and gt boxes
        indices = [
            tuple(
                torch.topk(
                    c[i],
                    k=self.match_times,
                    dim=0,
                    largest=False)[1].numpy().tolist()
            )
            for i, c in enumerate(C.split(sizes, -1))
        ]
 # positive indices when matching anchor boxes and gt boxes
        indices1 = [
            tuple(
                torch.topk(
                    c[i],
                    k=self.match_times,
                    dim=0,
                    largest=False)[1].numpy().tolist())
            for i, c in enumerate(C1.split(sizes, -1))]

Looking forward to your answer!

chensnathan commented 3 years ago

Hi, thanks for your interest.

In the uniform_matcher, we mark the indexes of both topk anchors and topk predict boxes as positives, which gives stable and slightly higher performance than only use the topk anchors(37.7 vs. 37.1).

We implement the code for thresholds in the loss function. You can find it here(L344-L365).

hhaAndroid commented 3 years ago

Hi. thank you for your reply. Thanks, I get it. I think this step is more critical. Have you considered updating the paper about uniform_matcher?

chensnathan commented 3 years ago

Thanks for your advice. Although I don't agree with the idea that the step is more critical, I will update the paper with this part.

hhaAndroid commented 3 years ago

Thank you for your reply. Looking forward to your future work!