deep-high-resolution-net.pytorch icon indicating copy to clipboard operation
deep-high-resolution-net.pytorch copied to clipboard

calc_dists函数问题

Open ShihuaiXu opened this issue 4 years ago • 0 comments

def calc_dists(preds, target, normalize): preds = preds.astype(np.float32) target = target.astype(np.float32) dists = np.zeros((preds.shape[1], preds.shape[0])) for n in range(preds.shape[0]): for c in range(preds.shape[1]): if target[n, c, 0] > 1 and target[n, c, 1] > 1: normed_preds = preds[n, c, :] / normalize[n] normed_targets = target[n, c, :] / normalize[n] dists[c, n] = np.linalg.norm(normed_preds - normed_targets) else: dists[c, n] = -1 return dists 这段代码没看懂,判断条件if target[n, c, 0] > 1 and target[n, c, 1] > 1:排除的是第0行第0列的gt吗,为啥是这样呢,第0行第0列也可能有目标的吧

ShihuaiXu avatar Aug 23 '21 07:08 ShihuaiXu