HRNet / HigherHRNet-Human-Pose-Estimation

This is an official implementation of our CVPR 2020 paper "HigherHRNet: Scale-Aware Representation Learning for Bottom-Up Human Pose Estimation" (https://arxiv.org/abs/1908.10357)
MIT License
1.33k stars 272 forks source link

Missing a file #26

Open wsjzha opened 4 years ago

wsjzha commented 4 years ago

Hello, I am trying to clone the github repo and run inference using your model. It seems one file is missing from your repo which causes an error? Please see the message.

Traceback (most recent call last):
  File "tools/valid.py", line 32, in <module>
    from core.inference import get_multi_stage_outputs
  File "/home/*/Higher-HRNet-Human-Pose-Estimation/tools/../lib/core/inference.py", line 15, in <module>
    from dataset.transforms import FLIP_CONFIG
  File "/home/*/Higher-HRNet-Human-Pose-Estimation/tools/../lib/dataset/__init__.py", line 8, in <module>
    from .CrowdPoseKeypoints import CrowdPoseKeypoints as crowd_pose
  File "/home/*/Higher-HRNet-Human-Pose-Estimation/tools/../lib/dataset/CrowdPoseKeypoints.py", line 15, in <module>
    import crowdposetools
ModuleNotFoundError: No module named 'crowdposetools'

Can anyone tell me how to solve it? Thank you!

bowenc0221 commented 4 years ago

Please follow https://github.com/HRNet/Higher-HRNet-Human-Pose-Estimation#installation to install CrowdPose API.

If you plan to train on CrowdPose, you will need to fix a bug in the CrowdPose API to get the correct number of AP easy, medium and hard. Also, CrowdPose API does not support the latest numpy 1.18, you need to either fix the error in CrowdPose API or downgrade numpy to 1.17.

wsjzha commented 4 years ago

Thank you for your quick reply. Before I posted this question, I have reversed the code as mentioned in your instructions and make install. Blow is my diff on the file

diff --git a/crowdpose-api/PythonAPI/crowdposetools/cocoeval.py b/crowdpose-api/PythonAPI/crowdposetools/cocoeval.py
index 8586a4f..239e9b5 100644
--- a/crowdpose-api/PythonAPI/crowdposetools/cocoeval.py
+++ b/crowdpose-api/PythonAPI/crowdposetools/cocoeval.py
@@ -539,11 +539,11 @@ class COCOeval:
             stats[6] = _summarize(0, maxDets=20, iouThr=.5)
             stats[7] = _summarize(0, maxDets=20, iouThr=.75)
             type_result = self.get_type_result(first=0.2, second=0.8)
-            stats[8] = _summarize(1, maxDets=20,
+            stats[8] = _summarize(-1, maxDets=20,
                                   areaRng='easy', type_score=type_result[0])
-            stats[9] = _summarize(1, maxDets=20,
+            stats[9] = _summarize(-1, maxDets=20,
                      areaRng='medium', type_score=type_result[1])
-            stats[10]=_summarize(1, maxDets=20,
+            stats[10]=_summarize(-1, maxDets=20,
                                 areaRng='hard', type_score=type_result[2]) 
             return stats
         if not self.eval:

Also, I have added this line into my .bashrc file, export CrowdPoseAPI=/home/$USER/CrowdPose/crowdpose-api

Did I miss anything? Thank you!

bowenc0221 commented 4 years ago

You also need to change this line.

Add int before np.round.

wsjzha commented 4 years ago

The issue still exists. Looking at the error message, I think the issue is that we can't find this crowdposetools module inside of the Higher-HRNet-Human-Pose-Estimation repo. I think np.linspace does not cause this issue?

  File "/home/*/Higher-HRNet-Human-Pose-Estimation/tools/../lib/dataset/CrowdPoseKeypoints.py", line 15, in <module>
    import crowdposetools
ModuleNotFoundError: No module named 'crowdposetools'
bowenc0221 commented 4 years ago

Hi, if you are still having this problem, please make sure you install the crowdpose api and it is in your PYTHONPATH.

Ankitjaiswal1201 commented 3 years ago

https://github.com/HRNet/HigherHRNet-Human-Pose-Estimation/pull/65?_pjax=%23repo-content-pjax-container#issuecomment-898467412

Here is how i solved it.

narges-sa commented 2 years ago

Hi, if you are still having this problem, please make sure you install the crowdpose api and it is in your PYTHONPATH.

Hello, thank you for your suggestion. I want to run the litepose model on my google colab, I still have this problem with crowdpose API. how can I find my PYTHORCHPATH on google colab? another question, in litepose model, which files were used the once-for-all method?