Skip to content
/ psin Public

Single image generation with a patch-based algorithm

License

Notifications You must be signed in to change notification settings

ncherel/psin

Repository files navigation

A Patch-Based Algorithm for Diverse and High Fidelity Single Image Generation

This is the official implementation for our paper presented at ICIP 2022:

A Patch-Based Algorithm for Diverse and High Fidelity Single Image Generation
N. Cherel, A. Almansa, Y. Gousseau, A. Newson

Link to [Preprint] [Paper]

We present a pure patch-based solution to single image generation that does not require learning. As a result new samples are possible using this code in a few seconds.

This algorithm contains the code for our PSin algorithm only.
The reference code for the optimal transport initialization is found at optimization https://github.com/ahoudard/wgenpatex . Our fork with minor modifications will be released soon.

Reference Generated
Reference Image Algorithm output

Install

The requirements are:

  • opencv
  • numpy
  • scipy
  • cffi
  • numba

Accelerate

You can accelerate processing by compiling the source file patch_measure.cpp with the following command (tested on Linux only):

g++ -fPIC -shared patch_measure.cpp -O3 -o libpatch_measure.so

And then activate it in config.py with USE_CPP=True.

Run

The code is then run using :

python synthesis.py

The default file used as reference is available is balloons.png.

About

Single image generation with a patch-based algorithm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published