open-mmlab / mmhuman3d

OpenMMLab 3D Human Parametric Model Toolbox and Benchmark
https://mmhuman3d.readthedocs.io/
Apache License 2.0
1.22k stars 133 forks source link

cam_param is absent in HumanData.SUPPORTED_KEYS. #18

Closed YongtaoGe closed 2 years ago

YongtaoGe commented 2 years ago

I want to convert Human36M dataset and I use the following script

python tools/convert_datasets.py --datasets h36m_p1 --root_path ../data/datasets/ --output_path ../data/processed_datasets

Then I get the error "cam_param is absent in HumanData.SUPPORTED_KEYS."

YongtaoGe commented 2 years ago

The unpreprocess_data is arranged as following structure:

└── data
    └── datasets
        └── h36m
            ├── annot
            ├── S1
               ├──Poses_D2_Positions_S1.tgz
               ├──Poses_D3_Positions_mono_S1.tgz
               ├──Poses_D3_Positions_mono_universal_S1.tgz
               ├──Poses_D3_Positions_S1.tgz
               ├──Videos_S1.tgz

How can I get the following structure data of processed h36m mentioned in https://github.com/open-mmlab/mmhuman3d/blob/main/docs/preprocess_dataset.md#human36m

mmhuman3d
├── mmhuman3d
├── docs
├── tests
├── tools
├── configs
└── data
    └── datasets
        └── h36m
            ├── annot
            ├── S1
            |   ├── images
            |   |    |── S1_Directions_1.54138969
            |   |    |  ├── S1_Directions_1.54138969_00001.jpg
            |   |    |  ├── S1_Directions_1.54138969_00002.jpg
            |   |    |  └── ...
            |   |    └── ...
            |   ├── ...
            |   ├── MyPoseFeatures
            |   ├── MySegmentsMat
            |   └── Videos
            ├── S5
            ├── S6
            ├── S7
            ├── S8
            ├── S9
            ├── S11
            └── metadata.xml
caizhongang commented 2 years ago

Hello @YongtaoGe , for Human3.6M, you may download the original data from this link and arrange it into the structure as shown above.

Alternatively, you may download the preprocessed files directly, and the details can be found in data preparation.

YongtaoGe commented 2 years ago

@caizhongang, I want to get the images with downsampled frame rate (10 FPS) which are not provided in this repository. So I still need to run the preprocessing script, is it right?

pangyyyyy commented 2 years ago

Hi @YongtaoGe,

Thanks for pointing it out, we will update our documentation in the future for better clarity.

For now:

To get the contents under "MyPoseFeatures", extract the following files that you have: tar zvxf Poses_D2_Positions_S1.tgz tar zvxf Poses_D2_Positions_S1.tgz

To get "MySegmentsMat", download them as well (the h36m website calls them "Segments BBoxes MAT") and unpack them

To get the contents under "Videos", tar zvxf Videos_S1.tgz

You seem to be missing metadata.xml which you can get from the h36m website or here.

To get the images: please modify the DATASET_CONFIG for h36m_p1 in tools/convert_datasets.py to this:

    h36m_p1=dict(
        type='H36mConverter',
        modes=['train', 'valid'],
        protocol=1,
        extract_img=True,  # this is to specify you want to extract images from videos
        # mosh_dir='data/datasets/h36m_mosh', # comment this out if you do not have mosh
        prefix='h36m')

Rerun the same command as before and you should get the "images" folder:

mmhuman3d
├── mmhuman3d
├── docs
├── tests
├── tools
├── configs
└── data
    └── datasets
        └── h36m
            ├── annot
            ├── S1
            |   ├── images
            |   |    |── S1_Directions_1.54138969
            |   |    |  ├── S1_Directions_1.54138969_00001.jpg
            |   |    |  ├── S1_Directions_1.54138969_00002.jpg
            |   |    |  └── ...
            |   |    └── ...
            |   ├── MyPoseFeatures
            |        |── D2Positions
            |        └── D3_Positions_Mono
            |   ├── MySegmentsMat
            |        └── ground_truth_bs
            |   └── Videos
            |        |── Directions 1.54138969.mp4
            |        |── Directions 1.55011271.mp4
            |        └── ...
            ├── S5
            ├── S6
            ├── S7
            ├── S8
            ├── S9
            ├── S11
            └── metadata.xml
YongtaoGe commented 2 years ago

@pangyyyyy Thank you very much! I will have a try.

YongtaoGe commented 2 years ago

@pangyyyyy There seems a bug in this line.

https://github.com/open-mmlab/mmhuman3d/blob/0a13943265ce0a74d206f4cfed6e9ca8726123a4/mmhuman3d/data/data_converters/h36m.py#L319

leng-yue commented 2 years ago

Did you solve this problem? I can still see the cam_param is absent in HumanData.SUPPORTED_KEYS. in the newest version.