Skip to content

Commit d29219d

Browse files
committed
update box_utils.py
1 parent f8292fe commit d29219d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/box_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ def match(threshold, truths, priors, variances, labels, loc_t, conf_t, idx):
121121

122122
# ignore hard gt
123123
valid_gt_idx = best_prior_overlap[:, 0] >= 0.2
124-
best_prior_overlap = best_prior_overlap[valid_gt_idx, :]
125-
best_prior_idx = best_prior_idx[valid_gt_idx, :]
126-
if best_prior_overlap.shape[0] <= 0:
124+
best_prior_idx_filter = best_prior_idx[valid_gt_idx, :]
125+
if best_prior_idx_filter.shape[0] <= 0:
127126
loc_t[idx] = 0
128127
conf_t[idx] = 0
129128
return
@@ -133,8 +132,9 @@ def match(threshold, truths, priors, variances, labels, loc_t, conf_t, idx):
133132
best_truth_idx.squeeze_(0)
134133
best_truth_overlap.squeeze_(0)
135134
best_prior_idx.squeeze_(1)
135+
best_prior_idx_filter.squeeze_(1)
136136
best_prior_overlap.squeeze_(1)
137-
best_truth_overlap.index_fill_(0, best_prior_idx, 2) # ensure best prior
137+
best_truth_overlap.index_fill_(0, best_prior_idx_filter, 2) # ensure best prior
138138
# TODO refactor: index best_prior_idx with long tensor
139139
# ensure every gt matches with its prior of max overlap
140140
for j in range(best_prior_idx.size(0)):

0 commit comments

Comments
 (0)