pytorch-retinanet icon indicating copy to clipboard operation
pytorch-retinanet copied to clipboard

Threshold filtering fix

Open EzYoloFrodo opened this issue 4 years ago • 0 comments

I have noticed that sometimes when I put some threshold, I receive low score labels.

After debugging I find some issue in this part of code:

https://github.com/yhenon/pytorch-retinanet/blob/39938d285fc3c602ae6a697ff690bbca29a502be/visualize_single_image.py#L103_L119

I use torch 1.7.0

The issue was with idxs usage, I change a part of code, and it's working.

for j in list(idxs[0]):
    bbox = transformed_anchors[j]
    x1 = int(bbox[0] / scale)
    y1 = int(bbox[1] / scale)
    x2 = int(bbox[2] / scale)
    y2 = int(bbox[3] / scale)
    label_name = labels[int(classification[j])]

After these changes, threshold parameters work as needed.

EzYoloFrodo avatar May 03 '21 18:05 EzYoloFrodo