MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
7.96k stars 1.97k forks source link

Trying to plot keypoints using matplotlib #958

Closed dekathomas closed 2 years ago

dekathomas commented 2 years ago

Hello, I try to plot the keypoint I have from running demo_inference.py to an image. This is the image I use is this image DSCF1615

And the json file I got is this:

[
    {
        "image_id": "DSCF1615.JPG",
        "category_id": 1,
        "keypoints": [
            2543.440185546875,
            1131.0843505859375,
            0.9583389759063721,
            2600.461669921875,
            1074.062744140625,
            0.9556850790977478,
            2486.418701171875,
            1074.062744140625,
            0.9371250867843628,
            2714.5048828125,
            1112.0771484375,
            0.9932175278663635,
            2429.397216796875,
            1131.0843505859375,
            0.9484568238258362,
            2790.53369140625,
            1511.22802734375,
            0.8577894568443298,
            2334.361083984375,
            1549.242431640625,
            0.8410822153091431,
            2600.461669921875,
            2005.4149169921875,
            0.7813896536827087,
            2125.2822265625,
            1948.393310546875,
            0.8692909479141235,
            2296.3466796875,
            1872.3646240234375,
            0.8136818408966064,
            2391.3828125,
            1834.3502197265625,
            0.842948853969574,
            2657.4833984375,
            2423.572998046875,
            0.6210286021232605,
            2315.35400390625,
            2385.55859375,
            0.5862553715705872,
            2752.519287109375,
            2746.6953125,
            0.2042750120162964,
            2372.37548828125,
            2727.68798828125,
            0.37582340836524963,
            2771.5263671875,
            2708.680908203125,
            0.04293001815676689,
            2353.368408203125,
            2632.652099609375,
            0.08475281298160553
        ],
        "score": 2.927323818206787,
        "box": [
            2037.730224609375,
            813.6643676757812,
            954.3984375,
            1946.3356323242188
        ],
        "idx": [
            0.0
        ]
    }
]

Because the keypoints are consist of Xi,Yi,Ci so I remove the multiple of 3 of the keypoints and I try to use matplotlib to see if the points it makes is the same with the skeleton on the image. But after I applied it, the result is messy. image

Can't I use matplotlib to visualise the keypoint? Because I want to make sure that the keypoints is correct and can be used for pose detection.

Thank you.

Fang-Haoshu commented 2 years ago

The y-axis in the image is from top to bottom and the matlab is from bottom to up.