Skip to content

jpowellgz/image_preprocess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image-Preprocess

This repository aims to function as a collection of preprocessing methods and utilities to simplify the experimentation, implementation and comparison of algorithms with different purposes (brightness, contrast, denoising, sharpening, corrections). It's in development stage and more methods and utilities will be added with time.

Requirements

Setup

To setup the environment run:

uv sync --frozen

Command line interface

This repository has a command line interface option to test transformations.

To get a list of transformation categories and names run:

uv run preprocess info

To get specific information from a transformation and an example of JSON structure for configs run:

uv run preprocess info --transformation <transformation-name>

There is an example config and image available in the configs directory. To run a test of the config with the image use the command:

uv run preprocess run configs/image.json

To run with your own custom configs you can use the information presented in preprocess info command to start adding transformations you want to the "transformations" section of the config. Then you can run the config with an image, a dataset of images or a video. For each the following parameters are needed:

Image

{ 
    "path": "path/to/image",
    "file_type": "image",
    "transformations": []
}

Image dataset

{ 
    "path": "path/to/image/dataset",
    "file_type": "image_dataset",
    "transformations": []
}

Video

{ 
    "path": "path/to/video",
    "file_type": "video",
    "transformations": []
}

Each transformation in 'transformations' will have the following structure:

{
    "category": "white_balance",
    "name": "GrayWorldWhiteBalance",
    "parameters": {}
}

It is not needed to create the structure manually, preprocess info --transformation will give it, and only the values of the parameters would need to be modified, if any.

Webapp

There is the option of running a gradio webapp to test the available transformations.

Run:

uv run python interface.py

Navigate to the URL 127.0.0.1:7860/ in your browser

  1. Use the image loader to get an image from your computer.
  2. Choose a transformation category from the first dropdown menu.
  3. Choose a transformation from the following dropdown menu.
  4. Add the transformation to the pipeline. This will modify the transformations config shown in the JSON field automatically.
  5. Repeat for as many transformations as wanted.
  6. When ready, click on 'Test Transformation Pipeline'.
  7. The transformed image and histogram will appear at the corresponding space.

Changelog

v0.1.0 First version of image preprocess in development

About

Collection of image preprocessing methods and utilities to simplify testing and implementation.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages