Skip to content

Repository files navigation

🎨 Neural Style Transfer Web App

Transform your photos into artwork using deep learning and pre-trained models like oil painting,candy, udnie, rain_princess, and more — all powered by PyTorch and Flask with a beautiful user interface.

🚀 Features

  • Upload your own image and apply different artistic styles
  • Choose from multiple .pth style models
  • RGB glowing buttons and smooth animations
  • Sparkle + buffer effect during image processing
  • Clean, mobile-friendly design
  • Download your stylized image instantly

📁 Project Structure

neural-style-transfer-app/
├── app_multiple_styles.py                  # Flask backend logic
├── model.py                # TransformerNet model definition
├── templates/
│   └── index.html          # Frontend HTML page
├── static/
│   ├── style.css           # (Optional) Additional CSS
│   └── logo.png            # App branding logo
├── saved_models/
│   ├── candy.pth
│   ├── oil_painting.pth
│   ├── rain_princess.pth
│   └── udnie.pth
└── requirements.txt        # Required Python packages

🧠 Supported Style Models (.pth)

  • candy.pth
  • oil_painting.pth
  • rain_princess.pth
  • udnie.pth

You can download more .pth models from:

⚙️ Installation

  1. Clone the repository:
git clone https://github.com/yourusername/neural-style-transfer-app.git
cd neural-style-transfer-app
  1. Create a virtual environment and install dependencies:
python -m venv venv
Windows: venv\Scripts\activate # Linux source venv/bin/activate 
pip install -r requirements.txt
  1. Run the app:
python app_multiple_styles.py

Visit http://127.0.0.1:5000 in your browser.

🖼️ How it works

  • Upload a content image.
  • Select a style model.
  • Click "✨ Stylize Image" — the image is sent to the backend.
  • The selected model applies style transfer using TransformerNet.
  • The stylized output is shown with the option to download.

📦 Dependencies

  • Flask
  • Torch
  • torchvision
  • Pillow

Install via:

pip install -r requirements.txt

Screenshots

imageimageimage***

📄 License

MIT License © 2025 Vignesh M

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages