Coder Social home page Coder Social logo

l-fraust / nwd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jwwangchn/nwd

0.0 0.0 0.0 11.57 MB

Official code for "A Normalized Gaussian Wasserstein Distance for Tiny Object Detection"

License: Apache License 2.0

Shell 1.31% Python 98.63% Dockerfile 0.06%

nwd's Introduction

A Normalized Gaussian Wasserstein Distance for Tiny Object Detection

This is the official code for the NWD. The expanded method is accepted by the ISPRS J P & RS in 2022.

Installation

Requirements

  • Linux
  • Python 3.7 (Python 2 is not supported)
  • PyTorch 1.5 or higher
  • CUDA 10.1 or higher
  • NCCL 2
  • GCC(G++) 5.4 or higher
  • mmcv-nwd==1.3.5
  • cocoapi-aitod==12.0.3

We have tested the following versions of OS and softwares:

  • OS: Ubuntu 16.04
  • GPU: TITAN X
  • CUDA: 10.1
  • GCC(G++): 5.5.0
  • PyTorch: 1.5.0+cu101
  • TorchVision: 0.6.0+cu101
  • MMCV: 1.3.5
  • MMDetection: 2.13.0

Install

a. Create a conda virtual environment and activate it.

conda create -n nwd python=3.7 -y
conda activate nwd

b. Install PyTorch stable or nightly and torchvision following the official instructions, e.g.,

pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

c. Install MMCV-NWD

git clone https://github.com/jwwangchn/mmcv-nwd.git
cd mmcv-nwd
MMCV_WITH_OPS=1 pip install -e .  # package mmcv-full will be installed after this step
cd ../

d. Install COCOAPI-AITOD for Evaluating on AI-TOD dataset

pip install "git+https://github.com/jwwangchn/cocoapi-aitod.git#subdirectory=aitodpycocotools"

e. Install NWD

git clone https://github.com/jwwangchn/NWD.git
# optional
pip install -r requirements.txt

python setup.py develop
# or "pip install -v -e ."

Prepare datasets

Please refer to AI-TOD for AI-TOD dataset.

It is recommended to symlink the dataset root to $NWD/data. If your folder structure is different, you may need to change the corresponding paths in config files (configs/base/datasets/aitod_detection.py).

NWD
├── mmdet
├── tools
├── configs
├── data
│   ├── AI-TOD
│   │   ├── annotations
│   │   │    │─── aitod_training_v1.json
│   │   │    │─── aitod_validation_v1.json
│   │   ├── trainval
│   │   │    │─── ***.png
│   │   │    │─── ***.png
│   │   ├── test
│   │   │    │─── ***.png
│   │   │    │─── ***.png

Run

The NWD's config files are in configs/nwd.

Please see MMDetection full tutorials with existing dataset for beginners.

Training on a single GPU

The basic usage is as follows (e.g. train Faster R-CNN with NWD). Note that the lr=0.01 in config file needs to be lr=0.01/4 for training on single GPU.

python tools/train.py configs/nwd/faster_rcnn_r50_aitod_rpn_nwd.py

Training on multiple GPUs

The basic usage is as follows (e.g. train Faster R-CNN with NWD).

bash ./tools/dist_train.sh configs/nwd/faster_rcnn_r50_aitod_rpn_nwd.py 4

Inference

Benchmark

The benchmark and trained models will be publicly available soon.

Citation

@inproceedings{AI-TOD_2020_ICPR,
    title={Tiny Object Detection in Aerial Images},
    author={Wang, Jinwang and Yang, Wen and Guo, Haowen and Zhang, Ruixiang and Xia, Gui-Song},
    booktitle=ICPR,
    pages={3791--3798},
    year={2021},
}
@article{NWD_2021_arXiv,
    title={A Normalized Gaussian Wasserstein Distance for Tiny Object Detection},
    author={Wang, Jinwang and Xu, Chang and Yang, Wen and Yu, Lei},
    journal={arXiv preprint arXiv:2110.13389},
    year={2021}
}
@article{NWD_RKA_2022_ISPRSJ,
    title={Detecting Tiny Objects in Aerial Images: A Normalized Wasserstein Distance and A New Benchmark},
    author={Xu, Chang and Wang, Jinwang and and Yang, Wen and Yu, Huai and Yu, Lei and Xia, Gui-Song},
    journal={ISPRS Journal of Photogrammetry and Remote Sensing (ISPRS J P & RS)},
    year={2022}
}

nwd's People

Contributors

jwwangchn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.