forked from dingjiansw101/RoITransformer_DOTA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e3122c1
Showing
235 changed files
with
79,896 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# IntelliJ project files | ||
.idea | ||
*.iml | ||
out | ||
gen | ||
|
||
### Vim template | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
*~ | ||
|
||
### IPythonNotebook template | ||
# Temporary data | ||
.ipynb_checkpoints/ | ||
|
||
### Python template | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
#lib/ | ||
#lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
*.ipynb | ||
*.params | ||
*.json | ||
.vscode/ | ||
|
||
lib/dataset/pycocotools/*.c | ||
lib/dataset/pycocotools/*.cpp | ||
lib/nms/*.c | ||
lib/nms/*.cpp | ||
|
||
data | ||
external | ||
output | ||
model | ||
|
||
.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Microsoft | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
This is the official code for [Learning RoI Transformer for Detecting Oriented Objects in Aerial Images](https://arxiv.org/abs/1812.00155) | ||
|
||
This code is based on deformable convolution network | ||
|
||
mmdetection version is on the way | ||
|
||
Since there are custom c++ operators, We need to complie the MXNet source. | ||
|
||
## Requirements: Software | ||
|
||
1. MXNet from [the offical repository](https://github.com/dmlc/mxnet). | ||
|
||
2. Python 2.7. We recommend using Anaconda2 as it already includes many common packages. We do not support Python 3 yet, if you want to use Python 3 you need to modify the code to make it work. | ||
|
||
3. Python packages might missing: cython, opencv-python >= 3.2.0, easydict. If `pip` is set up on your system, those packages should be able to be fetched and installed by running | ||
``` | ||
pip install -r requirements.txt | ||
``` | ||
4. For Windows users, Visual Studio 2015 is needed to compile cython module. | ||
|
||
## Installation | ||
|
||
1. Clone the Deformable ConvNets repository, and we'll call the directory that you cloned Deformable-ConvNets as ${DCN_ROOT}. | ||
``` | ||
git clone https://github.com/msracver/Deformable-ConvNets.git | ||
``` | ||
|
||
2. For Windows users, run ``cmd .\init.bat``. For Linux user, run `sh ./init.sh`. The scripts will build cython module automatically and create some folders. | ||
|
||
3. Install MXNet: | ||
|
||
**Note: The MXNet's Custom Op cannot execute parallelly using multi-gpus after this [PR](https://github.com/apache/incubator-mxnet/pull/6928). We strongly suggest the user rollback to version [MXNet@(commit 998378a)](https://github.com/dmlc/mxnet/tree/998378a) for training (following Section 3.2 - 3.5).** | ||
|
||
***Quick start*** | ||
|
||
3.1 Install MXNet and all dependencies by | ||
``` | ||
pip install -r requirements.txt | ||
``` | ||
If there is no other error message, MXNet should be installed successfully. | ||
|
||
***Build from source (alternative way)*** | ||
|
||
3.2 Clone MXNet and checkout to [MXNet@(commit 998378a)](https://github.com/dmlc/mxnet/tree/998378a) by | ||
``` | ||
git clone --recursive https://github.com/dmlc/mxnet.git | ||
git checkout 998378a | ||
git submodule update | ||
# if it's the first time to checkout, just use: git submodule update --init --recursive | ||
``` | ||
3.3 Copy the c++ operators to MXNet source | ||
``` | ||
cp fpn/operator_cxx/* mxnet/src/operator/contrib | ||
``` | ||
3.3 Compile MXNet | ||
``` | ||
cd ${MXNET_ROOT} | ||
make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 | ||
``` | ||
3.4 Install the MXNet Python (python 2.7) binding by | ||
|
||
***Note: If you will actively switch between different versions of MXNet, please follow 3.5 instead of 3.4*** | ||
``` | ||
cd python | ||
sudo python setup.py install | ||
``` | ||
3.5 For advanced users, you may put your Python packge into `./external/mxnet/$(YOUR_MXNET_PACKAGE)`, and modify `MXNET_VERSION` in `./experiments/rfcn/cfgs/*.yaml` to `$(YOUR_MXNET_PACKAGE)`. Thus you can switch among different versions of MXNet quickly. | ||
|
||
complie dota_kit | ||
|
||
|
||
## Prepare DOTA Data: | ||
|
||
1.prepare script | ||
put your original dota data (before split) in path_to_data | ||
make sure it looks like | ||
path_to_data/train/images, | ||
path_to_data/train/labelTxt, | ||
path_to_data/val/images, | ||
path_to_data/val/labelTxt, | ||
path_to_data/test/images | ||
|
||
cd prepare_data | ||
python prepare_data.py --data_path path_to_data --num_process 32 | ||
|
||
2.soft link | ||
mkdir data | ||
cd data | ||
ln -s path_to_data dota_1024 | ||
|
||
## Pretrained Models | ||
|
||
We provide trained convnet models. | ||
|
||
1. To use the demo with our pre-trained RoI Transformer models for DOTA, please download manually from [Google Drive](https://drive.google.com/drive/folders/1kUBsH2v5DK6QjqDoMmyx16bW7gUlEgn1?usp=sharing), or [BaiduYun](https://pan.baidu.com/s/14KBADK41S5hOO8NQVQlbWA) (Extraction code: fucc) | ||
and put it under the following folder. | ||
Make sure it look like this: | ||
``` | ||
./output/rcnn/DOTA/resnet_v1_101_dota_RoITransformer_trainval_rcnn_end2end/train/rcnn_dota-0040.params | ||
./output/fpn/DOTA/resnet_v1_101_dota_rotbox_light_head_RoITransformer_trainval_fpn_end2end/train/fpn_DOTA_oriented-0008.params | ||
``` | ||
## Training & Testing | ||
1.training | ||
sh train_dota_light_fpn_RoITransformer.sh | ||
|
||
2.testing | ||
sh test_dota_light_fpn_RoITransformer.sh | ||
|
||
--------------------------------------------------- | ||
|
||
© Microsoft, 2017. Licensed under an MIT license. | ||
|
||
|
||
If you find RoI Transformer and DOTA data useful in your research, please consider citing: | ||
``` | ||
@inproceedings{ding2019learning, | ||
title={Learning RoI Transformer for Oriented Object Detection in Aerial Images}, | ||
author={Ding, Jian and Xue, Nan and Long, Yang and Xia, Gui-Song and Lu, Qikai}, | ||
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition}, | ||
pages={2849--2858}, | ||
year={2019} | ||
} | ||
@inproceedings{xia2018dota, | ||
title={DOTA: A large-scale dataset for object detection in aerial images}, | ||
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}, | ||
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition}, | ||
pages={3974--3983}, | ||
year={2018} | ||
} | ||
``` | ||
|
Oops, something went wrong.