Giter VIP home page Giter VIP logo

redistributor's Introduction

match_colors

Redistributor

Redistributor is a Python package which forces a collection of scalar samples to follow a desired distribution. When given independent and identically distributed samples of some random variable $S$ and the continuous cumulative distribution function of some desired target $T$, it provably produces a consistent estimator of the transformation $R$ which satisfies $R(S)=T$ in distribution. As the distribution of $S$ or $T$ may be unknown, we also include algorithms for efficiently estimating these distributions from samples. This allows for various interesting use cases in image processing, where Redistributor serves as a remarkably simple and easy-to-use tool that is capable of producing visually appealing results. The package is implemented in Python and is optimized to efficiently handle large data sets, making it also suitable as a preprocessing step in machine learning.

Example of matching colors

Matching colors of a reference image – one of the use cases of Redistributor

Installation

pip install redistributor

Quick-start

from redistributor import Redistributor as R
from redistributor import LearnedDistribution as L
from scipy.stats import dgamma, norm

S = dgamma(7).rvs(size=1000)  # Samples from source distribution
target = norm(0, 1)  # In this example, target is set explicitly
r = R(source=L(S), target=target)  # Estimate the transformation
output = r.transform(S)  # Data now follows the target distribution

More in examples.ipynb. Examples for image processing are in examples-images.ipynb.

Documentation

Documentation is available in docs folder.

News & Changelog

  • 🔨 Package is still under development
  • 2024.07 - Preprint on ArXiv updated with new results
  • 2024.07 - Package released on PyPi.org 🎉
  • 2024.07 - Repository mirrored to GitHub for easier access of the community
  • 2023.10 - Added code examples of image processing
  • 2022.10 - Preprint published on ArXiv 🎉
  • 2022.09 - Redistributor v1.0 (complete rewrite)
  • 2021.10 - Redistributor v0.2 (generalization to arbitrary source & target)
  • 2018.08 - Introducing Redistributor (generalization to arbitrary target)
  • 2018.07 - Introducing Gaussifier package (now deprecated)

How to cite

If you use Redistributor in your research, please cite the following paper:

@article{harar2022redistributor,
  title={Redistributor: Transforming Empirical Data Distributions},
  author={Harar, P. and Elbrächter, D. and Dörfler, M. and Johnson, K.},
  eprinttype={ArXiv},
  eprint={2210.14219}
}

License

This project is licensed under the terms of the MIT license. See license.txt for details.

redistributor's People

Contributors

paloha avatar

Stargazers

Pavel Galushin avatar

Watchers

 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.