Skip to content

Commit 26ea79b

Browse files
authored
fix some bugs and polish docs (#6755)
* fix some bugs and polish docs * polish docs * modify docs, test=document_fix * modify docs, test=document_fix
1 parent cb98264 commit 26ea79b

File tree

8 files changed

+136
-88
lines changed

8 files changed

+136
-88
lines changed

configs/rotate/README.md

+30-9
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515

1616
| 模型 | mAP | 学习率策略 | 角度表示 | 数据增广 | GPU数目 | 每GPU图片数目 | 模型下载 | 配置文件 |
1717
|:---:|:----:|:---------:|:-----:|:--------:|:-----:|:------------:|:-------:|:------:|
18-
| [S2ANet](./s2anet/README.md) | 74.0 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/dota/s2anet_alignconv_2x_dota.yml) |
18+
| [S2ANet](./s2anet/README.md) | 73.84 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml) |
1919

2020
**注意:**
2121

2222
- 如果**GPU卡数**或者**batch size**发生了改变,你需要按照公式 **lr<sub>new</sub> = lr<sub>default</sub> * (batch_size<sub>new</sub> * GPU_number<sub>new</sub>) / (batch_size<sub>default</sub> * GPU_number<sub>default</sub>)** 调整学习率。
23+
- 模型库中的模型默认使用单尺度训练单尺度测试。如果数据增广一栏标明MS,意味着使用多尺度训练和多尺度测试。如果数据增广一栏标明RR,意味着使用RandomRotate数据增广进行训练。
2324

2425
## 数据准备
2526
### DOTA数据准备
@@ -36,35 +37,55 @@ ${DOTA_ROOT}
3637
└── labelTxt
3738
```
3839

39-
DOTA数据集分辨率较高,因此一般在训练和测试之前对图像进行切图,使用单尺度进行切图可以使用以下命令
40+
对于有标注的数据,每一张图片会对应一个同名的txt文件,文件中每一行为一个旋转框的标注,其格式如下
4041
```
42+
x1 y1 x2 y2 x3 y3 x4 y4 class_name difficult
43+
```
44+
45+
### 单尺度切图
46+
DOTA数据集分辨率较高,因此一般在训练和测试之前对图像进行离线切图,使用单尺度进行切图可以使用以下命令:
47+
``` bash
48+
# 对于有标注的数据进行切图
4149
python configs/rotate/tools/prepare_data.py \
4250
--input_dirs ${DOTA_ROOT}/train/ ${DOTA_ROOT}/val/ \
4351
--output_dir ${OUTPUT_DIR}/trainval1024/ \
4452
--coco_json_file DOTA_trainval1024.json \
4553
--subsize 1024 \
4654
--gap 200 \
4755
--rates 1.0
56+
57+
# 对于无标注的数据进行切图需要设置--image_only
58+
python configs/rotate/tools/prepare_data.py \
59+
--input_dirs ${DOTA_ROOT}/test/ \
60+
--output_dir ${OUTPUT_DIR}/test1024/ \
61+
--coco_json_file DOTA_test1024.json \
62+
--subsize 1024 \
63+
--gap 200 \
64+
--rates 1.0 \
65+
--image_only
66+
4867
```
68+
69+
### 多尺度切图
4970
使用多尺度进行切图可以使用以下命令:
50-
```
71+
``` bash
72+
# 对于有标注的数据进行切图
5173
python configs/rotate/tools/prepare_data.py \
5274
--input_dirs ${DOTA_ROOT}/train/ ${DOTA_ROOT}/val/ \
5375
--output_dir ${OUTPUT_DIR}/trainval/ \
5476
--coco_json_file DOTA_trainval1024.json \
5577
--subsize 1024 \
5678
--gap 500 \
57-
--rates 0.5 1.0 1.5 \
58-
```
59-
对于无标注的数据可以设置`--image_only`进行切图,如下所示:
60-
```
79+
--rates 0.5 1.0 1.5
80+
81+
# 对于无标注的数据进行切图需要设置--image_only
6182
python configs/rotate/tools/prepare_data.py \
6283
--input_dirs ${DOTA_ROOT}/test/ \
6384
--output_dir ${OUTPUT_DIR}/test1024/ \
6485
--coco_json_file DOTA_test1024.json \
6586
--subsize 1024 \
66-
--gap 200 \
67-
--rates 1.0 \
87+
--gap 500 \
88+
--rates 0.5 1.0 1.5 \
6889
--image_only
6990
```
7091

configs/rotate/README_en.md

+29-9
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Rotated object detection is used to detect rectangular bounding boxes with angle
1414
## Model Zoo
1515
| Model | mAP | Lr Scheduler | Angle | Aug | GPU Number | images/GPU | download | config |
1616
|:---:|:----:|:---------:|:-----:|:--------:|:-----:|:------------:|:-------:|:------:|
17-
| [S2ANet](./s2anet/README.md) | 74.0 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/dota/s2anet_alignconv_2x_dota.yml) |
17+
| [S2ANet](./s2anet/README_en.md) | 73.84 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml) |
1818

1919
**Notes:**
2020

2121
- if **GPU number** or **mini-batch size** is changed, **learning rate** should be adjusted according to the formula **lr<sub>new</sub> = lr<sub>default</sub> * (batch_size<sub>new</sub> * GPU_number<sub>new</sub>) / (batch_size<sub>default</sub> * GPU_number<sub>default</sub>)**.
22+
- Models in model zoo is trained and tested with single scale by default. If `MS` is indicated in the data augmentation column, it means that multi-scale training and multi-scale testing are used. If `RR` is indicated in the data augmentation column, it means that RandomRotate data augmentation is used for training.
2223

2324
## Data Preparation
2425
### DOTA Dataset preparation
@@ -35,35 +36,54 @@ ${DOTA_ROOT}
3536
└── labelTxt
3637
```
3738

38-
The image resolution of DOTA dataset is relatively high, so we usually slice the images before training and testing. To slice the images with a single scale, you can use the command below
39+
For labeled data, each image corresponds to a txt file with the same name, and each row in the txt file represent a rotated bouding box. The format is as follows:
40+
41+
```
42+
x1 y1 x2 y2 x3 y3 x4 y4 class_name difficult
3943
```
44+
45+
### Slicing data with single scale
46+
The image resolution of DOTA dataset is relatively high, so we usually slice the images before training and testing. To slice the images with a single scale, you can use the command below
47+
``` bash
48+
# slicing labeled data
4049
python configs/rotate/tools/prepare_data.py \
4150
--input_dirs ${DOTA_ROOT}/train/ ${DOTA_ROOT}/val/ \
4251
--output_dir ${OUTPUT_DIR}/trainval1024/ \
4352
--coco_json_file DOTA_trainval1024.json \
4453
--subsize 1024 \
4554
--gap 200 \
4655
--rates 1.0
56+
# slicing unlabeled data by setting --image_only
57+
python configs/rotate/tools/prepare_data.py \
58+
--input_dirs ${DOTA_ROOT}/test/ \
59+
--output_dir ${OUTPUT_DIR}/test1024/ \
60+
--coco_json_file DOTA_test1024.json \
61+
--subsize 1024 \
62+
--gap 200 \
63+
--rates 1.0 \
64+
--image_only
65+
4766
```
67+
68+
### Slicing data with multi scale
4869
To slice the images with multiple scales, you can use the command below
49-
```
70+
``` bash
71+
# slicing labeled data
5072
python configs/rotate/tools/prepare_data.py \
5173
--input_dirs ${DOTA_ROOT}/train/ ${DOTA_ROOT}/val/ \
5274
--output_dir ${OUTPUT_DIR}/trainval/ \
5375
--coco_json_file DOTA_trainval1024.json \
5476
--subsize 1024 \
5577
--gap 500 \
56-
--rates 0.5 1.0 1.5 \
57-
```
58-
For data without annotations, you should set `--image_only` as follows
59-
```
78+
--rates 0.5 1.0 1.5
79+
# slicing unlabeled data by setting --image_only
6080
python configs/rotate/tools/prepare_data.py \
6181
--input_dirs ${DOTA_ROOT}/test/ \
6282
--output_dir ${OUTPUT_DIR}/test1024/ \
6383
--coco_json_file DOTA_test1024.json \
6484
--subsize 1024 \
65-
--gap 200 \
66-
--rates 1.0 \
85+
--gap 500 \
86+
--rates 0.5 1.0 1.5 \
6787
--image_only
6888
```
6989

configs/rotate/s2anet/README.md

+32-24
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
1-
# S2ANet模型
1+
简体中文 | [English](README_en.md)
2+
3+
# S2ANet
24

35
## 内容
46
- [简介](#简介)
5-
- [开始训练](#开始训练)
67
- [模型库](#模型库)
8+
- [使用说明](#使用说明)
79
- [预测部署](#预测部署)
10+
- [引用](#引用)
811

912
## 简介
1013

11-
[S2ANet](https://arxiv.org/pdf/2008.09397.pdf)是用于检测旋转框的模型,在DOTA 1.0数据集上单尺度训练能达到74.0的mAP.
14+
[S2ANet](https://arxiv.org/pdf/2008.09397.pdf)是用于检测旋转框的模型.
15+
16+
## 模型库
17+
18+
| 模型 | Conv类型 | mAP | 学习率策略 | 角度表示 | 数据增广 | GPU数目 | 每GPU图片数目 | 模型下载 | 配置文件 |
19+
|:---:|:------:|:----:|:---------:|:-----:|:--------:|:-----:|:------------:|:-------:|:------:|
20+
| S2ANet | Conv | 71.45 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_conv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_conv_2x_dota.yml) |
21+
| S2ANet | AlignConv | 73.84 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml) |
22+
23+
**注意:**
24+
25+
- 如果**GPU卡数**或者**batch size**发生了改变,你需要按照公式 **lr<sub>new</sub> = lr<sub>default</sub> * (batch_size<sub>new</sub> * GPU_number<sub>new</sub>) / (batch_size<sub>default</sub> * GPU_number<sub>default</sub>)** 调整学习率。
26+
- 模型库中的模型默认使用单尺度训练单尺度测试。如果数据增广一栏标明MS,意味着使用多尺度训练和多尺度测试。如果数据增广一栏标明RR,意味着使用RandomRotate数据增广进行训练。
27+
- 这里使用`multiclass_nms`,与原作者使用nms略有不同。
28+
29+
30+
## 使用说明
1231

13-
## 开始训练
32+
参考[数据准备](../README.md#数据准备)准备数据。
1433

1534
### 1. 训练
1635

@@ -22,21 +41,21 @@ python tools/train.py -c configs/rotate/s2anet/s2anet_1x_spine.yml
2241

2342
GPU多卡训练
2443
```bash
25-
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
26-
python -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/rotate/s2anet/s2anet_1x_spine.yml
44+
export CUDA_VISIBLE_DEVICES=0,1,2,3
45+
python -m paddle.distributed.launch --gpus 0,1,2,3 tools/train.py -c configs/rotate/s2anet/s2anet_1x_spine.yml
2746
```
2847

2948
可以通过`--eval`开启边训练边测试。
3049

31-
### 3. 评估
50+
### 2. 评估
3251
```bash
3352
python tools/eval.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=output/s2anet_1x_spine/model_final.pdparams
3453

3554
# 使用提供训练好的模型评估
3655
python tools/eval.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=https://paddledet.bj.bcebos.com/models/s2anet_1x_spine.pdparams
3756
```
3857

39-
### 4. 预测
58+
### 3. 预测
4059
执行如下命令,会将图像预测结果保存到`output`文件夹下。
4160
```bash
4261
python tools/infer.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=output/s2anet_1x_spine/model_final.pdparams --infer_img=demo/39006.jpg --draw_threshold=0.3
@@ -46,37 +65,26 @@ python tools/infer.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=ou
4665
python tools/infer.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=https://paddledet.bj.bcebos.com/models/s2anet_1x_spine.pdparams --infer_img=demo/39006.jpg --draw_threshold=0.3
4766
```
4867

49-
### 5. DOTA数据评估
68+
### 4. DOTA数据评估
5069
执行如下命令,会在`output`文件夹下将每个图像预测结果保存到同文件夹名的txt文本中。
5170
```
52-
python tools/infer.py -c configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml -o weights=./weights/s2anet_alignconv_2x_dota.pdparams --infer_dir=/path/to/test/images --output_dir=output --visualize=False --save_results=True
71+
python tools/infer.py -c configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml -o weights=https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams --infer_dir=/path/to/test/images --output_dir=output --visualize=False --save_results=True
5372
```
5473
参考[DOTA Task](https://captain-whu.github.io/DOTA/tasks.html), 评估DOTA数据集需要生成一个包含所有检测结果的zip文件,每一类的检测结果储存在一个txt文件中,txt文件中每行格式为:`image_name score x1 y1 x2 y2 x3 y3 x4 y4`。将生成的zip文件提交到[DOTA Evaluation](https://captain-whu.github.io/DOTA/evaluation.html)的Task1进行评估。你可以执行以下命令生成评估文件
5574
```
5675
python configs/rotate/tools/generate_result.py --pred_txt_dir=output/ --output_dir=submit/ --data_type=dota10
76+
5777
zip -r submit.zip submit
5878
```
5979

60-
## 模型库
61-
62-
### S2ANet模型
63-
64-
| 模型 | Conv类型 | mAP | 模型下载 | 配置文件 |
65-
|:-----------:|:----------:|:--------:| :----------:| :---------: |
66-
| S2ANet | Conv | 71.42 | [model](https://paddledet.bj.bcebos.com/models/s2anet_conv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_conv_2x_dota.yml) |
67-
| S2ANet | AlignConv | 74.0 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml) |
68-
69-
**注意:** 这里使用`multiclass_nms`,与原作者使用nms略有不同。
70-
71-
7280
## 预测部署
7381

7482
Paddle中`multiclass_nms`算子的输入支持四边形输入,因此部署时可以不需要依赖旋转框IOU计算算子。
7583

76-
部署教程请参考[预测部署](../../deploy/README.md)
84+
部署教程请参考[预测部署](../../../deploy/README.md)
7785

7886

79-
## Citations
87+
## 引用
8088
```
8189
@article{han2021align,
8290
author={J. {Han} and J. {Ding} and J. {Li} and G. -S. {Xia}},

configs/rotate/s2anet/README_en.md

+33-36
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
# S2ANet Model
1+
English | [简体中文](README.md)
2+
3+
# S2ANet
24

35
## Content
4-
- [S2ANet Model](#s2anet-model)
5-
- [Content](#content)
6-
- [Introduction](#introduction)
7-
- [Start Training](#start-training)
8-
- [1. Train](#1-train)
9-
- [2. Evaluation](#2-evaluation)
10-
- [3. Prediction](#3-prediction)
11-
- [4. DOTA Data evaluation](#4-dota-data-evaluation)
12-
- [Model Library](#model-library)
13-
- [S2ANet Model](#s2anet-model-1)
14-
- [Predict Deployment](#predict-deployment)
15-
- [Citations](#citations)
6+
- [Introduction](#Introduction)
7+
- [Model Zoo](#Model-Zoo)
8+
- [Getting Start](#Getting-Start)
9+
- [Deployment](#Deployment)
10+
- [Citations](#Citations)
1611

1712
## Introduction
1813

19-
[S2ANet](https://arxiv.org/pdf/2008.09397.pdf) is used to detect rotated objects and acheives 74.0 mAP on DOTA 1.0 dataset.
14+
[S2ANet](https://arxiv.org/pdf/2008.09397.pdf) is used to detect rotated objects.
15+
16+
## Model Zoo
17+
| Model | Conv Type | mAP | Lr Scheduler | Angle | Aug | GPU Number | images/GPU | download | config |
18+
|:---:|:------:|:----:|:---------:|:-----:|:--------:|:-----:|:------------:|:-------:|:------:|
19+
| S2ANet | Conv | 71.45 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_conv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_conv_2x_dota.yml) |
20+
| S2ANet | AlignConv | 73.84 | 2x | le135 | - | 4 | 2 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml) |
21+
22+
**Notes:**
23+
- if **GPU number** or **mini-batch size** is changed, **learning rate** should be adjusted according to the formula **lr<sub>new</sub> = lr<sub>default</sub> * (batch_size<sub>new</sub> * GPU_number<sub>new</sub>) / (batch_size<sub>default</sub> * GPU_number<sub>default</sub>)**.
24+
- Models in model zoo is trained and tested with single scale by default. If `MS` is indicated in the data augmentation column, it means that multi-scale training and multi-scale testing are used. If `RR` is indicated in the data augmentation column, it means that RandomRotate data augmentation is used for training.
25+
- `multiclass_nms` is used here, which is slightly different from the original author's use of NMS.
2026

21-
## Start Training
27+
## Getting Start
2228

23-
### 2. Train
29+
Refer to [Data-Preparation](../README_en.md#Data-Preparation) to prepare data.
30+
31+
### 1. Train
2432

2533
Single GPU Training
2634
```bash
@@ -30,21 +38,21 @@ python tools/train.py -c configs/rotate/s2anet/s2anet_1x_spine.yml
3038

3139
Multiple GPUs Training
3240
```bash
33-
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
34-
python -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/rotate/s2anet/s2anet_1x_spine.yml
41+
export CUDA_VISIBLE_DEVICES=0,1,2,3
42+
python -m paddle.distributed.launch --gpus 0,1,2,3 tools/train.py -c configs/rotate/s2anet/s2anet_1x_spine.yml
3543
```
3644

3745
You can use `--eval`to enable train-by-test.
3846

39-
### 3. Evaluation
47+
### 2. Evaluation
4048
```bash
4149
python tools/eval.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=output/s2anet_1x_spine/model_final.pdparams
4250

4351
# Use a trained model to evaluate
4452
python tools/eval.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=https://paddledet.bj.bcebos.com/models/s2anet_1x_spine.pdparams
4553
```
4654

47-
### 4. Prediction
55+
### 3. Prediction
4856
Executing the following command will save the image prediction results to the `output` folder.
4957
```bash
5058
python tools/infer.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=output/s2anet_1x_spine/model_final.pdparams --infer_img=demo/39006.jpg --draw_threshold=0.3
@@ -54,35 +62,24 @@ Prediction using models that provide training:
5462
python tools/infer.py -c configs/rotate/s2anet/s2anet_1x_spine.yml -o weights=https://paddledet.bj.bcebos.com/models/s2anet_1x_spine.pdparams --infer_img=demo/39006.jpg --draw_threshold=0.3
5563
```
5664

57-
### 5. DOTA Data evaluation
65+
### 4. DOTA Data evaluation
5866
Execute the following command, will save each image prediction result in `output` folder txt text with the same folder name.
5967
```
60-
python tools/infer.py -c configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml -o weights=./weights/s2anet_alignconv_2x_dota.pdparams --infer_dir=/path/to/test/images --output_dir=output --visualize=False --save_results=True
68+
python tools/infer.py -c configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml -o weights=https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams --infer_dir=/path/to/test/images --output_dir=output --visualize=False --save_results=True
6169
```
6270
Refering to [DOTA Task](https://captain-whu.github.io/DOTA/tasks.html), You need to submit a zip file containing results for all test images for evaluation. The detection results of each category are stored in a txt file, each line of which is in the following format
6371
`image_id score x1 y1 x2 y2 x3 y3 x4 y4`. To evaluate, you should submit the generated zip file to the Task1 of [DOTA Evaluation](https://captain-whu.github.io/DOTA/evaluation.html). You can execute the following command to generate the file
6472
```
6573
python configs/rotate/tools/generate_result.py --pred_txt_dir=output/ --output_dir=submit/ --data_type=dota10
74+
6675
zip -r submit.zip submit
6776
```
6877

69-
## Model Library
70-
71-
### S2ANet Model
72-
73-
| Model | Conv Type | mAP | Model Download | Configuration File |
74-
|:-----------:|:----------:|:--------:| :----------:| :---------: |
75-
| S2ANet | Conv | 71.42 | [model](https://paddledet.bj.bcebos.com/models/s2anet_conv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_conv_2x_dota.yml) |
76-
| S2ANet | AlignConv | 74.0 | [model](https://paddledet.bj.bcebos.com/models/s2anet_alignconv_2x_dota.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/rotate/s2anet/s2anet_alignconv_2x_dota.yml) |
77-
78-
**Attention:** `multiclass_nms` is used here, which is slightly different from the original author's use of NMS.
79-
80-
81-
## Predict Deployment
78+
## Deployment
8279

8380
The inputs of the `multiclass_nms` operator in Paddle support quadrilateral inputs, so deployment can be done without relying on the rotating frame IOU operator.
8481

85-
Please refer to the deployment tutorial[Predict deployment](../../deploy/README_en.md)
82+
Please refer to the deployment tutorial[Predict deployment](../../../deploy/README_en.md)
8683

8784

8885
## Citations

configs/rotate/tools/slicebase.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ def slice_data_single(self, info, rate, output_dir):
222222
windows = self.get_windows(height, width)
223223
self.slice_image_single(resize_img, windows, output_dir, base_name)
224224
if not self.image_only:
225-
self.slice_anno_single(info['annotation'], windows, output_dir,
226-
base_name)
225+
annos = info['annotation']
226+
for anno in annos:
227+
anno['poly'] = list(map(lambda x: rate * x, anno['poly']))
228+
self.slice_anno_single(annos, windows, output_dir, base_name)
227229

228230
def check_or_mkdirs(self, path):
229231
if not os.path.exists(path):

0 commit comments

Comments
 (0)