def pair_visualization(pairs, img, img_shape, show_method='line'): board = img.copy() if show_method == 'line': for id in pairs: pair = pairs[id] for p in pair: board = draw.visualize(board, p.compos_dataframe, img_shape, attr='pair', show=False) elif show_method == 'block': for id in pairs: pair = pairs[id] for p in pair: board = draw.visualize_block(board, p.compos_dataframe, img_shape, attr='pair', show=False) cv2.imshow('pairs', board) cv2.waitKey() cv2.destroyAllWindows()
def visualize_block(self, gather_attr='class', name='board'): draw.visualize_block(self.img, self.compos_dataframe, self.img_shape, gather_attr, name)