Git Product home page Git Product logo

libllie's Introduction

LLIELib: Low-Light Image Enhancement Library

LibLLIE is an open-source library for Low-Light Image Enhancement built on PyTorch.

​ This Python library provides a collection of traditional machine learning algorithms for low-light image enhancement. The library supports multiple color spaces and offers various methods for image enhancement. It is designed to be modular and easy to integrate into your existing projects.

​ The integration code for deep learning models is currently being developed and will be released soon !

​ Feel free to use this library in your research!

⭐ Star us on GitHub — your support means a lot!

Table of Contents

Supported Algorithms for now :

HE Series: HE、CLAHE、RCLAHE

Math series: gamma correction、log transformation

Dark Channel Prior(DCP): implementation of paper : Single image haze removal using dark channel prior

Color Spaces: RGB、HLS、HSV、LAB、YUV...

More algorithms will be released soon !

Installation

There are two ways to install LibLLIE.

conda create -n LlieLib python=3.8 -y
pip install -r requirements.txt

Method 1: Install from Source Code

git clone https://github.com/glory-wan/LLIE-Lib.git

pip install -e .  # Editable mode, suitable for those who wish to modify the source code.
pip install .     # Standard mode, suitable for installing the package without the need for further modification of the source code.

Method 2: Install Using a Compressed Package

With this method, you don't need to download the source code. Simply download a compressed package and execute the following command in your local Python environment.

The compressed package can be found at LLIE-Lib/dist, or you can download it from the Releases section.

pip install LibLlie-1.0.tar.gz

Quick Start

Command-Line Interface

To quickly start processing images using the command-line interface:

python example/commandTA.py --img path/to/img --method he --cs hsv --name he_hsv --display True

Supported algorithms and color spaces can be found in the LibLlie/troditionAlgorithm/config.py file.

Script Interface

To use the library in a Python script:

from LibLlie.scriptTA import script_ta

img = script_ta(
    img_path='path/to/img.jpg',
    algorithm='he',
	
    # following parameters are alternative
    showimg=True,
    saveimg=False,
    # name='rgb_he',
    # width=800,
    # height=600,
    # format='jpg',
    # directory=results_path,
    # clipLimit=2.0,   # default = 2.0
    # gridSize=8,    # default = 8
    # iteration=2,    # default = 2
)

Parameters

The configuration parameters for the algorithms can be set via the command line or within a script:

  • --img: Path to the image file (URL or local path).
  • --method: Selected algorithm (e.g., he, clahe, rclahe).
  • --cs: Selected color space (e.g., rgb, hls, hsv, lab, yuv).

Optional parameters include clipLimit, gridSize, iteration, name, save, format, display, width, and height.

More details can be found in the LibLlie/troditionAlgorithm/config.py file.

Case Studies

Below are some examples demonstrating the enhancement effects achieved using LibLLIE on low-light images.

Original vs Enhanced Images using HE series

the inputinput

the results of HE series

image-20240817204710109

Original vs Enhanced Images using gamma correction

The input

gamma

The result with varying gamma values

for i in tqdm(np.arange(0.0, 30.0, 0.05)):  # Gamma values from 0.0 to 30.0 with a step size of 0.05
    gamma_img = gamma_correction(img, gamma=i)
gamma_correction.mp4

Original vs Enhanced Images using Dark Channel Prior

Dark Channel Prior

Original vs Enhanced Images using Single-Frame Multi-Enhancement Fusion

(This part of the code will be uploaded soon.)

Multi-Enhancement

Contributor

Some parts of LLIELib's code were completed with the assistance of Ln3214, BZ2116, zhlhlz, KyleTang-0711, Bainianzzz, purplers, Mystic2004, Humbleb11, 7dayu6 shazhou01.

​ We welcome contributions to improve this library. If you would like to contribute, please fork the repository, create a new branch, and submit a pull request.

Contact us

If you have any question or suggestion, please feel free to contact us by raising an issue or sending an email to [email protected].

License

LibLLIE is licensed under the MIT License. See the LICENSE file for more details.

libllie's People

Contributors

glory-wan avatar

Stargazers

 avatar

Watchers

 avatar

libllie'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.