Giter VIP home page Giter VIP logo

geogan's Introduction

GeoGAN

This is PyTorch implementation of a GeoGAN network for for dense labeling of RGB+IR optical imagery. The code is based on the pytorch-CycleGAN-and-pix2pix

GeoGAN: Project | Paper

Prerequisites

  • Linux or macOS
  • Python 2 or 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Getting Started

Installation

pip install visdom dominate
  • Alternatively, all dependencies can be installed by
pip install -r requirements.txt
  • Clone this repo:
git clone https://github.com/vlkniaz/GeoGAN.git
cd GeoGAN
  • For Conda users, we include a script ./scripts/conda_deps.sh to install PyTorch and other libraries.

GeoGAN train/test

  • Download a GeoGAN dataset (e.g. maps):
bash ./datasets/download_geogan_dataset.sh maps
  • Train a model:
#!./scripts/train_geogan.sh
python train.py --dataroot ./datasets/maps --name maps_geogan --model geo_gan
  • To view training results and loss plots, run python -m visdom.server and click the URL http://localhost:8097. To see more intermediate results, check out ./checkpoints/maps_geogan/web/index.html
  • Test the model:
#!./scripts/test_geogan.sh
python test.py --dataroot ./datasets/maps --name maps_geogan --model geo_gan

The test results will be saved to a html file here: ./results/maps_geogan/latest_test/index.html.

Apply a pre-trained model (GeoGAN)

  • You can download a pretrained model (e.g. isprs) with the following script:
bash ./scripts/download_geogan_model.sh isprs

The pretrained model is saved at ./checkpoints/{name}_pretrained/latest_net_G.pth. The available model is isprs.

  • To test the model, you also need to download the isprs dataset:
bash ./datasets/download_geogan_dataset.sh horse2zebra
  • Then generate the results using
python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test

The option --model test is used for generating results of GeoGAN only for one side. python test.py --model geo_gan will require loading and generating results in both directions, which is sometimes unnecessary. The results will be saved at ./results/. Use --results_dir {directory_path_to_save_result} to specify the results directory.

Download GeoGAN datasets and create your own datasets.

Best practice for training and testing your models.

Citation

If you use this code for your research, please cite our papers.

@inproceedings{Kniaz:2018fq,
author = {Kniaz, V V},
title = {{Conditional GANs for Semantic Segmentation of Multispectral Satellite Images}},
booktitle = {SPIE Remote Sensing},
year = {2018},
publisher = {SPIE},
month = sep
}

Related Projects

CycleGAN-Torch | pix2pix-Torch | pix2pixHD | iGAN | BicycleGAN

Acknowledgments

Code is inspired by pytorch-DCGAN.

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.