Skip to the content.

Pose Estimation

Dataset and Code

Structure of Pose Estimation Dataset

Evaluation Metric

Instructions to run Pose Estimation models

This code was separately tested on RTX 3090, and 3080Ti using CUDA10.2.

  1. To prepare the environment, refer to
  2. Move and replace files according to the directories in $DIR_AK_AR/pose_estimation/code/code_new:
    • Helper script to move / create symbolic links to files
      • Remember to change the root directory $DIR_ROOT in $DIR_AK/pose_estimation/code/code_new/prepare_dir_PE.sh
      • bash $DIR_AK/pose_estimation/code/code_new/prepare_dir_PE.sh
  3. Untar the dataset
    • tar -zxvf $DIR_AK/pose_estimation/dataset.tar.gz
  4. Execute the code
    • python tools/train.py --cfg $DIR_HRNET/experiments/mpii/hrnet/w32_256x256_adam_lr1e-3_ak.yaml
  5. [Alternative] We have also specially prepared the dataset for use in MMPose https://mmpose.readthedocs.io/en/latest/get_started.html by OpenMMLab.
    • COCO annotations are available (Not used in our experiments)
    • Only mAP metric is available (Not used in our experiments) for COCO datasets in MMPose https://github.com/open-mmlab/mmpose/issues/721#issuecomment-859453118, https://github.com/open-mmlab/mmpose/issues/707
    • Helper script to set up environment
      • Remember to change the root directory $DIR_ROOT in $DIR_AK/pose_estimation/code/code_new/prepare_dir_PE.sh
      • bash $DIR_AK/pose_estimation/code/code_new/prepare_dir_PE_mmpose.sh
      • python $DIR_MMPOSE/tools/train.py configs/animal/2d_kpt_sview_rgb_img/topdown_heatmap/ak/hrnet_w32_ak_256x256.py

Solutions to potential issues:

Click to expand 1. unable to execute 'gcc': No such file or directory. error: command 'gcc' failed with exit status 1 * `sudo apt install gcc` 2. ModuleNotFoundError: No module named 'nms.cpu_nms' * <https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/24> * `cd $DIR_HRNET/lib` * `make` 3. OSError: The nvcc binary could not be located in your $PATH. Either add it to your path, or set $CUDAHOME * <https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/143> * `export CUDAHOME="/usr/lib/cuda"` 4. OSError: The CUDA nvcc path could not be located in /usr/lib/cuda/bin/nvcc * Ensure cuda and nvcc are installed * `sudo apt install nvidia-cuda-toolkit` * `which nvcc` * should show: `/usr/bin/nvcc` * `echo $CUDAHOME` * should show: `/usr/lib/cuda` * `sudo ln -s /usr/bin/nvcc /usr/lib/cuda/bin/nvcc` 5. RuntimeError: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 804: forward compatibility was attempted on non supported HW * Driver may have been uninstalled after running `sudo apt install nvidia-cuda-toolkit` * Check if the driver is installed * `nvidia-smi` * should show the drivers available for installation (e.g., `sudo apt install nvidia-utils-470`) 6. AttributeError: module 'torch.onnx' has no attribute 'set_training' * <https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/230> * `pip install tensorboardX --upgrade` * `pip install tensorboard` 7. ImportError: libcudart.so.10.2: cannot open shared object file: No such file or directory * <https://itsfoss.com/solve-open-shared-object-file-quick-tip> * `sudo /sbin/ldconfig -v`