AI Art Generator Save

A program that can add an artistic touch to any image.

Project README

AI-Art-Generator

made-with-pythonOpen In ColabMade with Tensorflow

Overview

Simple Art style transferer

You give a style image and the model learns the features and transfers it to the content image Best recommended to run with a GPU for the fastest result

How it works?

Neural style transfer is an optimization technique that involves creating a new image that merges the content of one image with the style of another. Here's a high-level overview of how the AI-Art-Generator works:

- Load the content image and the style image.
- Preprocess the images by resizing and normalizing them.
- Create a model that combines a pre-trained convolutional neural network (CNN) with the VGG19 architecture.
- Define loss functions that measure the content loss and style loss between the generated image and the target image.
- Set up the optimization process using gradient descent to minimize the total loss.
- Iterate the optimization process to update the generated image and minimize the loss.
- Generate the final stylized image.

By minimizing the content loss, the generated image retains the content of the original content image. By minimizing the style loss, the generated image captures the artistic style of the style image. The balance between the content and style losses can be adjusted to control the final result.

Further reading

Gatys’ paper
Gradient descent

Credits

Tensorflow article (It was for version TensorFlow V1)

Some examples of the project

Content and style images

image

Output

image

How to run locally?

Clone the repo.

git clone https://github.com/Rohith04MVK/AI-Art-Generator

Setup conda.

conda create -n AI-Art-Generator python=3.8.5
conda activate AI-Art-Generator

Install dependencies.

pip install -r requirement.txt

OR

conda install --file requirement.txt

Replace the pictures.

Replace line 10 content_path with the image you want to transform Replace line 11 style_path with the style picture you want to transfer

Run the file!

python aiart.py

Starchart

Star History Chart

Open Source Agenda is not affiliated with "AI Art Generator" Project. README Source: Rohith04MVK/AI-Art-Generator
Stars
97
Open Issues
0
Last Commit
7 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating