def decode_detection(self, output, h, w): ct_hm = output['ct_hm'] wh = output['wh'] ct, detection = snake_decode.decode_ct_hm(torch.sigmoid(ct_hm), wh) detection[..., :4] = data_utils.clip_to_image(detection[..., :4], h, w) output.update({'ct': ct, 'detection': detection}) return ct, detection
def decode_detection(self, output, h, w): ct_hm = output['ct_hm'] wh = output['wh'] if cfg.train.ct_reg: ct_reg = output['reg'] nms_ct_hm, ct, detection = snake_decode.decode_ct_hm( torch.sigmoid(ct_hm), wh, ct_reg) else: nms_ct_hm, ct, detection = snake_decode.decode_ct_hm( torch.sigmoid(ct_hm), wh) detection[..., :4] = data_utils.clip_to_image(detection[..., :4], h, w) output.update({ 'ct': ct, 'detection': detection, 'nms_ct_hm': nms_ct_hm }) return ct, detection