File size: 3,994 Bytes
c24037e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
This is the repo of **PointOBB-v2: Towards Simpler, Faster, and Stronger Single Point Supervised Oriented Object Detection**

![pipeline]()

### Installation

Please refer to the [Installation](https://github.com/open-mmlab/mmrotate/blob/main/README.md), we copy it here.

```
conda create -n open-mmlab python=3.7 pytorch==1.7.0 cudatoolkit=10.1 torchvision -c pytorch -y
conda activate open-mmlab
pip install openmim
mim install mmcv-full
mim install mmdet
git clone https://github.com/taugeren/PointOBB-v2.git
cd mmrotate
pip install -r requirements/build.txt
pip install -v -e .
```

### Data Preparation

Please follow [data_preparation](https://github.com/taugeren/PointOBB-v2/tree/main/tools/data) to prepare formatting data

### Train CPM

If you want to visualize CPM result during training, please set **visualize=True** in **train_config**

Please modified the config code that contains the **visualize directory path**

The learning rate for **n GPU card** and **batch size m** is 0.0125 * n * m

For single GPU

```
# Basic format: python tools/train.py ${CONFIG_FILE} [optional arguments]
python tools/train.py configs/pointobbv2/train_cpm_dotav10.py --work-dir work_dirs/cpm_dotav10 --gpu-ids 0
```

For multiple GPU

```
# Basic format: ./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM} [optional arguments]
CUDA_VISIBLE_DEVICES=0,1 PORT=29801 ./tools/dist_train.sh configs/pointobbv2/train_cpm_dotav10.py 2
```

### Generate Pseudo Label

Please modified the config code that contains the **directory path**

For single GPU

```
# Basic fromat: python tools/train.py ${CONFIG_FILE} --resume-from ${CPM_CHECKPOINT_FILE} [other arguments]
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
```

For multiple GPU

```
# Basic format: ./tools/dist_train_resume.sh ${CONFIG_FILE} ${CPM_CHECKPOINT_FILE} ${GPU_NUM} [optional arguments]
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
```

### Train Detector

You can use different oriented object detection detector in [MMRotate Config](https://github.com/open-mmlab/mmrotate/tree/main/configs)

Please modify the **pseudo label path** in config file

For example, using Redet, the training command:

```
# single GPU
python tools/train.py configs/pointobbv2/redet_dotav10.py --work-dir work_dirs/cpm_dotav10 --gpu-ids 0

# multiple GPU
CUDA_VISIBLE_DEVICES=0,1 PORT=29801 ./tools/dist_train.sh configs/pointobbv2/redet_dotav10.py 2
```

the testing command:

```
# single GPU
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

# multiple GPU
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
```

### Our log and checkpoint

|  Dataset  |                            Config                            |                             Log                              |          Checkpoint           |
| :-------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :---------------------------: |
| 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]() |
| DOTA-v1.5 | [config](https://github.com/taugeren/PointOBB-v2/tree/main/configs/pointobbv2) |                [quark]()    [hugging face]()                 | [quark]()    [hugging face]() |
| DOTA-v2.0 | [config](https://github.com/taugeren/PointOBB-v2/tree/main/configs/pointobbv2) |                [quark]()    [hugging face]()                 | [quark]()    [hugging face]() |