Skip to content
DeepForgeby svx
All problems
HardComputer Visioncv-256

Pose Similarity OKS

Problem

Compute the object keypoint similarity (OKS).

For every ground-truth keypoint with visibility v > 0 add exp(-d^2 / (2 * scale^2 * sigma_i^2)), where d^2 is the squared distance between the predicted and ground-truth coordinates, then divide by the number of visible keypoints. Round to 4 decimal places and return 0.0 when nothing is visible.

Test cases

case 1
in: [[[0,0,1],[10,10,1]],[[0,0,1],[10,10,1]],1,[0.1,0.1]]
expected: 1
case 2
in: [[[1,0,1],[10,10,1]],[[0,0,1],[10,10,1]],1,[0.1,0.1]]
expected: 0.5
case 3
in: [[[0,0,0],[10,10,1]],[[0,0,1],[10,10,1]],1,[0.1,0.1]]
expected: 1
Starter codePython
def oks(pred, gt, scale, sigmas):
    # Your code here
    pass

3 test cases · run your code against them in the editor