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.
To setup the environment run:
uv sync --frozen
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:
{
"path": "path/to/image",
"file_type": "image",
"transformations": []
}{
"path": "path/to/image/dataset",
"file_type": "image_dataset",
"transformations": []
}{
"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.
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
- Use the image loader to get an image from your computer.
- Choose a transformation category from the first dropdown menu.
- Choose a transformation from the following dropdown menu.
- Add the transformation to the pipeline. This will modify the transformations config shown in the JSON field automatically.
- Repeat for as many transformations as wanted.
- When ready, click on 'Test Transformation Pipeline'.
- The transformed image and histogram will appear at the corresponding space.
v0.1.0 First version of image preprocess in development

