Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeneratePoseTarget return horizontal heatmap image #240

Open
TonsonP opened this issue Apr 12, 2024 · 0 comments
Open

GeneratePoseTarget return horizontal heatmap image #240

TonsonP opened this issue Apr 12, 2024 · 0 comments

Comments

@TonsonP
Copy link

TonsonP commented Apr 12, 2024

Hello everyone

Currently, I'm experiments on PoseC3D and trying to create some inference services to check results from skeleton keypoints.

inference_pipeline = [
    dict(type='GeneratePoseTarget', with_kp=False, with_limb=True, double=False, left_kp=left_kp, right_kp=right_kp),
    ]

def vis_heatmaps(heatmaps, channel=-1, ratio=8):
    # if channel is -1, draw all keypoints / limbs on the same map
    import matplotlib.cm as cm
    heatmaps = [x.transpose(1, 2, 0) for x in heatmaps]
    h, w, _ = heatmaps[0].shape
    newh, neww = int(h * ratio), int(w * ratio)
    
    if channel == -1:
        heatmaps = [np.max(x, axis=-1) for x in heatmaps]
    cmap = cm.viridis
    heatmaps = [(cmap(x)[..., :3] * 255).astype(np.uint8) for x in heatmaps]
    heatmaps = [cv2.resize(x, (neww, newh)) for x in heatmaps]
    return heatmaps

10

First, I put my input keypoints (1, 48, 17, 2) into inference pipeline which only consists of GeneratePoseTarget, then I visualize the heatmap using the functions provided in visualize_heatmap_volume.ipynb files. I found out that all of the heatmap are in horizontal instead of vertical as displayed in the picture. Is this behaviours to be expected or did I do something incorrectly?

I have attached the fake_anno dict that I used to test this.
https://drive.google.com/file/d/1_qCEwMjrjRhL5TOC3qAyXGIkzy-owEJS/view?usp=sharing

Any help is appreciate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant