faster_rcnn_pytorch
faster_rcnn_pytorch copied to clipboard
a question about the tp and tf in faster_rcnn.py
Hi, first of all, I appreciate this implementation code provided by longcw. I like your code. I have a small question in faster_rcnn.py from line 255-250 there is a code section about the tp and tf as follows `
for log
if self.debug:
maxv, predict = cls_score.data.max(1)
self.tp = torch.sum(predict[:fg_cnt].eq(label.data[:fg_cnt])) if fg_cnt > 0 else 0
self.tf = torch.sum(predict[fg_cnt:].eq(label.data[fg_cnt:]))
self.fg_cnt = fg_cnt
self.bg_cnt = bg_cnt
`
what I feel confused about is predict[:fg_cnt].eq(label.data[:fg_cnt]). Afer reading the code many times, I didn't see that the first fg_cnt entires in label are defined as the fg label. I also tried to print label.data[:fg_cnt], not all of them always have the fg label. Do I miss something in the code? Thanks.
@wtliao Yeah, I am confused about it,too. Have you figured it out?