GithubHelp home page GithubHelp logo

ymfiubyf / pancollection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiaoxiao-woo/pancollection

0.0 0.0 0.0 1.07 MB

"PanCollection" for Remote Sensing Pansharpening

License: GNU General Public License v3.0

Shell 0.03% C++ 25.65% Python 60.87% C 0.08% CSS 0.01% Cuda 13.29% Makefile 0.03% Batchfile 0.04% Dockerfile 0.01%

pancollection's Introduction

PanCollection

"PanCollection" for Remote Sensing Pansharpening

English | 简体中文

This repository is the official PyTorch implementation of “基于卷积神经网络的遥感图像全色锐化进展综述及相关数据集发布” (paper, homepage).

  • Release the PanCollection of the pan-sharpening training-test dataset of related satellites (such as WorldView-3, QuickBird, GaoFen2, WorldView-2 satellites);
  • Release the Python code based on the unified Pytorch framework , which is convenient for later scholars;
  • Release a unified Pansharpening traditional-deep learning method (including MATLAB test software package), which is convenient for later scholars to conduct fair tests.

See the repo for more detailed descriptions.

Features

Requirements

  • Python3.7+, Pytorch>=1.6.0
  • NVIDIA GPU + CUDA
  • Run python setup.py develop

Note: Our project is based on MMCV, but you needn't to install it currently.

Quick Start

Step0. set your Python environment.

git clone https://github.com/XiaoXiao-Woo/PanCollection

Then,

python setup.py develop

Step1.

  • Download datasets (WorldView-3, QuickBird, GaoFen2, WorldView2) from the homepage. Put it with the following format.

  • Verify the dataset path in PanCollection/UDL/Basis/option.py, or you can print the output of run_pansharpening.py, then set cfg.data_dir to your dataset path.

|-$ROOT/Datasets
├── pansharpening
│   ├── training_data
│   │   ├── train_wv3.h5
│   │   ├── ...
│   ├── validation_data
│   │   │   ├── valid_wv3.h5
│   │   │   ├── ...
│   ├── test_data
│   │   ├── WV3
│   │   │   ├── test_wv3_multiExm.h5
│   │   │   ├── ...

Step2. Open PanCollection/UDL/pansharpening, run the following code:

python run_pansharpening.py

step3. How to train/validate the code.

  • A training example:

    run_pansharpening.py

    where arch='BDPN', and configs/option_bdpn.py has:

    cfg.eval = False,

    cfg.workflow = [('train', 50), ('val', 1)], cfg.dataset = {'train': 'wv3', 'val': 'wv3_multiExm.h5'}

  • A test example:

    run_test_pansharpening.py

    cfg.eval = True or cfg.workflow = [('val', 1)]

Step4. How to customize the code.

One model is divided into three parts:

  1. Record hyperparameter configurations in folder of PanCollection/UDL/pansharpening/configs/Option_modelName.py. For example, you can load pretrained model by setting model_path = "your_model_path" or cfg.resume_from = "your_model_path".

  2. Set model, loss, optimizer, scheduler in folder of PanCollection/UDL/pansharpening/models/<modelName>_main.py.

  3. Write a new model in folder of PanCollection/UDL/pansharpening/models/<modelName>/model_<modelName>.py.

Note that when you add a new model into PanCollection, you need to update PanCollection/UDL/pansharpening/models/__init__.py and add option_.py.

Others

  • if you want to add customized datasets, you need to update:
PanCollection/UDL/AutoDL/__init__.py.
PanCollection/UDL/pansharpening/common/psdata.py.
  • if you want to add customized tasks, you need to update:
1.Put model_<newModelName> and <newModelName>_main in PanCollection/UDL/<taskName>/models.
2.Create a new folder of PanCollection/UDL/<taskName>/configs to put option_<newModelName>.
3.Update PanCollection/UDL/AutoDL/__init__.
4.Add a class in PanCollection/UDL/Basis/python_sub_class.py, like this:
class PanSharpeningModel(ModelDispatcher, name='pansharpening'):
  • if you want to add customized training settings, such as saving model, recording logs, and so on. you need to update:
PanCollection/UDL/mmcv/mmcv/runner/hooks

Note that: Don't put model/dataset/task-related files into the folder of AutoDL.

  • if you want to know more details of runner about how to train/test in PanCollection/UDL/AutoDL/trainer.py, please see PanCollection/UDL/mmcv/mmcv/runner/epoch_based_runner.py

Contribution

We appreciate all contributions to improving PanCollection. Looking forward to your contribution to PanCollection.

Citation

Please cite this project if you use datasets or the toolbox in your research.

@misc{PanCollection,
    author = {Xiao Wu, Liang-Jian Deng and Ran Ran},
    title = {"PanCollection" for Remote Sensing Pansharpening},
    url = {https://github.com/XiaoXiao-Woo/PanCollection/},
    year = {2022},
}

Acknowledgement

  • MMCV: OpenMMLab foundational library for computer vision.

License & Copyright

This project is open sourced under GNU General Public License v3.0.

pancollection's People

Contributors

xiaoxiao-woo avatar liangjiandeng 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.