image-cleanup / README.md
kuko6's picture
Rename example images
f4170ee
|
Raw
History Blame Contribute Delete
1.3 kB

A newer version of the Gradio SDK is available: 6.20.0

Upgrade
metadata
title: Image Cleanup
emoji: πŸ§‘β€πŸ”¬
colorFrom: pink
colorTo: yellow
sdk: gradio
sdk_version: 6.19.0
python_version: '3.10'
app_file: app.py
pinned: false

Image cleanup

Script for removing dark, low-saturation debris from IHC images with OpenCV inpainting.

uv sync
uv run python main.py data/example.png

PNG, JPEG, TIFF, and TIF inputs are supported. Cleaned images are written to out/cleaned/ with _cleaned added before the original extension, and masks are written to out/masks/ as PNG files.

An optional Gradio interface is also available:

uv run python app.py

Open the local URL printed in the terminal, upload an input image, and select Clean image. TIFF inputs are converted to PNG previews in the interface, and the cleaned file can be downloaded with the original extension.

For batch processing, open the Image directory tab and select a folder. The app processes all uploaded images, including .tif and .tiff files, and returns a ZIP archive.

Project layout:

  • main.py β€” primary image-cleaning script
  • cleaning.py β€” reusable cleaning operations
  • app.py β€” optional Gradio interface
  • data/ β€” source and example images
  • out/ β€” generated cleaned images and masks
  • test.ipynb β€” image-cleaning experiments