deep-high-resolution-net.pytorch icon indicating copy to clipboard operation
deep-high-resolution-net.pytorch copied to clipboard

how to get 'scale' in mpii dataset?

Open tmtmaj opened this issue 3 years ago • 2 comments

The authors provide json files for MPII dataset (train.json, trainval.json..).

I want to create json files for my custom dataset to use the code for MPII dataset.

but I do not find the specific description about that, especially 'scale'.

how to get 'scale' value?

following is an example in valid.json that they provided.

{
      "joints_vis": [
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1
      ], 
      "joints": [
         [
            804.0, 
            711.0
         ], 
         [
            816.0, 
            510.0
         ], 
         [
            908.0, 
            438.0
         ], 
         [
            1040.0, 
            454.0
         ], 
         [
            906.0, 
            528.0
         ], 
         [
            883.0, 
            707.0
         ], 
         [
            974.0, 
            446.0
         ], 
         [
            985.0, 
            253.0
         ], 
         [
            982.7591, 
            235.9694
         ], 
         [
            962.2409, 
            80.0306
         ], 
         [
            869.0, 
            214.0
         ], 
         [
            798.0, 
            340.0
         ], 
         [
            902.0, 
            253.0
         ], 
         [
            1067.0, 
            253.0
         ], 
         [
            1167.0, 
            353.0
         ], 
         [
            1142.0, 
            478.0
         ]
      ], 
      "image": "005808361.jpg", 
      "scale": 4.718488, 
      "center": [
         966.0, 
         340.0
      ]
   }

tmtmaj avatar Apr 04 '21 09:04 tmtmaj

Also did not understand, still waiting for the author's reply。。。。

libo-coder avatar May 26 '21 07:05 libo-coder

The authors provide json files for MPII dataset (train.json, trainval.json..).

I want to create json files for my custom dataset to use the code for MPII dataset.

but I do not find the specific description about that, especially 'scale'.

how to get 'scale' value?

following is an example in valid.json that they provided.

{
      "joints_vis": [
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1, 
         1
      ], 
      "joints": [
         [
            804.0, 
            711.0
         ], 
         [
            816.0, 
            510.0
         ], 
         [
            908.0, 
            438.0
         ], 
         [
            1040.0, 
            454.0
         ], 
         [
            906.0, 
            528.0
         ], 
         [
            883.0, 
            707.0
         ], 
         [
            974.0, 
            446.0
         ], 
         [
            985.0, 
            253.0
         ], 
         [
            982.7591, 
            235.9694
         ], 
         [
            962.2409, 
            80.0306
         ], 
         [
            869.0, 
            214.0
         ], 
         [
            798.0, 
            340.0
         ], 
         [
            902.0, 
            253.0
         ], 
         [
            1067.0, 
            253.0
         ], 
         [
            1167.0, 
            353.0
         ], 
         [
            1142.0, 
            478.0
         ]
      ], 
      "image": "005808361.jpg", 
      "scale": 4.718488, 
      "center": [
         966.0, 
         340.0
      ]
   }

Maybe you can get the scale array from the function named "_xywh2cs" in Simple-HRNet/datasets/COCO.py. You need obtain the bbox of your dataset first.

doublemanyu avatar Nov 02 '23 09:11 doublemanyu