Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import cv2 # OpenCV
- from anytree.dotexport import RenderTreeGraph
- from anytree.importer import DictImporter
- importer = DictImporter()
- def show(self) -> None:
- data = self.root.to_dict()
- tree_root = importer.import_(data)
- RenderTreeGraph(tree_root).to_picture("tree.png")
- img = cv2.imread("tree.png", cv2.IMREAD_ANYCOLOR)
- cv2.imshow("tree", img)
- cv2.waitKey(0)
- sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement