jgraving / DeepPoseKit

a toolkit for pose estimation using deep learning
http://deepposekit.org
Apache License 2.0
392 stars 90 forks source link

Strange behavior from draw_graph function in keypoints.py #52

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi! I've been trying to train a model on a human foot keypoint dataset using deepposekit. I was visualizing the skeleton and keypoint confidence graphs produced by the TrainingGenerator and noticed that certain parts of the skeleton aren't visible - in particular, the part from the big toe to the heel. The keypoints are in the order [left big toe, left little toe, left heel, right big toe, right little toe, right heel] so I've defined my graph to be [2, 2, -1, 5, 5, -1]. The result of this is that line 89 in utils/keypoints.py:

edge_confidence = edge_confidence[..., 1:]

cuts off the edge confidence from the big toe to the heel that was just computed. In my particular case I was able to fix the issue by replacing the line with edge_confidence = edge_confidence[..., :-1] but this obviously won't work for every graph. I'm wondering if this is a bug or if perhaps I've defined my graph in some unexpected way.

I also noticed that draw_graph doesn't deal with unlabelled keypoints and will draw lines from labelled to unlabelled keypoints (which are located at [-99999, -99999]). Is this correct?

Thanks!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

jgraving commented 4 years ago

Yes there may be a bug with the graph drawing functionality. Will have to look into it further