Skip to content

Commit 6ce9881

Browse files
authored
fix poseval dependency (open-mmlab#953)
1 parent af36cf1 commit 6ce9881

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

mmpose/datasets/datasets/top_down/topdown_posetrack18_dataset.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@
77
import json_tricks as json
88
import numpy as np
99
from mmcv import Config
10-
from poseval import eval_helpers
11-
from poseval.evaluateAP import evaluateAP
1210

1311
from ....core.post_processing import oks_nms, soft_oks_nms
1412
from ...builder import DATASETS
1513
from .topdown_coco_dataset import TopDownCocoDataset
1614

15+
try:
16+
from poseval import eval_helpers
17+
from poseval.evaluateAP import evaluateAP
18+
has_poseval = True
19+
except (ImportError, ModuleNotFoundError):
20+
has_poseval = False
21+
1722

1823
@DATASETS.register_module()
1924
class TopDownPoseTrack18Dataset(TopDownCocoDataset):
@@ -259,6 +264,11 @@ def _write_posetrack18_keypoint_results(keypoint_results, gt_folder,
259264
def _do_python_keypoint_eval(self, gt_folder, pred_folder):
260265
"""Keypoint evaluation using poseval."""
261266

267+
if not has_poseval:
268+
raise ImportError('Please install poseval package for evaluation'
269+
'on PoseTrack dataset '
270+
'(see requirements/optional.txt)')
271+
262272
argv = ['', gt_folder + '/', pred_folder + '/']
263273

264274
print('Loading data')

requirements/optional.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
albumentations>=0.3.2 --no-binary imgaug,albumentations
22
onnx
33
onnxruntime
4+
poseval@git+https://github.com/svenkreiss/poseval.git
45
pyrender
56
smplx>=0.1.28
67
trimesh

requirements/runtime.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ munkres
66
numpy
77
opencv-python
88
pillow
9-
poseval@git+https://github.com/svenkreiss/poseval.git
109
scipy
1110
torchvision
1211
xtcocotools>=1.8

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ line_length = 79
1919
multi_line_output = 0
2020
known_standard_library = pkg_resources,setuptools
2121
known_first_party = mmpose
22-
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
22+
known_third_party = PIL,cv2,h5py,json_tricks,matplotlib,mmcv,munkres,numpy,pytest,pytorch_sphinx_theme,scipy,seaborn,spacepy,titlecase,torch,torchvision,xmltodict,xtcocotools
2323
no_lines_before = STDLIB,LOCALFOLDER
2424
default_section = THIRDPARTY

0 commit comments

Comments
 (0)