def update_vis(self):
ims = self.opt_engine.get_images(self.frame_id)
if ims is not None:
self.ims = ims
if self.ims is None:
return
ims_show = []
n_imgs = self.ims.shape[0]
for n in range(n_imgs):
# im = ims[n]
im_s = cv2.resize(self.ims[n], (self.width, self.width), interpolation=cv2.INTER_CUBIC)
if n == self.select_id and self.topK > 1:
t = 3 # thickness
cv2.rectangle(im_s, (t, t), (self.width - t, self.width - t), (0, 255, 0), t)
im_s = im_s[np.newaxis, ...]
ims_show.append(im_s)
if ims_show:
ims_show = np.concatenate(ims_show, axis=0)
g_tmp = utils.grid_vis(ims_show, self.grid_size[1], self.grid_size[0]) # (nh, nw)
self.vis_results = g_tmp.copy()
self.update()
评论列表
文章目录