(out_bbox, size)
| 83 | return torch.stack(b, dim=1) |
| 84 | |
| 85 | def 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 |
| 90 | def draw_bbox_in_img(fname, bbox_scaled, score, color=[0,255,0]): |
| 91 | tl = 3 |
| 92 | tf = max(tl-1,1) # font thickness |
no test coverage detected