Open ShihuaiXu opened 3 years ago
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列也可能有目标的吧
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列也可能有目标的吧