Code Monkey home page Code Monkey logo

rainmapgenerator's Introduction

RainMapGenerator

This is an implementation of RainGAN: A rain filed generator.

Abstract

Rain fields’ simulation is an important tool for several research fields and applications. However, most simulations are based on a naive model that cannot capture complex spatial distribution. In this work, we present RainGAN, a generative model that enables a generation of a realistic, complex rain field that is conditioned on user parameters such as max peak, number of peaks, etc. In addition, we construct a dataset of typical rain fields that are based on radar measurement and have been utilized in the training process. We conducted several experiments and demonstrate the generator quality using both numerical and visual results.

Using RainGAN

Before using this code pleae install the requirements file.

pip install requirements.txt

Here is an example of rain field generation using RainGAN. Beforehand, please install the requirements file. This code generate a rain filed with the following parameters:

  1. rain_coverage=0.3 (Control the percentage of rainy pixels in the output rain filed)
  2. n_peaks=5 (Control the number of peaks filed)
  3. peak_rain_rate=1 (Control peak rain value)
h,w=32,32
rain_field_function = get_rain_gan_function(h, w)
k = 4
sample = rain_field_function(rain_coverage=0.3, 
                            n_peaks=5,
                            peak_rain_rate=1, 
                            batch_size=k ** 2)
for i in range(k):
   for j in range(k):
       plt.subplot(k, k, i + 1 + 4 * j)
       plt.imshow(sample[i + 4 * j, :, :])
plt.show()

Here is the results output

RainGAN

Training

Build Dataset Pickle

The RainGAN training require a dataset of Rain Image. In this project our dataset is base on SHMI radar map, to construction of such a dataset requires two steps.

1.Download Radar Map: This is code download raw

python scripts/download_radar_images.py 

Generate Dataset Pickle

python scripts/imagedata2pickle.py 

Training

python main.py 

Issues

Reference

If you find this work usefully, please cite:

Habi, Hai Victor, and Hagit Messer. "RainGAN: A Conditional Rain Fields Generator." 2021 IEEE International Conference on Microwaves, Antennas, Communications and Electronic Systems (COMCAS). IEEE, 2021.

@inproceedings{habi2021raingan,
  title={RainGAN: A Conditional Rain Fields Generator},
  author={Habi, Hai Victor and Messer, Hagit},
  booktitle={2021 IEEE International Conference on Microwaves, Antennas, Communications and Electronic Systems (COMCAS)},
  pages={529--532},
  year={2021},
  organization={IEEE}
}

rainmapgenerator's People

Contributors

haihabi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

rainmapgenerator's Issues

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.