{"id":27757756,"url":"https://github.com/TuSimple/simpledet","last_synced_at":"2025-04-29T10:01:32.075Z","repository":{"id":41055474,"uuid":"168118326","full_name":"tusen-ai/simpledet","owner":"tusen-ai","description":"A Simple and Versatile Framework for Object Detection and Instance Recognition","archived":false,"fork":false,"pushed_at":"2021-09-23T02:57:09.000Z","size":1407,"stargazers_count":3084,"open_issues_count":44,"forks_count":486,"subscribers_count":119,"default_branch":"master","last_synced_at":"2025-04-22T02:02:28.676Z","etag":null,"topics":["instance-segmentation","mxnet","object-detection"],"latest_commit_sha":null,"homepage":"","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/tusen-ai.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}},"created_at":"2019-01-29T08:28:55.000Z","updated_at":"2025-04-05T08:08:19.000Z","dependencies_parsed_at":"2022-09-10T03:45:01.000Z","dependency_job_id":null,"html_url":"https://github.com/tusen-ai/simpledet","commit_stats":null,"previous_names":["tusimple/simpledet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusen-ai%2Fsimpledet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusen-ai%2Fsimpledet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusen-ai%2Fsimpledet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusen-ai%2Fsimpledet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tusen-ai","download_url":"https://codeload.github.com/tusen-ai/simpledet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251480073,"owners_count":21596017,"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":["instance-segmentation","mxnet","object-detection"],"created_at":"2025-04-29T10:00:46.510Z","updated_at":"2025-04-29T10:01:31.979Z","avatar_url":"https://github.com/tusen-ai.png","language":"Python","funding_links":[],"categories":["Repositories","Python","\u003ca name=\"Vision\"\u003e\u003c/a\u003e2. Vision","Appendix: Object Detection for Natural Scene"],"sub_categories":["2.2 Object Detection","Papers"],"readme":"## SimpleDet - A Simple and Versatile Framework for Object Detection and Instance Recognition\n### Major Features\n![](./doc/image/diagram_v2.png)\n- FP16 training for memory saving and up to **2.5X** acceleration\n- Highly scalable distributed training available **out of box**\n- Full coverage of state-of-the-art models including FasterRCNN, MaskRCNN, CascadeRCNN, RetinaNet, [DCNv1/v2](./models/dcn), **[TridentNet](./models/tridentnet)**, **[NASFPN](./models/NASFPN)** , **[EfficientNet](./models/efficientnet)**, and **[Knowledge Distillation](./models/KD)**\n- Extensive feature set including **large batch BN**, **loss synchronization**, **automatic BN fusion**, soft NMS, multi-scale train/test\n- Modular design for coding-free exploration of new experiment settings\n- Extensive documentations including [annotated config](./doc/fully_annotated_config.py), [Fintuning Guide](./doc/FINETUNE.md)\n\n### Recent Updates\n- Add RPN test (2019.05.28)\n- Add [NASFPN](https://github.com/TuSimple/simpledet/tree/master/models/NASFPN) (2019.06.04)\n- Add new ResNetV1b baselines from GluonCV (2019.06.07)\n- Add Cascade R-CNN with FPN backbone (2019.06.11)\n- Speed up FPN up to 70% (2019.06.16)\n- Update [NASFPN](https://github.com/TuSimple/simpledet/tree/master/models/NASFPN) to include larger models (2019.07.01)\n- Automatic BN fusion for fixed BN training, saving up to 50% GPU memory (2019.07.04)\n- Speed up MaskRCNN by 80% (2019.07.23)\n- Update MaskRCNN baselines (2019.07.25)\n- Add EfficientNet and DCN (2019.08.06)\n- Add python wheel for easy local installation (2019.08.20)\n- Add FitNet based Knowledge Distill (2019.08.27)\n- Add SE and train from scratch (2019.08.30)\n- Add a lot of docs (2019.09.03)\n- Add support for INT8 training(contributed by Xiaotao Chen \u0026 Jingqiu Zhou) (2019.10.24)\n- Add support for FCOS(contributed by Zhen Wei) (2019.11)\n- Add support for Mask Scoring RCNN(contributed by Zehui Chen) (2019.12)\n- Add support for RepPoints(contributed by Bo Ke) (2020.02)\n- Add support for FreeAnchor (2020.03)\n- Add support for Feature Pyramid Grids \u0026 PAFPN (2020.06)\n- Add support for CrowdHuman Dataset (2020.06)\n- Add support for [Double Pred](https://arxiv.org/abs/2003.09163) (2020.06)\n- Add support for [SEPC](https://github.com/TuSimple/simpledet/tree/master/models/sepc)(contributed by Qiaofei Li) (2020.07)\n\n### Setup\n#### All-in-one Script\nWe provide a [setup script](./scripts/setup.sh) for install simpledet and preppare the coco dataset. If you use this script, you can skip to the Quick Start.\n\n#### Install\nWe provide a conda installation here for Debian/Ubuntu system. To use a pre-built docker or singularity images, please refer to [INSTALL.md](./doc/INSTALL.md) for more information.\n\n```bash\n# install dependency\nsudo apt update \u0026\u0026 sudo apt install -y git wget make python3-dev libglib2.0-0 libsm6 libxext6 libxrender-dev unzip\n\n# create conda env\nconda create -n simpledet python=3.7\nconda activate simpledet\n\n# fetch CUDA environment\nconda install cudatoolkit=10.1\n\n# install python dependency\npip install 'matplotlib\u003c3.1' opencv-python pytz\n\n# download and intall pre-built wheel for CUDA 10.1\npip install https://1dv.aflat.top/mxnet_cu101-1.6.0b20191214-py2.py3-none-manylinux1_x86_64.whl\n\n# install pycocotools\npip install 'git+https://github.com/RogerChern/cocoapi.git#subdirectory=PythonAPI'\n\n# install mxnext, a wrapper around MXNet symbolic API\npip install 'git+https://github.com/RogerChern/mxnext#egg=mxnext'\n\n# get simpledet\ngit clone https://github.com/tusimple/simpledet\ncd simpledet\nmake\n\n# test simpledet installation\nmkdir -p experiments/faster_r50v1_fpn_1x\npython detection_infer_speed.py --config config/faster_r50v1_fpn_1x.py --shape 800 1333\n```\n\nIf the last line execute successfully, the average running speed of Faster R-CNN R-50 FPN will be reported. And you have successfuly setup SimpleDet. Now you can head up to the next section to prepare your dataset.\n\n\n#### Preparing Data\nWe provide a step by step preparation for the COCO dataset below.\n```bash\ncd simpledet\n\n# make data dir\nmkdir -p data/coco/images data/src\n\n# skip this if you have the zip files\nwget -c http://images.cocodataset.org/zips/train2017.zip -O data/src/train2017.zip\nwget -c http://images.cocodataset.org/zips/val2017.zip -O data/src/val2017.zip\nwget -c http://images.cocodataset.org/zips/test2017.zip -O data/src/test2017.zip\nwget -c http://images.cocodataset.org/annotations/annotations_trainval2017.zip -O data/src/annotations_trainval2017.zip\nwget -c http://images.cocodataset.org/annotations/image_info_test2017.zip -O data/src/image_info_test2017.zip\n\nunzip data/src/train2017.zip -d data/coco/images\nunzip data/src/val2017.zip -d data/coco/images\nunzip data/src/test2017.zip -d data/coco/images\nunzip data/src/annotations_trainval2017.zip -d data/coco\nunzip data/src/image_info_test2017.zip -d data/coco\n\npython utils/create_coco_roidb.py --dataset coco --dataset-split train2017\npython utils/create_coco_roidb.py --dataset coco --dataset-split val2017\npython utils/create_coco_roidb.py --dataset coco --dataset-split test-dev2017\n```\n\nFor other datasets or your own data, please check [DATASET.md](doc/DATASET.md) for more details.\n\n#### Quick Start\n\n```bash\n# train\npython detection_train.py --config config/faster_r50v1_fpn_1x.py\n\n# test\npython detection_test.py --config config/faster_r50v1_fpn_1x.py\n```\n\n#### Finetune\nPlease check [FINTUNE.md](doc/FINETUNE.md)\n\n#### Model Zoo\nPlease refer to [MODEL_ZOO.md](./MODEL_ZOO.md) for available models\n\n### Distributed Training\nPlease refer to [DISTRIBUTED.md](./doc/DISTRIBUTED.md)\n\n### Project Organization\n#### Code Structure\n```\ndetection_train.py\ndetection_test.py\nconfig/\n    detection_config.py\ncore/\n    detection_input.py\n    detection_metric.py\n    detection_module.py\nmodels/\n    FPN/\n    tridentnet/\n    maskrcnn/\n    cascade_rcnn/\n    retinanet/\nmxnext/\nsymbol/\n    builder.py\n```\n#### Config\nEverything is configurable from the config file, all the changes should be **out of source**.\n\n#### Experiments\nOne experiment is a directory in **experiments** folder with the same name as the config file.\n\u003e E.g. r50_fixbn_1x.py is the name of a config file\n\n```\nconfig/\n    r50_fixbn_1x.py\nexperiments/\n    r50_fixbn_1x/\n        checkpoint.params\n        log.txt\n        coco_minival2014_result.json\n```\n\n#### Models\nThe `models` directory contains SOTA models implemented in SimpletDet.\n\n#### How is Faster R-CNN built\n![Faster R-CNN](doc/image/detector.png)\n\n**Simpledet** supports many popular detection methods and here we take [**Faster R-CNN**](https://arxiv.org/abs/1506.01497) as a typical example to show how a detector is built.\n\n- *Preprocessing*. The preprocessing methods of the detector is implemented through `DetectionAugmentation`.\n  - Image/bbox-related preprocessing, such as `Norm2DImage` and `Resize2DImageBbox`.\n  - Anchor generator `AnchorTarget2D`, which generates anchors and corresponding anchor targets for training RPN.\n- *Network Structure*. The training and testing symbols of Faster-RCNN detector is defined in `FasterRcnn`. The key components are listed as follow:\n  - *Backbone*. `Backbone` provides interfaces to build backbone networks, *e.g.* ResNet and ResNext.\n  - *Neck*. `Neck` provides interfaces to build complementary feature extraction layers for backbone networks, *e.g.* `FPNNeck` builds Top-down pathway for [Feature Pyramid Network](https://arxiv.org/abs/1612.03144).\n  - *RPN head*. `RpnHead` aims to build classification and regression layers to generate proposal outputs for RPN. Meanwhile, it also provides interplace to generate sampled proposals for the subsequent R-CNN.\n  - *Roi Extractor*. `RoiExtractor` extracts features for each roi (proposal) based on the R-CNN features generated by `Backbone` and `Neck`.\n  - *Bounding Box Head*. `BboxHead` builds the R-CNN layers for proposal refinement.\n\n#### How to build a custom detector\nThe flexibility of **simpledet** framework makes it easy to build different detectors. We take [**TridentNet**](https://arxiv.org/abs/1901.01892) as an example to demonstrate how to build a custom detector simply based on the Faster R-CNN framework.\n\n- *Preprocessing*. The additional processing methods could be provided accordingly by inheriting from `DetectionAugmentation`.\n  - In TridentNet, a new `TridentAnchorTarget2D` is implemented to generate anchors for multiple branches and filter anchors for scale-aware training scheme.\n- *Network Structure*. The new network structure could be constructed easily for a custom detector by modifying some required components as needed and\n  - For TridentNet, we build trident blocks in the `Backbone` according to the descriptions in the paper. We also provide a `TridentRpnHead` to generate filtered proposals in RPN to implement the scale-aware scheme. Other components are shared the same with original Faster-RCNN.\n\n\n### Contributors\nYuntao Chen, Chenxia Han, Yanghao Li, Zehao Huang, Naiyan Wang, Xiaotao Chen, Jingqiu Zhou, Zhen Wei, Zehui Chen, Zhaoxiang Zhang, Bo Ke\n\n\n### License and Citation\nThis project is release under the Apache 2.0 license for non-commercial usage. For commercial usage, please contact us for another license.\n\nIf you find our project helpful, please consider cite our tech report.\n```\n@article{JMLR:v20:19-205,\n  author  = {Yuntao Chen and Chenxia Han and Yanghao Li and Zehao Huang and Yi Jiang and Naiyan Wang and Zhaoxiang Zhang},\n  title   = {SimpleDet: A Simple and Versatile Distributed Framework for Object Detection and Instance Recognition},\n  journal = {Journal of Machine Learning Research},\n  year    = {2019},\n  volume  = {20},\n  number  = {156},\n  pages   = {1-8},\n  url     = {http://jmlr.org/papers/v20/19-205.html}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTuSimple%2Fsimpledet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTuSimple%2Fsimpledet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTuSimple%2Fsimpledet/lists"}