Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
eval_pck -> calc_pck
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyu2172 committed Jun 14, 2017
1 parent aad4f55 commit c260506
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion chainercv/evaluations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from chainercv.evaluations.eval_detection_voc_ap import calc_detection_voc_ap # NOQA
from chainercv.evaluations.eval_detection_voc_ap import calc_detection_voc_prec_rec # NOQA
from chainercv.evaluations.eval_detection_voc_ap import eval_detection_voc_ap # NOQA
from chainercv.evaluations.eval_pck import eval_pck # NOQA
from chainercv.evaluations.calc_pck import calc_pck # NOQA
from chainercv.evaluations.eval_semantic_segmentation_iou import calc_semantic_segmentation_confusion # NOQA
from chainercv.evaluations.eval_semantic_segmentation_iou import calc_semantic_segmentation_iou # NOQA
from chainercv.evaluations.eval_semantic_segmentation_iou import eval_semantic_segmentation_iou # NOQA
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np


def eval_pck(pred, expected, alpha, L):
def calc_pck(pred, expected, alpha, L):
"""Calculate PCK (Percentage of Correct Keypoints).
This function calculates number of vertices whose positions are correctly
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/evaluations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ calc_detection_voc_prec_rec
PCK
---

eval_pck
calc_pck
~~~~~~~~
.. autofunction:: eval_pck
.. autofunction:: calc_pck


Semantic Segmentation IoU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

from chainer import testing

from chainercv.evaluations import eval_pck
from chainercv.evaluations import calc_pck


class TestEvalPCK(unittest.TestCase):
class TestCalcPCK(unittest.TestCase):

def test_eval_pck(self):
def test_calc_pck(self):
pred = np.array([[0, 0], [1, 1]], dtype=np.int32)
expected = np.array([[0, 0], [1, 2]], dtype=np.int32)

pck_pred = eval_pck(pred, expected, alpha=1., L=2.)
pck_pred = calc_pck(pred, expected, alpha=1., L=2.)
self.assertAlmostEqual(pck_pred, 1.)

pck_pred = eval_pck(pred, expected, alpha=0.25, L=2.)
pck_pred = calc_pck(pred, expected, alpha=0.25, L=2.)
self.assertAlmostEqual(pck_pred, 0.5)


Expand Down

0 comments on commit c260506

Please sign in to comment.