{"id":13415381,"url":"https://github.com/PeizeSun/OneNet","last_synced_at":"2025-03-14T22:33:21.541Z","repository":{"id":38399667,"uuid":"318529709","full_name":"PeizeSun/OneNet","owner":"PeizeSun","description":"[ICML2021] What Makes for End-to-End Object Detection","archived":false,"fork":false,"pushed_at":"2023-04-30T19:11:20.000Z","size":1560,"stargazers_count":649,"open_issues_count":4,"forks_count":75,"subscribers_count":20,"default_branch":"main","last_synced_at":"2024-07-31T21:53:44.991Z","etag":null,"topics":[],"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/PeizeSun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-12-04T13:47:25.000Z","updated_at":"2024-07-31T03:29:02.000Z","dependencies_parsed_at":"2023-01-24T00:17:44.984Z","dependency_job_id":"fc800eba-9612-4e52-b97a-80f9f851dc7c","html_url":"https://github.com/PeizeSun/OneNet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeizeSun%2FOneNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeizeSun%2FOneNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeizeSun%2FOneNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeizeSun%2FOneNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeizeSun","download_url":"https://codeload.github.com/PeizeSun/OneNet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658060,"owners_count":20326459,"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-07-30T21:00:47.908Z","updated_at":"2025-03-14T22:33:21.534Z","avatar_url":"https://github.com/PeizeSun.png","language":"Python","funding_links":[],"categories":["Frameworks","Python"],"sub_categories":[],"readme":"## OneNet: What Makes for End-to-End Object Detection?\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n![](onenet.jpeg)\n\nComparisons of different label assignment methods. H and W are height and width of feature map, respectively,\nK is number of object categories. Previous works on one-stage object detection assign labels by only position cost, such\nas (a) box IoU or (b) point distance between sample and ground-truth. In our method, however, (c) classification cost is\nadditionally introduced. We discover that **classification cost is the key to the success of end-to-end**. Without classification\ncost, only location cost leads to redundant boxes of high confidence scores in inference, making NMS post-processing a\nnecessary component.\n\n## Introduction\n\narxiv: [OneNet: Towards End-to-End One-Stage Object Detection](https://arxiv.org/abs/2012.05780v1)\n\npaper: [What Makes for End-to-End Object Detection?](https://arxiv.org/abs/2012.05780)\n\n## Updates\n- (28/06/2021) OneNet.RetinaNet and OneNet.FCOS on CrowdHuman are available.\n- (27/06/2021) OneNet.RetinaNet and OneNet.FCOS are available.\n- (11/12/2020) Higher Performance for OneNet is reported by disable gradient clip.\n\n## Comming\n  - [x] Provide models and logs\n  - [ ] Support to caffe, onnx, tensorRT\n  - [ ] Support to MobileNet\n  \n## Models on COCO\nWe provide two models \n- dcn is for high accuracy\n- nodcn is for easy deployment.\n\nMethod | inf_time | train_time | box AP | download\n--- |:---:|:---:|:---:|:---:\n[R18_dcn](projects/OneNet/configs/onenet.res18.dcn.yaml)     | 109 FPS | 20h  | 29.9 | [model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB)\n[R18_nodcn](projects/OneNet/configs/onenet.res18.nodcn.yaml) | 138 FPS | 13h  | 27.7 | [model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB)\n[R50_dcn](projects/OneNet/configs/onenet.res50.dcn.yaml)     | 67 FPS  | 36h  | 35.7 | [model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB)\n[R50_nodcn](projects/OneNet/configs/onenet.res50.nodcn.yaml) | 73 FPS  | 29h  | 32.7 | [model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \n[R50_RetinaNet](projects/OneNet/configs/onenet.retinanet.res50.yaml) | 26 FPS  | 31h  | 37.5 | [model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB)\n[R50_FCOS](projects/OneNet/configs/onenet.fcos.res50.yaml) | 27 FPS  | 21h  | 38.9 | [model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB)\n\nIf download link is invalid, models and logs are also available in [Github Release](https://github.com/PeizeSun/OneNet/releases/tag/v0.1) and [Baidu Drive](https://pan.baidu.com/s/1f0lQ63UEBD-qbHTrsD97hA) by code nhr8.\n\n#### Notes\n- We observe about 0.3 AP noise.\n- The training time and inference time are on 8 NVIDIA V100 GPUs. We observe the same type of GPUs in different clusters may cost different time.\n- We use the models pre-trained on imagenet using torchvision. And we provide [torchvision's ResNet-18.pkl](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB?usp=sharing) model. More details can be found in [the conversion script](tools/convert-torchvision-to-d2.py).\n\n## Models on CrowdHuman\n\nMethod | inf_time | train_time | AP50 | mMR | recall | download\n--- |:---:|:---:|:---:|:---:|:---:|:---:\n[R50_RetinaNet](projects/OneNet/configs/onenet.retinanet.res50.crowdhuman.yaml) | 26 FPS  | 11.5h | 90.9 | 48.8 | 98.0 |[model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB)\n[R50_FCOS](projects/OneNet/configs/onenet.fcos.res50.crowdhuman.yaml) | 27 FPS  | 4.5h  | 90.6 | 48.6 | 97.7 | [model](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB) \\| [log](https://drive.google.com/drive/folders/1LnHMj7pkJhODeZTNHW-UcUZxybKbQmTB)\n\nIf download link is invalid, models and logs are also available in [Github Release](https://github.com/PeizeSun/OneNet/releases/tag/v0.1) and [Baidu Drive](https://pan.baidu.com/s/1f0lQ63UEBD-qbHTrsD97hA) by code nhr8.\n\n#### Notes\n- The evalution code is built on top of [cvpods](https://github.com/Megvii-BaseDetection/cvpods).\n- The default evaluation code in training should be ignored, since it only considers at most 100 objects in one image, while crowdhuman image contains more than 100 objects.\n- The training time and inference time are on 8 NVIDIA V100 GPUs. We observe the same type of GPUs in different clusters may cost different time.\n- More training steps are in the [crowdhumantools](https://github.com/PeizeSun/OneNet/tree/main/projects/OneNet/crowdhumantools).\n\n\n## Installation\nThe codebases are built on top of [Detectron2](https://github.com/facebookresearch/detectron2) and [DETR](https://github.com/facebookresearch/detr).\n\n#### Requirements\n- Linux or macOS with Python ≥ 3.6\n- PyTorch ≥ 1.5 and [torchvision](https://github.com/pytorch/vision/) that matches the PyTorch installation.\n  You can install them together at [pytorch.org](https://pytorch.org) to make sure of this\n- OpenCV is optional and needed by demo and visualization\n\n#### Steps\n1. Install and build libs\n```\ngit clone https://github.com/PeizeSun/OneNet.git\ncd OneNet\npython setup.py build develop\n```\n\n2. Link coco dataset path to OneNet/datasets/coco\n```\nmkdir -p datasets/coco\nln -s /path_to_coco_dataset/annotations datasets/coco/annotations\nln -s /path_to_coco_dataset/train2017 datasets/coco/train2017\nln -s /path_to_coco_dataset/val2017 datasets/coco/val2017\n```\n\n3. Train OneNet\n```\npython projects/OneNet/train_net.py --num-gpus 8 \\\n    --config-file projects/OneNet/configs/onenet.res50.dcn.yaml\n```\n\n4. Evaluate OneNet\n```\npython projects/OneNet/train_net.py --num-gpus 8 \\\n    --config-file projects/OneNet/configs/onenet.res50.dcn.yaml \\\n    --eval-only MODEL.WEIGHTS path/to/model.pth\n```\n\n5. Visualize OneNet\n```    \npython demo/demo.py\\\n    --config-file projects/OneNet/configs/onenet.res50.dcn.yaml \\\n    --input path/to/images --output path/to/save_images --confidence-threshold 0.4 \\\n    --opts MODEL.WEIGHTS path/to/model.pth\n```\n\n## License\n\nOneNet is released under MIT License.\n\n\n## Citing\n\nIf you use OneNet in your research or wish to refer to the baseline results published here, please use the following BibTeX entries:\n\n```BibTeX\n\n@InProceedings{peize2020onenet,\n  title = \t {What Makes for End-to-End Object Detection?},\n  author =       {Sun, Peize and Jiang, Yi and Xie, Enze and Shao, Wenqi and Yuan, Zehuan and Wang, Changhu and Luo, Ping},\n  booktitle = \t {Proceedings of the 38th International Conference on Machine Learning},\n  pages = \t {9934--9944},\n  year = \t {2021},\n  volume = \t {139},\n  series = \t {Proceedings of Machine Learning Research},\n  publisher =    {PMLR},\n}\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeizeSun%2FOneNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPeizeSun%2FOneNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeizeSun%2FOneNet/lists"}