Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This is the repo of **PointOBB-v2: Towards Simpler, Faster, and Stronger Single Point Supervised Oriented Object Detection**
|
| 2 |
+
|
| 3 |
+
![pipeline]()
|
| 4 |
+
|
| 5 |
+
### Installation
|
| 6 |
+
|
| 7 |
+
Please refer to the [Installation](https://github.com/open-mmlab/mmrotate/blob/main/README.md), we copy it here.
|
| 8 |
+
|
| 9 |
+
```
|
| 10 |
+
conda create -n open-mmlab python=3.7 pytorch==1.7.0 cudatoolkit=10.1 torchvision -c pytorch -y
|
| 11 |
+
conda activate open-mmlab
|
| 12 |
+
pip install openmim
|
| 13 |
+
mim install mmcv-full
|
| 14 |
+
mim install mmdet
|
| 15 |
+
git clone https://github.com/taugeren/PointOBB-v2.git
|
| 16 |
+
cd mmrotate
|
| 17 |
+
pip install -r requirements/build.txt
|
| 18 |
+
pip install -v -e .
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
### Data Preparation
|
| 22 |
+
|
| 23 |
+
Please follow [data_preparation](https://github.com/taugeren/PointOBB-v2/tree/main/tools/data) to prepare formatting data
|
| 24 |
+
|
| 25 |
+
### Train CPM
|
| 26 |
+
|
| 27 |
+
If you want to visualize CPM result during training, please set **visualize=True** in **train_config**
|
| 28 |
+
|
| 29 |
+
Please modified the config code that contains the **visualize directory path**
|
| 30 |
+
|
| 31 |
+
The learning rate for **n GPU card** and **batch size m** is 0.0125 * n * m
|
| 32 |
+
|
| 33 |
+
For single GPU
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
# Basic format: python tools/train.py ${CONFIG_FILE} [optional arguments]
|
| 37 |
+
python tools/train.py configs/pointobbv2/train_cpm_dotav10.py --work-dir work_dirs/cpm_dotav10 --gpu-ids 0
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
For multiple GPU
|
| 41 |
+
|
| 42 |
+
```
|
| 43 |
+
# Basic format: ./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM} [optional arguments]
|
| 44 |
+
CUDA_VISIBLE_DEVICES=0,1 PORT=29801 ./tools/dist_train.sh configs/pointobbv2/train_cpm_dotav10.py 2
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
### Generate Pseudo Label
|
| 48 |
+
|
| 49 |
+
Please modified the config code that contains the **directory path**
|
| 50 |
+
|
| 51 |
+
For single GPU
|
| 52 |
+
|
| 53 |
+
```
|
| 54 |
+
# Basic fromat: python tools/train.py ${CONFIG_FILE} --resume-from ${CPM_CHECKPOINT_FILE} [other arguments]
|
| 55 |
+
python tools/train.py configs/pointobbv2/generate_pseudo_label_dotav10.py --resume-from work_dirs/cpm_dotav10/epoch_6.pth --work-dir work_dirs/cpm_dotav10 --gpu-ids 0
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
For multiple GPU
|
| 59 |
+
|
| 60 |
+
```
|
| 61 |
+
# Basic format: ./tools/dist_train_resume.sh ${CONFIG_FILE} ${CPM_CHECKPOINT_FILE} ${GPU_NUM} [optional arguments]
|
| 62 |
+
CUDA_VISIBLE_DEVICES=0,1 PORT=29801 ./tools/dist_train_resume.sh /ssd1/renbotao/github_submission/mmrotate/configs/pointobbv2/generate_pseudo_label_dotav10.py work_dirs/cpm_dotav10/epoch_6.pth 2
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
### Train Detector
|
| 66 |
+
|
| 67 |
+
You can use different oriented object detection detector in [MMRotate Config](https://github.com/open-mmlab/mmrotate/tree/main/configs)
|
| 68 |
+
|
| 69 |
+
Please modify the **pseudo label path** in config file
|
| 70 |
+
|
| 71 |
+
For example, using Redet, the training command:
|
| 72 |
+
|
| 73 |
+
```
|
| 74 |
+
# single GPU
|
| 75 |
+
python tools/train.py configs/pointobbv2/redet_dotav10.py --work-dir work_dirs/cpm_dotav10 --gpu-ids 0
|
| 76 |
+
|
| 77 |
+
# multiple GPU
|
| 78 |
+
CUDA_VISIBLE_DEVICES=0,1 PORT=29801 ./tools/dist_train.sh configs/pointobbv2/redet_dotav10.py 2
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
the testing command:
|
| 82 |
+
|
| 83 |
+
```
|
| 84 |
+
# single GPU
|
| 85 |
+
python tools/test.py work_dirs/redet_dotav10/redet_dotav10.py work_dirs/redet_dotav10/epoch_12.pth --gpu-ids 0 --format-only --eval-options submission_dir=testmodel/redet_dotav10_epoch12
|
| 86 |
+
|
| 87 |
+
# multiple GPU
|
| 88 |
+
CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29816 tools/dist_test1.sh work_dirs/redet_dotav10/redet_dotav10.py work_dirs/redet_dotav10/epoch_12.pth 4
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
### Our log and checkpoint
|
| 92 |
+
|
| 93 |
+
| Dataset | Config | Log | Checkpoint |
|
| 94 |
+
| :-------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :---------------------------: |
|
| 95 |
+
| DOTA-v1.0 | [config](https://github.com/taugeren/PointOBB-v2/tree/main/configs/pointobbv2) | [quark](https://pan.quark.cn/s/72c9fb568db8) [hugging face]() | [quark]() [hugging face]() |
|
| 96 |
+
| DOTA-v1.5 | [config](https://github.com/taugeren/PointOBB-v2/tree/main/configs/pointobbv2) | [quark]() [hugging face]() | [quark]() [hugging face]() |
|
| 97 |
+
| DOTA-v2.0 | [config](https://github.com/taugeren/PointOBB-v2/tree/main/configs/pointobbv2) | [quark]() [hugging face]() | [quark]() [hugging face]() |
|
| 98 |
+
|