{"id":18527914,"url":"https://github.com/nemonameless/draw_keypoint_gt_pred","last_synced_at":"2025-05-14T21:33:20.103Z","repository":{"id":118411979,"uuid":"215005472","full_name":"nemonameless/draw_keypoint_gt_pred","owner":"nemonameless","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-14T09:50:57.000Z","size":2229,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T06:30:26.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nemonameless.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-14T09:43:58.000Z","updated_at":"2019-10-14T09:50:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"5953f85a-437c-453f-ab2f-68a9bfb194f4","html_url":"https://github.com/nemonameless/draw_keypoint_gt_pred","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemonameless%2Fdraw_keypoint_gt_pred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemonameless%2Fdraw_keypoint_gt_pred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemonameless%2Fdraw_keypoint_gt_pred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemonameless%2Fdraw_keypoint_gt_pred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemonameless","download_url":"https://codeload.github.com/nemonameless/draw_keypoint_gt_pred/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254231421,"owners_count":22036365,"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","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":[],"created_at":"2024-11-06T17:56:18.246Z","updated_at":"2025-05-14T21:33:20.025Z","avatar_url":"https://github.com/nemonameless.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pytorch Keypoint Detection\n\n#### 介绍\n\n2019.05月pytorch发布了torchvision0.3, 里面实现了Mask_RCNN, Keypoint_RCNN和DeepLabV3，可以直接用于语义分割，目标检测，实例分割和人体关键点检测4个任务。\n\n在github上torch/vision/reference里面有classification, detection和segmentation三个文件夹，分别对应不同任务。直接运行detection的代码是MaskRCNN的实现，用于目标检测和实例分割任务。官网也有对应的[教程](https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html])。可以轻松通过COCO2017数据集进行训练和测试。\n\n但是如果要实现人体关键点检测的话需要在detection的文件修改一些参数，这里我将修改后的文件和可视化程序附上。\n\n![img1](https://github.com/scnuhealthy/Pytorch-Keypoint-Detection/blob/master/result/10.jpg)\n\n![img2](https://github.com/scnuhealthy/Pytorch-Keypoint-Detection/blob/master/result/14.jpg)\n\n![img3](https://github.com/scnuhealthy/Pytorch-Keypoint-Detection/blob/master/result/5.jpg)\n\n![img4](https://github.com/scnuhealthy/Pytorch-Keypoint-Detection/blob/master/result/8.jpg)\n\n![img5](https://github.com/scnuhealthy/Pytorch-Keypoint-Detection/blob/master/result/9.jpg)\n\n#### Dataset\n\n下载COCO2017数据集，下载train2017,val2017和annotations三个文件后解压，最终文件目录结构如下\n\nCOCO2017/\n\n​\ttrain2017/\n\n​\tval2017/\n\n​\tannotations/\n\n#### Train\n\n对`train.py`进行如下操作\n\n1 修改函数`get_dataset`中的`paths`\n\n2 修改文件中列出了的各种参数\n\n3 假设路径都修改完毕，使用预训练模型进行训练: `python train.py --pretrained`\n\n#### Predict and Visualize\n\n对COCO val集的图片进行预测并可视化。\n\n对predict_visualize.py进行如下操作\n\n1 修改代码中的路径\n\n2 修改参数`detect_threshold`和`keypoint_score_threshold`, 分别过滤得分低的个体和得分低的关键点\n\n3 在根目录下建立文件夹result, 可视化后的图片存在在此文件夹下\n\n4 运行`python predict_visualize.py`\n\n#### Evaluate\n\n执行代码`python train.py --test-only`\n\n程序在COCO2017 val集上的结果如下，同[官网介绍](https://pytorch.org/blog/torchvision03/)一致\n\n```\nAveraged stats: model_time: 0.1371 (0.1627)  evaluator_time: 0.0043 (0.0105)\nAccumulating evaluation results...\nDONE (t=1.31s).\nAccumulating evaluation results...\nDONE (t=0.41s).\nIoU metric: bbox\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.502\n Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.796\n Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.545\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.341\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.591\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.648\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.176\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.519\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.603\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.460\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.669\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.738\nIoU metric: keypoints\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets= 20 ] = 0.599\n Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets= 20 ] = 0.834\n Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets= 20 ] = 0.650\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.553\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.675\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 20 ] = 0.672\n Average Recall     (AR) @[ IoU=0.50      | area=   all | maxDets= 20 ] = 0.889\n Average Recall     (AR) @[ IoU=0.75      | area=   all | maxDets= 20 ] = 0.721\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.623\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.741\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemonameless%2Fdraw_keypoint_gt_pred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemonameless%2Fdraw_keypoint_gt_pred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemonameless%2Fdraw_keypoint_gt_pred/lists"}