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

Function save_gt_fig

SwissArmyTransformer/examples/yolos/infer_util.py:149–154  ·  view source on GitHub ↗
(output_dir, gt_anno)

Source from the content-addressed store, hash-verified

147 plot_results(im, scores, bboxes_scaled, output_dir)
148
149def save_gt_fig(output_dir, gt_anno):
150 im = cv2.imread(os.path.join(output_dir, "img.png"))
151 h, w = im.shape[:2]
152 bboxes_scaled = rescale_bboxes(gt_anno['boxes'], (w,h))
153 labels = gt_anno['labels']
154 plot_gt(im, labels, bboxes_scaled, output_dir)
155
156def get_one_query_meanattn(vis_attn,h_featmap,w_featmap):
157 mean_attentions = vis_attn.mean(0).reshape(h_featmap, w_featmap)

Callers 1

inference_yolos.pyFile · 0.85

Calls 2

rescale_bboxesFunction · 0.85
plot_gtFunction · 0.85

Tested by

no test coverage detected