mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

How to brower datasets with OpenPose visualized format?

Open liming-ai opened this issue 2 years ago • 5 comments

What is the feature?

Brower datasets with OpenPose visualized format?

Any other context?

I tried to run

python3 tools/misc/browse_dataset.py \
    configs/body_2d_keypoint/rtmpose/coco/rtmpose-l_8xb256-420e_coco-256x192.py \
    --output-dir vis --not-show --mode original --cfg-options skeleton-style=openpose

But the visualized results are different from openpose visualizations

liming-ai avatar Oct 17 '23 17:10 liming-ai

The script browse_dataset.py has not supported argument skeleton_style. Please add skeleton_style="openpose" at https://github.com/open-mmlab/mmpose/blob/6d10b2ec81da7e252016b3154c7fdb46c403ecd8/tools/misc/browse_dataset.py#L100 and https://github.com/open-mmlab/mmpose/blob/6d10b2ec81da7e252016b3154c7fdb46c403ecd8/tools/misc/browse_dataset.py#L151 manually

Ben-Louis avatar Oct 18 '23 01:10 Ben-Louis

The script browse_dataset.py has not supported argument skeleton_style. Please add skeleton_style="openpose" at

https://github.com/open-mmlab/mmpose/blob/6d10b2ec81da7e252016b3154c7fdb46c403ecd8/tools/misc/browse_dataset.py#L100

and https://github.com/open-mmlab/mmpose/blob/6d10b2ec81da7e252016b3154c7fdb46c403ecd8/tools/misc/browse_dataset.py#L151

manually

Thanks for your kindly help!

liming-ai avatar Oct 18 '23 05:10 liming-ai

Hi @Ben-Louis,

The instructions work for the COCO dataset. After that, I tried to use the same workflow to browse the HumanArt dataset by replacing configs, but some strange error happened.

Here is my command:

python3 tools/misc/browse_dataset.py \
    configs/body_2d_keypoint/topdown_heatmap/humanart/td-hm_hrnet-w32_8xb64-210e_humanart-256x192.py \
    --output-dir visualized_pose/humanart/train --mode original

And the error is:

  File "/home/chenchen/liming/code/mmpose/tools/misc/browse_dataset.py", line 167, in <module>
    main()
  File "/home/chenchen/liming/code/mmpose/tools/misc/browse_dataset.py", line 151, in main
    visualizer.add_datasample(
  File "/home/chenchen/anaconda3/envs/reward_control/lib/python3.10/site-packages/mmengine/dist/utils.py", line 401, in wrapper
    return func(*args, **kwargs)
  File "/home/chenchen/anaconda3/envs/reward_control/lib/python3.10/site-packages/mmpose/visualization/local_visualizer.py", line 515, in add_datasample
    gt_img_data = self._draw_instances_kpts(
  File "/home/chenchen/anaconda3/envs/reward_control/lib/python3.10/site-packages/mmpose/visualization/local_visualizer.py", line 302, in _draw_instances_kpts
    raise ValueError(
ValueError: the length of kpt_color (17) does not matches that of keypoints (18)

I have no idea why this error happened, since both COCO and HumanArt only have 17 keypoints. I also print the shape with data_sample.gt_instances.keypoints.shape, and the results are both (1, 17, 2) for COCO and HumanArt

liming-ai avatar Oct 18 '23 05:10 liming-ai

Currently, the openpose style visualization only supports skeleton in COCO and COCO-Wholebody datasets https://github.com/open-mmlab/mmpose/blob/6d10b2ec81da7e252016b3154c7fdb46c403ecd8/mmpose/visualization/local_visualizer.py#L157-L169

Ben-Louis avatar Oct 18 '23 06:10 Ben-Louis

Thanks for your reply. Could you please tell me how I should modify it to visualize these poses in the openpose style? I would appreciate it if you could give me some guidance.

liming-ai avatar Oct 18 '23 16:10 liming-ai