Transform heatmap coordinates to image coordinates.
(coords, center, scale, output_size)
| 82 | |
| 83 | |
| 84 | def transform_preds(coords, center, scale, output_size): |
| 85 | """Transform heatmap coordinates to image coordinates.""" |
| 86 | target_coords = np.zeros(coords.shape) |
| 87 | trans = get_affine_transform(center, |
| 88 | scale, |
| 89 | 0, |
| 90 | output_size, |
| 91 | inv=1, |
| 92 | pixel_std=1) |
| 93 | target_coords[0:2] = affine_transform(coords[0:2], trans) |
| 94 | return target_coords |
| 95 | |
| 96 | |
| 97 | def bbox_xywh_to_xyxy(xywh): |
no test coverage detected