{"id":16887754,"url":"https://github.com/ethanhe42/kl-loss","last_synced_at":"2025-04-04T07:06:41.604Z","repository":{"id":62338767,"uuid":"173236386","full_name":"ethanhe42/KL-Loss","owner":"ethanhe42","description":"Bounding Box Regression with Uncertainty for Accurate Object Detection (CVPR'19)","archived":false,"fork":false,"pushed_at":"2024-04-07T06:36:01.000Z","size":5280,"stargazers_count":704,"open_issues_count":8,"forks_count":103,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-04-13T06:57:54.133Z","etag":null,"topics":["detection","detection-algorithm","detection-model","detection-network","object-detection","pytorch"],"latest_commit_sha":null,"homepage":"https://yihui.dev/bounding-box-regression-with-uncertainty-for-accurate-object-detection","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethanhe42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"yihuihe","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2019-03-01T04:47:09.000Z","updated_at":"2024-04-07T07:32:12.000Z","dependencies_parsed_at":"2024-04-11T03:00:17.908Z","dependency_job_id":"f90332cd-071e-4d6c-8b7a-a67577ed60c5","html_url":"https://github.com/ethanhe42/KL-Loss","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"0ebfbabd61f680658c24a6ef4f0217888d9fff06"},"previous_names":["ethanhe42/kl-loss"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanhe42%2FKL-Loss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanhe42%2FKL-Loss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanhe42%2FKL-Loss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethanhe42%2FKL-Loss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethanhe42","download_url":"https://codeload.github.com/ethanhe42/KL-Loss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"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":["detection","detection-algorithm","detection-model","detection-network","object-detection","pytorch"],"created_at":"2024-10-13T16:46:39.670Z","updated_at":"2025-04-04T07:06:41.582Z","avatar_url":"https://github.com/ethanhe42.png","language":"Python","funding_links":["https://ko-fi.com/yihuihe"],"categories":[],"sub_categories":[],"readme":"# Bounding Box Regression with Uncertainty for Accurate Object Detection\n\n[GitHub - yihui-he/KL-Loss: Bounding Box Regression with Uncertainty for Accurate Object Detection (CVPR'19)](https://github.com/yihui-he/KL-Loss)\n\n[CVPR 2019 Open Access Repository](https://openaccess.thecvf.com/content_CVPR_2019/html/He_Bounding_Box_Regression_With_Uncertainty_for_Accurate_Object_Detection_CVPR_2019_paper.html)\n\n**CVPR 2019** [[presentation (youtube)]](https://www.youtube.com/watch?v=bcGtNdTzdkc)\n\n[Yihui He](http://yihui-he.github.io/), [Chenchen Zhu](https://sites.google.com/andrew.cmu.edu/zcckernel), [Jianren Wang](https://scholar.google.com/citations?user=NL8MDkwAAAAJ\u0026hl=en), [Marios Savvides](http://www.cmu-biometrics.org/), [Xiangyu Zhang](https://scholar.google.com/citations?user=yuB-cfoAAAAJ\u0026hl=en\u0026oi=ao), Carnegie Mellon University \u0026 Megvii Inc.\n\n[https://www.youtube.com/embed/bcGtNdTzdkc](https://www.youtube.com/embed/bcGtNdTzdkc)\n\n### Table of Contents\n\n1. [Citation](about:blank#citation)\n2. [Installation](about:blank#installation)\n3. [Testing](about:blank#testing)\n4. [Training](about:blank#training)\n5. [PyTorch re-implementations](about:blank#pytorch-re-implementations)\n6. [FAQ](about:blank#faq)\n\nLarge-scale object detection datasets (e.g., MS-COCO) try to define the ground truth bounding boxes as clear as possible. However, we observe that ambiguities are still introduced when labeling the bounding boxes. In this paper, we propose a novel bounding box regression loss for learning bounding box transformation and localization variance together. Our loss greatly improves the localization accuracies of various architectures with nearly no additional computation. The learned localization variance allows us to merge neighboring bounding boxes during non-maximum suppression (NMS), which further improves the localization performance. On MS-COCO, we boost the Average Precision (AP) of VGG-16 Faster R-CNN from 23.6% to 29.1%. More importantly, for ResNet-50-FPN Mask R-CNN, our method improves the AP and AP90 by **1.8%** and **6.2%** respectively, which significantly outperforms previous state-of-the-art bounding box refinement methods.\n\n![https://raw.githubusercontent.com/yihui-he/KL-Loss/master/demo/output/softer.png](https://raw.githubusercontent.com/yihui-he/KL-Loss/master/demo/output/softer.png)\n\n### Citation\n\nIf you find the code useful in your research, please consider citing:\n\n```\n@InProceedings{klloss,\n  author = {He, Yihui and Zhu, Chenchen and Wang, Jianren and Savvides, Marios and Zhang, Xiangyu},\n  title = {Bounding Box Regression With Uncertainty for Accurate Object Detection},\n  booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n  month = {June},\n  year = {2019}\n}\n```\n\n### Installation\n\nPlease find installation instructions for Caffe2 and Detectron in `[INSTALL.md](INSTALL.md)`.\n\nWhen installing cocoapi, please use [my fork](https://github.com/yihui-he/cocoapi) to get AP80 and AP90 scores.\n\n### Testing\n\nInference without Var Voting (8 GPUs):\n\n```\npython2 tools/test_net.py -c configs/e2e_faster_rcnn_R-50-FPN_2x.yaml\n```\n\nYou will get:\n\n```\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.385\n Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.578\n Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.412\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.209\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.412\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.515\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.323\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.499\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.522\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.321\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.553\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.680\n Average Precision  (AP) @[ IoU=0.60      | area=   all | maxDets=100 ] = 0.533\n Average Precision  (AP) @[ IoU=0.70      | area=   all | maxDets=100 ] = 0.461\n Average Precision  (AP) @[ IoU=0.80      | area=   all | maxDets=100 ] = 0.350\n Average Precision  (AP) @[ IoU=0.85      | area=   all | maxDets=100 ] = 0.269\n Average Precision  (AP) @[ IoU=0.90      | area=   all | maxDets=100 ] = 0.154\n Average Precision  (AP) @[ IoU=0.95      | area=   all | maxDets=100 ] = 0.032\n```\n\nInference with Var Voting:\n\n```\npython2 tools/test_net.py -c configs/e2e_faster_rcnn_R-50-FPN_2x.yaml STD_NMS True\n```\n\nYou will get:\n\n```\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.392\n Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.576\n Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.425\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.212\n Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.417\n Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.526\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.324\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.528\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.564\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.346\n Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.594\n Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.736\n Average Precision  (AP) @[ IoU=0.60      | area=   all | maxDets=100 ] = 0.536\n Average Precision  (AP) @[ IoU=0.70      | area=   all | maxDets=100 ] = 0.472\n Average Precision  (AP) @[ IoU=0.80      | area=   all | maxDets=100 ] = 0.363\n Average Precision  (AP) @[ IoU=0.85      | area=   all | maxDets=100 ] = 0.281\n Average Precision  (AP) @[ IoU=0.90      | area=   all | maxDets=100 ] = 0.165\n Average Precision  (AP) @[ IoU=0.95      | area=   all | maxDets=100 ] = 0.037\n```\n\n### Training\n\n```\npython2 tools/train_net.py -c configs/e2e_faster_rcnn_R-50-FPN_2x.yaml\n```\n\n### PyTorch re-implementations\n\n[Stronger-yolo-pytorch](https://yihui-he.github.io/Stronger-yolo-pytorch/): yolov3 + KL-loss\n\n### FAQ\n\nPlease create a [new issue](https://github.com/yihui-he/KL-Loss/issues/new).\n\n---\n\n[Detectron Readme](https://github.com/facebookresearch/Detectron)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanhe42%2Fkl-loss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethanhe42%2Fkl-loss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanhe42%2Fkl-loss/lists"}