This project uses the Instruct-Pix2Pix model from Hugging Face (timbrooks/instruct-pix2pix) to colorize grayscale images. The project provides a Gradio interface that allows users to upload grayscale images and generate colorized versions with a simple click.
- ✅ Upload grayscale images for automatic colorization.
- ✅ Real-time inference using the Instruct-Pix2Pix model.
- ✅ User-friendly web interface with Gradio.
Before running the project, make sure you have the following packages installed:
Poetry installstep 2:-
streamlit run app.pyBefore running the project, make sure you have the following packages installed:
# Create a virtual environment (optional but recommended)
python3 -m venv pix2pix-env
source pix2pix-env/bin/activate # On Mac/Linux
# or
pix2pix-env\Scripts\activate # On Windows
# Install required packages
pip install torch torchvision diffusers gradio pillow-
Model: timbrooks/instruct-pix2pix
-
Task: Image-to-Image Transformation using Natural Language Instructions
-
Optimized for GPU usage (torch.cuda), with fallback to CPU.
Follow these steps to run the project:
- Clone the repository:
git clone https://github.com/your-username/pix2pix-colorizer.git
cd pix2pix-colorizer-
Upload a grayscale image.
-
Click on the Submit button.
-
The colorized image will be displayed.