updates
This commit is contained in:
parent
53b9892216
commit
c9a55a269b
|
@ -256,10 +256,11 @@ def compute_loss(p, targets): # predictions, targets
|
||||||
for i, pi0 in enumerate(p): # layer i predictions, i
|
for i, pi0 in enumerate(p): # layer i predictions, i
|
||||||
b, a, gj, gi = indices[i] # image, anchor, gridx, gridy
|
b, a, gj, gi = indices[i] # image, anchor, gridx, gridy
|
||||||
tconf = torch.zeros_like(pi0[..., 0]) # conf
|
tconf = torch.zeros_like(pi0[..., 0]) # conf
|
||||||
|
nt = len(b) # number of targets
|
||||||
|
|
||||||
# Compute losses
|
# Compute losses
|
||||||
k = 1 # nT / bs
|
k = 1 # nt / bs
|
||||||
if len(b) > 0:
|
if nt:
|
||||||
pi = pi0[b, a, gj, gi] # predictions closest to anchors
|
pi = pi0[b, a, gj, gi] # predictions closest to anchors
|
||||||
tconf[b, a, gj, gi] = 1 # conf
|
tconf[b, a, gj, gi] = 1 # conf
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue