open-mmlab / mmaction2

OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark
https://mmaction2.readthedocs.io
Apache License 2.0
4.18k stars 1.22k forks source link

Visualization issue #2316

Open Bing1002 opened 1 year ago

Bing1002 commented 1 year ago

When I run demo_skeleton.py, I got visualization like this: KeyError: 'PoseLocalVisualizer is not in the visualizer registry. Please check whether the value of PoseLocalVisualizer is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'.

Is there any idea to fix this issue? Thank you.

hukkai commented 1 year ago

@Bing1002 Are you using the master branch or 1.x branch?

SCsleepy commented 1 year ago

@Bing1002 Are you using the master branch or 1.x branch?

Hello, I have encountered the same issue. My version is 1.x branch. version = '1.1.0' . I run demo Skeleton. py initially did not report an error, but when I changed the default settings - det config, det checkpoint, pose-config, pose-checkpoint. Run demo again Skeleton. py will report the error above.May I ask if there is any solution。

hsp2454 commented 1 year ago

Hello, have you solved it?

ao-zz commented 4 months ago

@SCsleepy @hsp2454 You can check the end lines of your pose config file. In some configs (especially those from mmpose), you can see codes like

vis_backends = [
    dict(type='LocalVisBackend'),
]
visualizer = dict(
    name='visualizer',
    type='PoseLocalVisualizer',
    vis_backends=[
        dict(type='LocalVisBackend'),
    ])

which leads to your error.

While in the end of mmaction2/demo/demo_configs/td-hm_hrnet-w32_8xb64-210e_coco-256x192_infer.py, codes are

vis_backends = [dict(type='LocalVisBackend')]
visualizer = dict(
    type='mmpose.PoseLocalVisualizer',
    vis_backends=vis_backends,
    name='visualizer')

See the difference ? If you use the config file from mmpose directly, you need to add prefix mmpose before PoseLocalVisualizer.

So we just need take 3 steps to solve it

  1. Open your pose config file (you can copy one as backup), then jump to its end
  2. Change PoseLocalVisualizer into mmpose.PoseLocalVisualizer
  3. Save and re-run

That's all.

By the way, could you help add above info in mmaction's doc, making users from mmpose running codes more smoothly? Thanks a lot @hukkai