TMElyralab / MusePose

MusePose: a Pose-Driven Image-to-Video Framework for Virtual Human Generation
Other
2.29k stars 167 forks source link

Error with pose_align.py on MacBook M3 Max Using Anaconda torch-metal Profile #62

Open jnakrani opened 5 months ago

jnakrani commented 5 months ago

Hello @TZYSJTU

I am experiencing issues running pose_align.py from the MusePose repository on my MacBook M3 Max. Despite following the setup instructions in the README and installing all the required libraries and dependencies, I encounter errors when executing the script.

Environment:

I executed the following command:

python pose_align.py --imgfn_refer ./assets/images/ref.png --vidfn ./assets/videos/dance.mp4

Observation

warnings.warn('Fail to import `MultiScaleDeformableAttention` from `mmcv.ops.multi_scale_deform_attn` ')
warnings.warn('The module `mmpose` is not installed. The package will have limited functionality.')
warnings.warn('The module `mmdet` is not installed. The package will have limited functionality.')

Screnshot

Screenshot 2024-06-19 at 2 48 33 PM

I would appreciate any guidance on resolving these issues. Thank you!

seinfinity commented 4 months ago

Hello @TZYSJTU

I am experiencing issues running pose_align.py from the MusePose repository on my MacBook M3 Max. Despite following the setup instructions in the README and installing all the required libraries and dependencies, I encounter errors when executing the script.

Environment:

  • OS: macOS
  • Device: MacBook M3 Max
  • Python Environment: Anaconda torch-metal profile
  • Python Version: 3.10
  • MusePose Version: 1.3.1
  • Platform: macOS-14.5-arm64-arm-64bit

I executed the following command:

python pose_align.py --imgfn_refer ./assets/images/ref.png --vidfn ./assets/videos/dance.mp4

Observation

  • Multiple warnings about missing modules despite it being installed correctly:
warnings.warn('Fail to import `MultiScaleDeformableAttention` from `mmcv.ops.multi_scale_deform_attn` ')
warnings.warn('The module `mmpose` is not installed. The package will have limited functionality.')
warnings.warn('The module `mmdet` is not installed. The package will have limited functionality.')
  • The script terminates with a NameError indicating that init_detector is not defined:
Traceback (most recent call last):
  File "/Users/jaydip/Documents/BCS/ML/MusePose/pose_align.py", line 556, in <module>
    main()
  File "/Users/jaydip/Documents/BCS/ML/MusePose/pose_align.py", line 551, in main
    run_align_video_with_filterPose.translate_smooth(args)
  File "/Users/jaydip/Documents/BCS/ML/MusePose/pose_align.py", line 270, in run_align_video_with_filterPose.translate_smooth
    detector = DWPoseDetector(
  File "/Users/jaydip/Documents/BCS/ML/MusePose/pose/script/dwpose.py", line 74, in __init__
    self.pose_estimation = Wholebody(det_config, det_ckpt, pose_config, pose_ckpt, device)
  File "/Users/jaydip/Documents/BCS/ML/MusePose/pose/script/wholebody.py", line 51, in __init__
    self.detector = init_detector(det_config, det_ckpt, device=device)
NameError: name 'init_detector' is not defined

Screnshot

Screenshot 2024-06-19 at 2 48 33 PM

I would appreciate any guidance on resolving these issues. Thank you!

I added from mmdet.apis import init_detector to the dwpose.py file, and the issue was resolved!