def plt_skeleton(self, img, tocopy = True, debug = False, sess = None):
""" Given an Image, returns Image with plotted limbs (TF VERSION)
Args:
img : Source Image shape = (256,256,3)
tocopy : (bool) False to write on source image / True to return a new array
debug : (bool) for testing puposes
sess : KEEP NONE
"""
joints = self.joints_pred(np.expand_dims(img, axis = 0), coord = 'img', debug = False, sess = sess)
if tocopy:
img = np.copy(img)
for i in range(len(self.links)):
position = self.givePixel(self.links[i]['link'],joints)
cv2.line(img, tuple(position[0])[::-1], tuple(position[1])[::-1], self.links[i]['color'][::-1], thickness = 2)
if tocopy:
return img
评论列表
文章目录