Skip to content

Commit aca78bc

Browse files
authored
Merge pull request cocodataset#269 from sampepose/sigma_oks
Added optional Keypoint OKS sigmas argument
2 parents ed842bf + f66df29 commit aca78bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PythonAPI/pycocotools/cocoeval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def __init__(self, cocoGt=None, cocoDt=None, iouType='segm'):
6868
print('iouType not specified. use default iouType segm')
6969
self.cocoGt = cocoGt # ground truth COCO API
7070
self.cocoDt = cocoDt # detections COCO API
71-
self.params = {} # evaluation parameters
7271
self.evalImgs = defaultdict(list) # per-image per-category evaluation results [KxAxI] elements
7372
self.eval = {} # accumulated evaluation results
7473
self._gts = defaultdict(list) # gt for evaluation
@@ -203,7 +202,7 @@ def computeOks(self, imgId, catId):
203202
if len(gts) == 0 or len(dts) == 0:
204203
return []
205204
ious = np.zeros((len(dts), len(gts)))
206-
sigmas = np.array([.26, .25, .25, .35, .35, .79, .79, .72, .72, .62,.62, 1.07, 1.07, .87, .87, .89, .89])/10.0
205+
sigmas = p.kpt_oks_sigmas
207206
vars = (sigmas * 2)**2
208207
k = len(sigmas)
209208
# compute oks between each detection and ground truth object
@@ -521,6 +520,7 @@ def setKpParams(self):
521520
self.areaRng = [[0 ** 2, 1e5 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]]
522521
self.areaRngLbl = ['all', 'medium', 'large']
523522
self.useCats = 1
523+
self.kpt_oks_sigmas = np.array([.26, .25, .25, .35, .35, .79, .79, .72, .72, .62,.62, 1.07, 1.07, .87, .87, .89, .89])/10.0
524524

525525
def __init__(self, iouType='segm'):
526526
if iouType == 'segm' or iouType == 'bbox':

0 commit comments

Comments
 (0)