rem-wm
rem-wm copied to clipboard
Watermark remover tool that leverages the capabilities of Microsoft Florence and Lama Cleaner models.
Rem-WM: Watermark Remover using Florence and Lama Cleaner
Rem-WM, a powerful watermark remover tool that leverages the capabilities of Microsoft Florence and Lama Cleaner models. This tool provides an easy-to-use interface for removing watermarks from images, with support for both individual images and batch processing.
Test
https://huggingface.co/spaces/DamarJati/Remove-watermark
Features
- Watermark Removal: Automatically detect and remove watermarks from images.
- Batch Processing: Efficiently process multiple images using threading.
- Custom Model Support: Flexibility to use custom Florence models.
- Easy Integration: Simple class-based interface for integration into your projects.
Installation
First, clone the repository and navigate to the project directory:
git clone https://github.com/Damarcreative/rem-wm.git
cd rem-wm
Install the necessary dependencies:
pip install -r requirements.txt
Usage
Single Image Processing
To remove a watermark from a single image, use the WatermarkRemover class:
from remwm import WatermarkRemover
# Initialize the WatermarkRemover with the default Florence model
remover = WatermarkRemover()
# Define input and output paths
input_image_path = "path/to/input/image.jpg"
output_image_path = "path/to/output/image.jpg"
# Process the image
remover.process_images_florence_lama(input_image_path, output_image_path)
Batch Processing
To process multiple images in a directory, use the process_batch method:
from remwm import WatermarkRemover
# Initialize the WatermarkRemover
remover = WatermarkRemover()
# Define input and output directories
input_dir = "path/to/input/folder"
output_dir = "path/to/output/folder"
# Process the batch of images
remover.process_batch(input_dir, output_dir, max_workers=4)
Using a Custom Florence Model
If you want to use a custom Florence model, simply provide the model ID during initialization:
from remwm import WatermarkRemover
# Initialize with a custom Florence model
remover = WatermarkRemover(model_id='facebook/custom-florence-model')
# Process images as usual
input_image_path = "path/to/input/image.jpg"
output_image_path = "path/to/output/image.jpg"
remover.process_images_florence_lama(input_image_path, output_image_path)
Contributing
We welcome contributions to enhance Rem-WM! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgements
Contact
For any questions or inquiries, please open an issue or contact us at [email protected] .
Thank you for using Rem-WM! We hope this tool helps you effectively remove watermarks from your images.