MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / _rescore

Function _rescore

PATH/core/solvers/utils/nms.py:126–147  ·  view source on GitHub ↗

Rescoring mechanism gaussian or linear. Args: overlap: calculated ious scores: target scores. thr: retain oks overlap < thr. type: 'gaussian' or 'linear' Returns: np.ndarray: indexes to keep

(overlap, scores, thr, type='gaussian')

Source from the content-addressed store, hash-verified

124
125
126def _rescore(overlap, scores, thr, type='gaussian'):
127 """Rescoring mechanism gaussian or linear.
128
129 Args:
130 overlap: calculated ious
131 scores: target scores.
132 thr: retain oks overlap < thr.
133 type: 'gaussian' or 'linear'
134
135 Returns:
136 np.ndarray: indexes to keep
137 """
138 assert len(overlap) == len(scores)
139 assert type in ['gaussian', 'linear']
140
141 if type == 'linear':
142 inds = np.where(overlap >= thr)[0]
143 scores[inds] = scores[inds] * (1 - overlap[inds])
144 else:
145 scores = scores * np.exp(-overlap**2 / thr)
146
147 return scores
148
149
150def soft_oks_nms(kpts_db, thr, max_dets=20, sigmas=None, vis_thr=None):

Callers 1

soft_oks_nmsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected