This project implements an advanced shadow removal technique using generative AI and deep learning. Inspired by the research in Shadow Removal via Generative Priors, the model leverages StyleGAN and advanced image processing techniques to remove shadows from images.
- Advanced shadow removal using generative AI
- StyleGAN-based image generation
- Supports custom image processing
- Tensorflow implementation
- Python 3.10
- TensorFlow 2.15
- TensorFlow Hub
- NumPy
- Pillow
- tqdm
- Clone the repository
- Create a virtual environment:
# Create virtual environment
python3.10 -m venv venv
# Activate virtual environment
# On Linux/macOS:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
pip install -r requirements.txt
Download the pretrained checkpoints from the original project's Google Drive:
- Create checkpoint directory:
mkdir -p checkpoint
- Download required checkpoints:
550000.pt
(StyleGAN checkpoint)face-seg-BiSeNet-79999_iter.pth
(Face segmentation model)
- Convert Checkpoints:
python convert_checkpoint.py
chmod +x run.sh
./run.sh
shadow-removal/
│
├── checkpoint/ # Saved model checkpoints
├── imgs/ # Input and sample images
├── lpips/ # Perceptual loss implementation
├── models/ # Neural network model definitions
├── op/ # Custom TensorFlow operations
├── results/ # Output images after shadow removal
├── utils/ # Utility functions and helpers
│
├── convert_checkpoint.py # Script to convert checkpoints
├── model.py # Main model implementation
├── projector.py # Image projection utilities
├── remove_shadow.py # Main script for shadow removal
├── requirements.txt # Project dependencies
├── run.sh # Shell script for running the project
└── run_windows.sh # Windows-specific run script