MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / rescale_bboxes

Function rescale_bboxes

SwissArmyTransformer/examples/yolos/infer_util.py:85–89  ·  view source on GitHub ↗
(out_bbox, size)

Source from the content-addressed store, hash-verified

83 return torch.stack(b, dim=1)
84
85def rescale_bboxes(out_bbox, size):
86 img_w, img_h = size
87 b = box_cxcywh_to_xyxy(out_bbox)
88 b = b * torch.tensor([img_w, img_h, img_w, img_h], dtype=torch.float32)
89 return b
90def draw_bbox_in_img(fname, bbox_scaled, score, color=[0,255,0]):
91 tl = 3
92 tf = max(tl-1,1) # font thickness

Callers 2

save_pred_figFunction · 0.85
save_gt_figFunction · 0.85

Calls 1

box_cxcywh_to_xyxyFunction · 0.70

Tested by

no test coverage detected