Skip to content

This project applies neural style transfer to create new images by merging the content of one image with the artistic style of another.

Notifications You must be signed in to change notification settings

Abdelrahman-Amen/Neural_Style_Transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Style Transfer: Bringing Art to Life 🖼️ 🎨 🖌

What is Neural Style Transfer (NST)? 🧠

Neural Style Transfer is a fascinating application of deep learning that blends two images:

1. Content Image: This provides the structure, layout, and general appearance of the result.

2. Style Image: This provides the artistic texture and patterns that you want to overlay onto the content image.

By combining these two, NST creates a stylized image that retains the structural elements of the content while incorporating the artistic style.

Image

How Does NST Work? 🎨

The process of Neural Style Transfer involves:

  1. Extracting Features: Deep learning models, often Convolutional Neural Networks (CNNs), extract features from both the style and content images.

  2. Defining Objectives: • The Content Objective ensures the output resembles the structure of the content image.

• The Style Objective ensures the textures, colors, and patterns from the style image are reflected in the result.

  1. Merging Style and Content: A pre-trained model adjusts the content image’s features to align with the desired style while retaining the original structure.

NST is typically performed using models like VGG19 or TensorFlow Hub's pre-trained Arbitrary Image Stylization model.

Features of the Project 🚀

  1. Dynamic Image Selection: Upload your content image and style image directly through the app.

  2. Real-Time Stylization: Leveraging TensorFlow Hub’s Arbitrary Image Stylization model, the app generates the stylized image in real-time.

  3. User-Friendly Interface: Built using Streamlit, the app is simple, interactive, and easy to use.

How the App Works 🛠️

  1. Preprocessing Images:

• Converts images into tensors and normalizes them for model compatibility.

• Adds batch dimensions to facilitate computation.

  1. Style Transfer Model:

• The pre-trained model processes the images and outputs a stylized tensor.

• Converts the output tensor back into an image for display.

  1. Streamlit Integration:

• Provides a clean interface for users to upload images and generate results effortlessly.

Example Workflow 📸

  1. Upload a content image (e.g., a photo of a cityscape).

  2. Upload a style image (e.g., a painting by Van Gogh).

  3. Click Generate Stylized Image.

4 .View and save the newly created masterpiece! 🎉

Demo 🎥

Here’s how it works: Streamlit App Demo

Why Neural Style Transfer? 💡

NST bridges the gap between artificial intelligence and art, enabling creators to craft unique visuals effortlessly. It’s perfect for:

• Artistic endeavors

• Image processing

• Creative projects

About

This project applies neural style transfer to create new images by merging the content of one image with the artistic style of another.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages