{"id":20064761,"url":"https://github.com/thinklab-sjtu/csl_retinanet_tensorflow","last_synced_at":"2025-08-20T22:31:04.733Z","repository":{"id":107471897,"uuid":"245597890","full_name":"Thinklab-SJTU/CSL_RetinaNet_Tensorflow","owner":"Thinklab-SJTU","description":"Code for ECCV 2020 paper: Arbitrary-Oriented Object Detection with Circular Smooth Label","archived":false,"fork":false,"pushed_at":"2022-03-21T08:53:42.000Z","size":26295,"stargazers_count":191,"open_issues_count":5,"forks_count":32,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-06T19:04:00.511Z","etag":null,"topics":["angle-classification","object-detection","smooth-label","tensorflow"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2003.05597v2","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/Thinklab-SJTU.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":"2020-03-07T08:48:15.000Z","updated_at":"2024-12-02T03:08:35.000Z","dependencies_parsed_at":"2023-05-17T13:45:33.444Z","dependency_job_id":null,"html_url":"https://github.com/Thinklab-SJTU/CSL_RetinaNet_Tensorflow","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/Thinklab-SJTU%2FCSL_RetinaNet_Tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinklab-SJTU%2FCSL_RetinaNet_Tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinklab-SJTU%2FCSL_RetinaNet_Tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thinklab-SJTU%2FCSL_RetinaNet_Tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thinklab-SJTU","download_url":"https://codeload.github.com/Thinklab-SJTU/CSL_RetinaNet_Tensorflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230462906,"owners_count":18229864,"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":["angle-classification","object-detection","smooth-label","tensorflow"],"created_at":"2024-11-13T13:47:42.780Z","updated_at":"2024-12-19T16:10:47.530Z","avatar_url":"https://github.com/Thinklab-SJTU.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arbitrary-Oriented Object Detection with Circular Smooth Label\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![arXiv](http://img.shields.io/badge/cs.CV-arXiv%3A2003.05597-B31B1B.svg)](https://arxiv.org/abs/2003.05597v2)\n\n :rocket::rocket::rocket:\t**News:** CSL is supported at [MMRotate](https://github.com/open-mmlab/mmrotate) \u003cimg src=\"https://img.shields.io/github/stars/open-mmlab/mmrotate?style=social\" /\u003e :rocket::rocket::rocket:\n\n## Abstract\nThis repo is based on [Focal Loss for Dense Object Detection](https://arxiv.org/pdf/1708.02002.pdf), and it is completed by [YangXue](https://yangxue0827.github.io/).\n\n**We also recommend a tensorflow-based [rotation detection benchmark](https://github.com/yangxue0827/RotationDetection), which is led by [YangXue](https://yangxue0827.github.io/).**\n\n## Pipeline\n![2](pipeline.png)\n\n## Circular Smooth Label\n![5](CSL.png)\n\n## Latest Performance\n### DOTA1.0 (Task1)\n| Model |    Backbone    |    Training data    |    Val data    |    mAP   | Model Link | Anchor | Label Mode | Reg. Loss| Angle Range | lr schd | Data Augmentation | GPU | Image/GPU | Configs |      \n|:------------:|:------------:|:------------:|:---------:|:-----------:|:----------:|:-----------:|:-----------:|:-----------:|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|    \n| [CSL](https://arxiv.org/abs/2003.05597) | ResNet50_v1d 600-\u003e800 | DOTA1.0 trainval | DOTA1.0 test | 67.38 | [Baidu Drive (g3wt)](https://pan.baidu.com/s/1nrIs-oYA53qQzlPjqYkMJQ) | H | **Gaussian (r=1, w=10)** | smooth L1 | **180** | 2x | × | 3X GeForce RTX 2080 Ti | 1 | [cfgs_res50_dota_v45.py](./libs/configs/DOTA1.0/CSL/cfgs_res50_dota_v45.py) |\n| [CSL](https://arxiv.org/abs/2003.05597) | ResNet50_v1d 600-\u003e800 | DOTA1.0 trainval | DOTA1.0 test | 68.73 | [Baidu Drive (3a4t)](https://pan.baidu.com/s/1yC-b9Y4ZVgVkQvpPRRLmhw) | H | **Pulse (w=1)** | smooth L1 | **180** | 2x | × | 2X GeForce RTX 2080 Ti | 1 | [cfgs_res50_dota_v41.py](./libs/configs/DOTA1.0/CSL/cfgs_res50_dota_v41.py) |\n\n**Notice:**     \n**Due to the improvement of the code, the performance of this repo is gradually improving, so the experimental results in other configuration files are for reference only.**        \n**Please refer to [new repo](https://github.com/Thinklab-SJTU/R3Det_Tensorflow) for the latest progress.**\n\n### Visualization\n![1](demo1.png)\n\n## My Development Environment\n**docker images: docker pull yangxue2docker/yx-tf-det:tensorflow1.13.1-cuda10-gpu-py3**      \n1、python3.5 (anaconda recommend)               \n2、cuda 10.0                     \n3、[opencv(cv2)](https://pypi.org/project/opencv-python/)       \n4、[tfplot 0.2.0](https://github.com/wookayin/tensorflow-plot) (optional)            \n5、tensorflow 1.13                      \n\n## Download Model\n### Pretrain weights\n1、Please download [resnet50_v1](http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz), [resnet101_v1](http://download.tensorflow.org/models/resnet_v1_101_2016_08_28.tar.gz) pre-trained models on Imagenet, put it to data/pretrained_weights.       \n2、**(Recommend)** Or you can choose to use a better backbone, refer to [gluon2TF](https://github.com/yangJirui/gluon2TF).    \n* [Baidu Drive](https://pan.baidu.com/s/1GpqKg0dOaaWmwshvv1qWGg), password: 5ht9.          \n* [Google Drive](https://drive.google.com/drive/folders/1BM8ffn1WnsRRb5RcuAcyJAHX8NS2M1Gz?usp=sharing)      \n\n## Compile\n```  \ncd $PATH_ROOT/libs/box_utils/cython_utils\npython setup.py build_ext --inplace (or make)\n\ncd $PATH_ROOT/libs/box_utils/\npython setup.py build_ext --inplace\n```\n\n## Train\n\n1、If you want to train your own data, please note:  \n```     \n(1) Modify parameters (such as CLASS_NUM, DATASET_NAME, VERSION, etc.) in $PATH_ROOT/libs/configs/cfgs.py\n(2) Add category information in $PATH_ROOT/libs/label_name_dict/label_dict.py     \n(3) Add data_name to $PATH_ROOT/data/io/read_tfrecord.py \n```     \n\n2、Make tfrecord     \nFor DOTA dataset:      \n```  \ncd $PATH_ROOT\\data\\io\\DOTA\npython data_crop.py\n```  \n\n```  \ncd $PATH_ROOT/data/io/  \npython convert_data_to_tfrecord.py --VOC_dir='/PATH/TO/DOTA/' \n                                   --xml_dir='labeltxt'\n                                   --image_dir='images'\n                                   --save_name='train' \n                                   --img_format='.png' \n                                   --dataset='DOTA'\n```      \n\n3、Multi-gpu train\n```  \ncd $PATH_ROOT/tools\npython multi_gpu_train.py\n```\n\n## Test\n```  \ncd $PATH_ROOT/tools\npython test_dota.py --test_dir='/PATH/TO/IMAGES/'  \n                    --gpus=0,1,2,3,4,5,6,7  \n                    --s (visualization, optional)\n                    --ms (multi-scale test, optional)\n``` \n\n**Notice: In order to set the breakpoint conveniently, the read and write mode of the file is' a+'. If the model of the same #VERSION needs to be tested again, the original test results need to be deleted.**      \n\n## Tensorboard\n```  \ncd $PATH_ROOT/output/summary\ntensorboard --logdir=.\n``` \n\n![3](images.png)\n\n![4](scalars.png)\n\n\n## Object Heading Detection\n- [OHD-SJTU]((https://yangxue0827.github.io/OHD-SJTU.html)): Download from [here](https://yangxue0827.github.io/OHD-SJTU.html).     \n- [OHDet](https://github.com/SJTU-Thinklab-Det/OHDet_Tensorflow): The blue border in the bounding box represents the predicted head of the object. More detail trfer to [here](https://yangxue0827.github.io/CSL_GCL_OHDet.html).          \n\n![6](ohdet.png)\n\n## Citation\n\nIf this is useful for your research, please consider cite.\n\n```\n@article{yang2020arbitrary,\n    title={Arbitrary-Oriented Object Detection with Circular Smooth Label},\n    author={Yang, Xue and Yan, Junchi},\n    journal={European Conference on Computer Vision (ECCV)},\n    year={2020}\n    organization={Springer}\n}\n\n@article{yang2020on,\n    title={On the Arbitrary-Oriented Object Detection: Classification based Approaches Revisited},\n    author={Yang, Xue and Yan, Junchi and He, Tao},\n    year={2020}\n}\n\n@inproceedings{xia2018dota,\n    title={DOTA: A large-scale dataset for object detection in aerial images},\n    author={Xia, Gui-Song and Bai, Xiang and Ding, Jian and Zhu, Zhen and Belongie, Serge and Luo, Jiebo and Datcu, Mihai and Pelillo, Marcello and Zhang, Liangpei},\n    booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n    pages={3974--3983},\n    year={2018}\n}\n\n```\n\n\n## Reference\n1、https://github.com/endernewton/tf-faster-rcnn   \n2、https://github.com/zengarden/light_head_rcnn   \n3、https://github.com/tensorflow/models/tree/master/research/object_detection    \n4、https://github.com/fizyr/keras-retinanet     \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinklab-sjtu%2Fcsl_retinanet_tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinklab-sjtu%2Fcsl_retinanet_tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinklab-sjtu%2Fcsl_retinanet_tensorflow/lists"}