whai362 / PSENet

Official Pytorch implementations of PSENet.
Apache License 2.0
1.17k stars 344 forks source link

真是标签图如何可视化呢 #159

Open jun214384468 opened 4 years ago

jun214384468 commented 4 years ago

根据标签,怎么样对初始图进行可视化呢?求指教谢谢

HCMY commented 2 years ago

def draw_bbox(bboxs,img): bboxs_res = [] for bbox in bboxs: bbox = np.reshape(bbox,(4,2)) cv2.drawContours(img, [bbox],-1, (0, 255, 0), 2) bboxs_res.append(bbox) return bboxs_res, img

box = self.detector.predict(img_path) #作者模型的输出 img = cv2.imread(img_path) bboxs_res, box_img = draw_bbox(box['bboxes'], img)

Captainlululu commented 1 year ago

def draw_bbox(bboxs,img): bboxs_res = [] for bbox in bboxs: bbox = np.reshape(bbox,(4,2)) cv2.drawContours(img, [bbox],-1, (0, 255, 0), 2) bboxs_res.append(bbox) return bboxs_res, img

box = self.detector.predict(img_path) #作者模型的输出 img = cv2.imread(img_path) bboxs_res, box_img = draw_bbox(box['bboxes'], img)

您好,请问这一段代码要加到哪一段去运行嘞 谢谢您