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

Folders and files

NameName
Last commit message
Last commit date
Oct 15, 2022
Feb 16, 2023
Dec 15, 2020
Oct 15, 2022
Feb 20, 2025
Oct 15, 2022
Dec 15, 2020
Dec 15, 2020
Mar 11, 2025
Mar 11, 2025
Feb 21, 2025
Feb 21, 2025

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