#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ########################################################################### ## SKELETONS DEFINITIONS ## ########################################################################### Skeletons definition and hierarchy. Openpose Body_25b, Body_25, Coco and MPI are provided. You can also build your own custom skeleton. Verify your structure by typing: for pre, _, node in RenderTree(CUSTOM): print(f'{pre}{node.name} id={node.id}') ''' ## INIT from anytree import Node, RenderTree ## AUTHORSHIP INFORMATION __author__ = "David Pagnon" __copyright__ = "Copyright 2021, Pose2Sim" __credits__ = ["David Pagnon"] __license__ = "BSD 3-Clause License" __version__ = "0.1" __maintainer__ = "David Pagnon" __email__ = "contact@david-pagnon.com" __status__ = "Development" ## SKELETONS # CUSTOM SKELETON CUSTOM = Node("Root", id=0, children=[ Node("Child1", id=1), Node("Child2", id=2), ]) # BODY_25B BODY_25B = Node("CHip", id=None, children=[ Node("RHip", id=12, children=[ Node("RKnee", id=14, children=[ Node("RAnkle", id=16, children=[ Node("RBigToe", id=22, children=[ Node("RSmallToe", id=23), ]), Node("RHeel", id=24), ]), ]), ]), Node("LHip", id=11, children=[ Node("LKnee", id=13, children=[ Node("LAnkle", id=15, children=[ Node("LBigToe", id=19, children=[ Node("LSmallToe", id=20), ]), Node("LHeel", id=21), ]), ]), ]), Node("Neck", id=17, children=[ Node("Head", id=18, children=[ Node("Nose", id=0), ]), Node("RShoulder", id=6, children=[ Node("RElbow", id=8, children=[ Node("RWrist", id=10), ]), ]), Node("LShoulder", id=5, children=[ Node("LElbow", id=7, children=[ Node("LWrist", id=9), ]), ]), ]), ]) # BODY_25 BODY_25 = Node("CHip", id=8, children=[ Node("RHip", id=9, children=[ Node("RKnee", id=10, children=[ Node("RAnkle", id=11, children=[ Node("RBigToe", id=22, children=[ Node("RSmallToe", id=23), ]), Node("RHeel", id=24), ]), ]), ]), Node("LHip", id=12, children=[ Node("LKnee", id=13, children=[ Node("LAnkle", id=14, children=[ Node("LBigToe", id=19, children=[ Node("LSmallToe", id=20), ]), Node("LHeel", id=21), ]), ]), ]), Node("Neck", id=17, children=[ Node("Nose", id=0), Node("RShoulder", id=2, children=[ Node("RElbow", id=3, children=[ Node("RWrist", id=4), ]), ]), Node("LShoulder", id=5, children=[ Node("LElbow", id=6, children=[ Node("LWrist", id=7), ]), ]), ]), ]) # COCO COCO = Node("CHip", id=None, children=[ Node("RHip", id=8, children=[ Node("RKnee", id=9, children=[ Node("RAnkle", id=10), ]), ]), Node("LHipJ", id=11, children=[ Node("LKnee", id=12, children=[ Node("LAnkle", id=13), ]), ]), Node("Neck", id=1, children=[ Node("Nose", id=0), Node("RShoulder", id=2, children=[ Node("RElbow", id=3, children=[ Node("RWrist", id=4), ]), ]), Node("LShoulder", id=5, children=[ Node("LElbow", id=6, children=[ Node("LWrist", id=7), ]), ]), ]), ]) # MPI MPI = Node("CHip", id=14, children=[ Node("RHip", id=8, children=[ Node("RKnee", id=9, children=[ Node("RAnkle", id=10), ]), ]), Node("LHipJ", id=11, children=[ Node("LKnee", id=12, children=[ Node("LAnkle", id=13), ]), ]), Node("Neck", id=1, children=[ Node("Nose", id=0), Node("RShoulder", id=2, children=[ Node("RElbow", id=3, children=[ Node("RWrist", id=4), ]), ]), Node("LShoulder", id=5, children=[ Node("LElbow", id=6, children=[ Node("LWrist", id=7), ]), ]), ]), ]) # BODY_135 BODY_135 = Node("")