Skip to content

Commit

Permalink
fix poseval dependency (open-mmlab#953)
Browse files Browse the repository at this point in the history
  • Loading branch information
ly015 authored Oct 8, 2021
1 parent af36cf1 commit 6ce9881
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions mmpose/datasets/datasets/top_down/topdown_posetrack18_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
import json_tricks as json
import numpy as np
from mmcv import Config
from poseval import eval_helpers
from poseval.evaluateAP import evaluateAP

from ....core.post_processing import oks_nms, soft_oks_nms
from ...builder import DATASETS
from .topdown_coco_dataset import TopDownCocoDataset

try:
from poseval import eval_helpers
from poseval.evaluateAP import evaluateAP
has_poseval = True
except (ImportError, ModuleNotFoundError):
has_poseval = False


@DATASETS.register_module()
class TopDownPoseTrack18Dataset(TopDownCocoDataset):
Expand Down Expand Up @@ -259,6 +264,11 @@ def _write_posetrack18_keypoint_results(keypoint_results, gt_folder,
def _do_python_keypoint_eval(self, gt_folder, pred_folder):
"""Keypoint evaluation using poseval."""

if not has_poseval:
raise ImportError('Please install poseval package for evaluation'
'on PoseTrack dataset '
'(see requirements/optional.txt)')

argv = ['', gt_folder + '/', pred_folder + '/']

print('Loading data')
Expand Down
1 change: 1 addition & 0 deletions requirements/optional.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
albumentations>=0.3.2 --no-binary imgaug,albumentations
onnx
onnxruntime
poseval@git+https://github.com/svenkreiss/poseval.git
pyrender
smplx>=0.1.28
trimesh
1 change: 0 additions & 1 deletion requirements/runtime.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ munkres
numpy
opencv-python
pillow
poseval@git+https://github.com/svenkreiss/poseval.git
scipy
torchvision
xtcocotools>=1.8
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ line_length = 79
multi_line_output = 0
known_standard_library = pkg_resources,setuptools
known_first_party = mmpose
known_third_party = PIL,cv2,h5py,json_tricks,matplotlib,mmcv,munkres,numpy,poseval,pytest,pytorch_sphinx_theme,scipy,seaborn,spacepy,titlecase,torch,torchvision,xmltodict,xtcocotools
known_third_party = PIL,cv2,h5py,json_tricks,matplotlib,mmcv,munkres,numpy,pytest,pytorch_sphinx_theme,scipy,seaborn,spacepy,titlecase,torch,torchvision,xmltodict,xtcocotools
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY

0 comments on commit 6ce9881

Please sign in to comment.