Skip to content

Commit

Permalink
Added Keypoint OKS sigmas parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sampepose committed Mar 26, 2019
1 parent ed842bf commit f66df29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PythonAPI/pycocotools/cocoeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def __init__(self, cocoGt=None, cocoDt=None, iouType='segm'):
print('iouType not specified. use default iouType segm')
self.cocoGt = cocoGt # ground truth COCO API
self.cocoDt = cocoDt # detections COCO API
self.params = {} # evaluation parameters
self.evalImgs = defaultdict(list) # per-image per-category evaluation results [KxAxI] elements
self.eval = {} # accumulated evaluation results
self._gts = defaultdict(list) # gt for evaluation
Expand Down Expand Up @@ -203,7 +202,7 @@ def computeOks(self, imgId, catId):
if len(gts) == 0 or len(dts) == 0:
return []
ious = np.zeros((len(dts), len(gts)))
sigmas = np.array([.26, .25, .25, .35, .35, .79, .79, .72, .72, .62,.62, 1.07, 1.07, .87, .87, .89, .89])/10.0
sigmas = p.kpt_oks_sigmas
vars = (sigmas * 2)**2
k = len(sigmas)
# compute oks between each detection and ground truth object
Expand Down Expand Up @@ -521,6 +520,7 @@ def setKpParams(self):
self.areaRng = [[0 ** 2, 1e5 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]]
self.areaRngLbl = ['all', 'medium', 'large']
self.useCats = 1
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

def __init__(self, iouType='segm'):
if iouType == 'segm' or iouType == 'bbox':
Expand Down

0 comments on commit f66df29

Please sign in to comment.