You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: This project has been involved into OpenMMLab's new repo PlayGround. For more details, please refer to this.
Recently, SAM has demonstrated strong zero-shot capabilities by training on the largest segmentation dataset to date. Thus, we use a trained horizontal FCOS detector to provide HBoxes into SAM as prompts, so that corresponding Masks can be generated by zero-shot, and finally the rotated RBoxes are obtained by performing the minimum circumscribed rectangle operation on the predicted Masks. Thanks to the powerful zero-shot capability, SAM-RBox based on ViT-B has achieved 63.94%. However, it is also limited to the time-consuming post-processing, only 1.7 FPS during inference.
Prepare Env
The code is based on MMRotate 1.x and official API of SAM.
Here is the installation commands of recommended environment.
Download the detector weight from MMRotate model zoo.
python main_sam_dota.py prompts SAM with HBox obtained from annotation file (such as DOTA trainval).
python main_rdet-sam_dota.py prompts SAM with HBox predicted by a well-trained detector for non-annotated data (such as DOTA test).
Many configs, including pipeline (i.e. transforms), dataset, dataloader, evaluator, visualizer, are set in data.py.
You can change the detector config and the corresponding weight path in main_rdet-sam_dota.py to any detector that can be built with MMRotate.
Citation
@article{yu2023h2rboxv2,
title={H2RBox-v2: Boosting HBox-supervised Oriented Object Detection via Symmetric Learning},
author={Yu, Yi and Yang, Xue and Li, Qingyun and Zhou, Yue and Zhang, Gefan and Yan, Junchi and Da, Feipeng},
journal={arXiv preprint arXiv:2304.04403},
year={2023}
}
@inproceedings{yang2023h2rbox,
title={H2RBox: Horizontal Box Annotation is All You Need for Oriented Object Detection},
author={Yang, Xue and Zhang, Gefan and Li, Wentong and Wang, Xuehui and Zhou, Yue and Yan, Junchi},
booktitle={International Conference on Learning Representations},
year={2023}
}
@article{kirillov2023segany,
title={Segment Anything},
author={Kirillov, Alexander and Mintun, Eric and Ravi, Nikhila and Mao, Hanzi and Rolland, Chloe and Gustafson, Laura and Xiao, Tete and Whitehead, Spencer and Berg, Alexander C. and Lo, Wan-Yen and Doll{\'a}r, Piotr and Girshick, Ross},
journal={arXiv:2304.02643},
year={2023}
}