def __init__(self, gt, joints, dolegend=True, linewidth=1):
"""
Initialize class
:type gt: groundtruth joints
:type joints: calculated joints
"""
if not (isinstance(gt, numpy.ndarray) or isinstance(gt, list)) or not (
isinstance(joints, list) or isinstance(joints, numpy.ndarray)):
raise ValueError("Params must be list or ndarray")
if len(gt) != len(joints):
print("Error: groundtruth has {} elements, eval data has {}".format(len(gt), len(joints)))
raise ValueError("Params must be the same size")
if len(gt) == len(joints) == 0:
print("Error: groundtruth has {} elements, eval data has {}".format(len(gt), len(joints)))
raise ValueError("Params must be of non-zero size")
if gt[0].shape != joints[0].shape:
print("Error: groundtruth has {} dims, eval data has {}".format(gt[0].shape, joints[0].shape))
raise ValueError("Params must be of same dimensionality")
self.gt = numpy.asarray(gt)
self.joints = numpy.asarray(joints)
assert (self.gt.shape == self.joints.shape)
self.colors = ['blue', 'green', 'red', 'cyan', 'magenta', 'black', 'brown', 'gray', 'indigo', 'pink',
'lightgreen', 'darkorange', 'peru', 'steelblue', 'turquoise']
self.linestyles = ['-'] # , '--', '-.', ':', '-', '--', '-.', ':']
self.linewidth = linewidth
self.dolegend = dolegend
self.subfolder = './eval/'
self.visiblemask = numpy.ones((self.gt.shape[0], self.gt.shape[1], 3))
self.jointNames = None
self.jointConnections = []
self.jointConnectionColors = []
self.plotMaxJointDist = 80
self.plotMeanJointDist = 80
self.plotMedianJointDist = 80
self.VTKviewport = [0, 0, 0, 0, 0]
评论列表
文章目录