Skip to content

FYT3RP4TIL/Neural-Style-Transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Style Transfer: Create AI-Generated Art 🎨🖌️

Transform your photos into stunning digital art using the power of Neural Style Transfer!

🌟 Overview

Neural Style Transfer (NST) is an innovative AI technique that combines the content of one image with the artistic style of another. This project implements a state-of-the-art NST model using TensorFlow and Keras, allowing you to create unique artworks from your photos.

🎯 Objectives

  • Explore and implement Neural Style Transfer techniques
  • Develop a user-friendly interface for easy art creation
  • Provide a platform for creating potential NFT artworks

🧠 How It Works

NST leverages the power of Convolutional Neural Networks (CNNs) to separate and recombine the content and style of different images. The process involves:

  1. Using a pre-trained feature extractor (typically a VGG network)
  2. Implementing a transfer network with an encoder-decoder architecture
  3. Optimizing the output image to minimize both content and style losses

Our implementation uses a pre-trained "Arbitrary Neural Artistic Stylization Network," capable of applying various artistic styles to any input image in a single, efficient pass.

🚀 Getting Started

Prerequisites

  • Python 3.7+
  • TensorFlow 2.x
  • Keras
  • Matplotlib

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/neural-style-transfer.git
    cd neural-style-transfer
    
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
    
  3. Install the required dependencies:

    pip install -r requirements.txt
    
  4. Download the pre-trained model from this link and place it in the model directory.

Usage

You can use the Neural Style Transfer model in two ways:

  1. Through the Python API:
import matplotlib.pyplot as plt
from API import transfer_style

model_path = "path/to/model/directory"
content_image_path = "path/to/your/content/image.jpg"
style_image_path = "path/to/your/style/image.jpg"

stylized_image = transfer_style(content_image_path, style_image_path, model_path)
plt.imsave('stylized_image.jpg', stylized_image)
plt.imshow(stylized_image)
plt.show()
  1. Through the provided application:
python app.py

📚 Learn More

To dive deeper into Neural Style Transfer, check out these resources:

🎨 Custom Models

The project includes two custom Neural Style Transfer (NST) models, located in the notebooks directory:

  1. Full NST Model (VGG19): This model implements the original Neural Style Transfer algorithm. It uses VGG19 to the style from a given style image and applies it to a content image. This process can be computationally intensive but offers high flexibility in style application.

  2. Pretrained Model: This is a fast Neural Style Transfer model that uses a pretrained network. It can apply style transfer much more quickly than the Pull NST model, making it suitable for real-time applications or processing large numbers of images.

🖼️ Gallery

Here are some examples of our Neural Style Transfer in action:

Original Image

OG

Generated Artworks

Generated Art 1 Generated Art 2
Generated Art 3 Generated Art 4

Original Image

OG

Generated Artworks

Generated Art 1 Generated Art 2
Generated Art 3 Generated Art 4

MISC 🎨

Generated Art 1 Generated Art 2
Generated Art 1 Generated Art 2
Generated Art 3 Generated Art 4
Generated Art 1 Generated Art 2 Generated Art 2
Generated Art 1 Generated Art 2
Generated Art 1 Generated Art 2

Each of these images demonstrates a unique style transfer, showcasing the versatility of our Neural Style Transfer model.

Acknowledgements


Happy styling! Create, innovate, and share your AI-generated masterpieces with the world! 🎨🚀

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published