-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Description
🚀 The feature
Frequent utility in postprocessing box detections:
def batched_box_scale(boxes, image_shape, target_image_shape):
fx = target_image_shape[..., -1] / image_shape[...., -1]
fy = target_image_shape[..., -2] / image_shape[..., -2]
return boxes * torch.stack([fx, fy, fx, fy], dim = -1).to(boxes.device)
Motivation, pitch
This is a frequently needed utility to bring back computed detections to a common / original coordinate frame.