MCPcopy
hub / github.com/WongKinYiu/PyTorch_YOLOv4 / anchor_fitness

Function anchor_fitness

utils/autoanchor.py:77–79  ·  view source on GitHub ↗
(k)

Source from the content-addressed store, hash-verified

75 return x, x.max(1)[0] # x, best_x
76
77 def anchor_fitness(k): # mutation fitness
78 _, best = metric(torch.tensor(k, dtype=torch.float32), wh)
79 return (best * (best > thr).float()).mean() # fitness
80
81 def print_results(k):
82 k = k[np.argsort(k.prod(1))] # sort small to large

Callers 1

kmean_anchorsFunction · 0.85

Calls 1

metricFunction · 0.85

Tested by

no test coverage detected