{"id":26255374,"url":"https://github.com/yutsuro/oks","last_synced_at":"2025-08-05T09:06:41.925Z","repository":{"id":192108368,"uuid":"659634271","full_name":"Yutsuro/OKS","owner":"Yutsuro","description":"Calculate OKS(Object Keypoints Similarity) from two sets of keypoints","archived":false,"fork":false,"pushed_at":"2023-09-02T11:52:10.000Z","size":7,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T19:18:28.452Z","etag":null,"topics":["coco","object-keypoints-similarity","oks","openpose","pose-detection","pose-estimation","pose-tracking","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yutsuro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-28T08:37:43.000Z","updated_at":"2024-12-21T05:44:45.000Z","dependencies_parsed_at":"2023-09-02T16:28:22.617Z","dependency_job_id":null,"html_url":"https://github.com/Yutsuro/OKS","commit_stats":null,"previous_names":["yutsuro/oks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Yutsuro/OKS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yutsuro%2FOKS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yutsuro%2FOKS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yutsuro%2FOKS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yutsuro%2FOKS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yutsuro","download_url":"https://codeload.github.com/Yutsuro/OKS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yutsuro%2FOKS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268866550,"owners_count":24320276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coco","object-keypoints-similarity","oks","openpose","pose-detection","pose-estimation","pose-tracking","python"],"created_at":"2025-03-13T19:18:30.234Z","updated_at":"2025-08-05T09:06:41.841Z","avatar_url":"https://github.com/Yutsuro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OKS\n\n**Calculate OKS(Object Keypoints Similarity) from two sets of keypoints**\n\nOKS is defined in [here](https://cocodataset.org/#keypoints-eval).\n\n## Arguments\n\nTo caluculate OKS, you need four arguments; `kpts1`, `kpts2`, `sigma`, and `area`.\n\n### `kpts1` \u0026 `kpts2`: Sets of Keypoints\n\nThe `OKS` function caluclates the value of OKS between `kpts1` and `kpts2`.\n\n`kpts1` and `kpts2` must be same shape and each keypoint must have three parameters; x, y, and v (v is a visibility).\n\n### `sigma`: Per-Keypoint Standard Deviation\n\n`sigma` is a set of parameters of per-keypoint standard deviation. It is determined for each dataset. Detail is [here](https://cocodataset.org/#keypoints-eval).\n\nSamples of `sigma`:\n```python\n# COCO\nsigma = np.array([.26, .25, .25, .35, .35, .79, .79, .72, .72, .62,.62, 1.07, 1.07, .87, .87, .89, .89])/10.0\n\n# body_25\nsigma = np.array([.26, .25, .25, .35, .35, .79, .79, .72, .72, .62,.62, 1.07, 1.07, .87, .87, .89, .8, .8, .8, .89, .89, .89, .89, .89, .89])/10.0\n```\n\nIf you use your custom dataset, you have to prepare your `sigma`.\n\n### `area`: Area of the Object\n\n`area` is the number of pixels of the object (such as person) in the picture.\n\nFor sake of simplicity, you can use the mean of \"area\" in your COCO annotation.\n\n## How to Use\n\nYou can caluclate the value of OKS between `kpts1` and `kpts2` like below:\n\n```python\n# This is the sample for COCO keypoints.\nsigma = np.array([.26, .25, .25, .35, .35, .79, .79, .72, .72, .62,.62, 1.07, 1.07, .87, .87, .89, .89])/10.0\n\narea = 20000\n\nkpts1 = [541, 299, 2, 576, 280, 2, 579, 315, 2, 583, 351, 2, 564, 394, 2, 586, 316, 2, 621, 351, 2, 605, 406, 2, 680, 320, 2, 692, 310, 2, 648, 322, 2, 664, 391, 2, 697, 316, 2, 641, 356, 2, 692, 419, 2, 0, 0, 0, 541, 287, 2]\nkpts2 = [542, 297, 2, 584, 278, 2, 574, 305, 2, 586, 347, 2, 565, 391, 2, 584, 309, 2, 620, 353, 2, 612, 406, 2, 696, 305, 2, 685, 317, 2, 0, 0, 0, 659, 391, 2, 699, 323, 2, 644, 350, 2, 689, 418, 2, 0, 0, 0, 542, 287, 2]\n\n# caluclate OKS from two keypoints\noks = OKS(kpts1, kpts2, sigma, area)\n\nprint(oks)\n# 0.852633\n```\n\n## Calculate `sigma` for Your Custom Dataset\n\nYou can get your `sigma` from your custom dataset which is annotated redundantly, or caluclate pseudo `sigma` using the diffelence between ground truth and detected keypoints (code is coming soon!).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyutsuro%2Foks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyutsuro%2Foks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyutsuro%2Foks/lists"}