open-mmlab / mmpose

OpenMMLab Pose Estimation Toolbox and Benchmark.
https://mmpose.readthedocs.io/en/latest/
Apache License 2.0
5.4k stars 1.18k forks source link

AssertionError: MMCV==2.0.0rc3 is used but incompatible. Please install mmcv>=1.3.8, <=1.8.0. #1874

Closed Jeong-Bin closed 1 year ago

Jeong-Bin commented 1 year ago

I should use --save-predictions for get predict result, so I created new conda env and installed mmpose 1.0 followed here

Then I tried to import mmpose but I received this error : AssertionError: MMCV==2.0.0rc3 is used but incompatible. Please install mmcv>=1.3.8, <=1.8.0.

How do I solve this for use mmpose 1.0 ?

And also I have some little questions.

I always appreciate your support.

Jeong-Bin commented 1 year ago

Hello, Let me change the question. Finally, I succeeded to import mmcv==2.0.0rc3 and mmpose==1.0.0b0. And also I changed my annotation format to COCO format. Thanks to your help and good documents.

So now, all I have to do is activate the demo code. but I coundn't find the 3d_human_pose_demo.md in MMPose 1.x and hear Is there only 2d_human_pose_demo.md in MMPose1.x so far?

What should I do to use --save-predictions with 3d_human_pose?

Thanks.

ly015 commented 1 year ago

Hi, thanks for using MMPose v1.x. We are still working on refactoring the 3d part and it will be added to 1.x next month.

Jeong-Bin commented 1 year ago

Hi, thanks for using MMPose v1.x. We are still working on refactoring the 3d part and it will be added to 1.x next month.

Thanks. Then... When I tried 2D human pose demo whit this code,

!python topdown_demo_with_mmdet.py \
    demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
    https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
    configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrnet-w32_8xb64-210e_coco-256x192.py \
    https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth \
    --input /content/drive/MyDrive/kmu_CAI_lab/01_PoseEstimation/MMPose/sample_data/vidtest2.mp4 \
    --output-root=output/test \
    --show --draw-heatmap --save-predictions 

I got this error

usage: topdown_demo_with_mmdet.py
       [-h]
       [--input INPUT]
       [--show]
       [--output-root OUTPUT_ROOT]
       [--device DEVICE]
       [--det-cat-id DET_CAT_ID]
       [--bbox-thr BBOX_THR]
       [--nms-thr NMS_THR]
       [--kpt-thr KPT_THR]
       [--draw-heatmap]
       [--radius RADIUS]
       [--thickness THICKNESS]
       det_config
       det_checkpoint
       pose_config
       pose_checkpoint
topdown_demo_with_mmdet.py: error: unrecognized arguments: --save-predictions

Is that way to use --save-predictions wrong?

Ben-Louis commented 1 year ago

This feature has been supported in branch dev-1.x instead of 1.x. If you install mmpose from source, you could simply switch to branch dev-1.x. Otherwise, you may need to install mmpose again via pip install -e . after switching to branch dev-1.x.

Jeong-Bin commented 1 year ago

This feature has been supported in branch dev-1.x instead of 1.x. If you install mmpose from source, you could simply switch to branch dev-1.x. Otherwise, you may need to install mmpose again via pip install -e . after switching to branch dev-1.x.

I tried this code, but it still coundn't recognize --save-predictions.

!pip3 install openmim
!mim install mmengine
!mim install "mmcv>=2.0.0rc1"
!mim install "mmdet>=3.0.0rc0"

!git clone https://github.com/open-mmlab/mmpose.git -b dev-1.x
## mmpose -> mmpose_dev-1.0
%cd mmpose_dev-1.0

!pip install -r requirements.txt
!pip install -v -e 
!python topdown_demo_with_mmdet.py \
## "demo/topdown_demo_with_mmdet.py" didn't work because of this error: 
## ModuleNotFoundError: No module named 'mmpose'
## so I changed the directoty to "/topdown_demo_with_mmdet.py"
    demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py \
    https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth \
    configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrnet-w32_8xb64-210e_coco-256x192.py \
    https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth \
    --input /kmu_CAI_lab/01_PoseEstimation/MMPose/sample_data/vidtest2.mp4 \
    --output-root=output/test \
    --show --draw-heatmap --save-predictions

How to swich to branch dev-1.x?

Ben-Louis commented 1 year ago

It seems like the problem is that mmpose is not installed successfully. Maybe you could try pip install -v -e . instead of pip install -v -e

The command for switching to branch dev-1.x is git checkout -b dev-1.x origin/dev-1.x which should be executed under the directory of mmpose. But the branch of your local repo should be correct as it is specified when you clone the repo.

Jeong-Bin commented 1 year ago

It seems like the problem is that mmpose is not installed successfully. Maybe you could try pip install -v -e . instead of pip install -v -e

The command for switching to branch dev-1.x is git checkout -b dev-1.x origin/dev-1.x which should be executed under the directory of mmpose. But the branch of your local repo should be correct as it is specified when you clone the repo.

Finally, It worked! Thank you very much!! I have last one question. If I wanna "realtime" human pose demo, which should I use? webcam demo? Then, Do you have any plan to add 3D webcam demo in dev-1.x?

Tau-J commented 1 year ago

@Jeong-Bin Sorry for late reply. For real-time inference, you can try some lightweight models, such as mobilenetv2, shufflenetv2, litehrnet etc. and you can use webcam_demo.py to inference with your camara. As for 3d webcam demo, we do have a plan but we're still refactoring 3d algorithms right now.