Skip to content

Project for IANNwTF Course WiSe 21/22 Cognitive Science at University Osnabrück

License

Notifications You must be signed in to change notification settings

PeterKeffer/IANNwTF

Repository files navigation

IANNwTF Project - Group 28 & 24

Project for IANNwTF Course WiSe 21/22 Cognitive Science at University Osnabrück

About The Project

Neural Style Transfer Example

This project is part of the 'Introduction to Artificial Neural Networks with Tensorflow' course at the University Osnabrück.
In our project we generate pictures to which the art style of a chosen artist is transmitted while keeping the pictures content complete.
For this we implemented 2 different approaches, on the one hand CycleGAN ( Link to the CycleGAN Paper ) and on the other hand Neural Style Transfer ( Link to the Neural Style Transfer Paper ), with the use of TensorFlow.

(back to top)

Project Structure

.
├── images 
├── src                    
│   ├──── Configs                               # Here you can find all the configs          
│   │     ├── Config.py
│   │     ├── ConfigCycleGAN.py
│   │     └── ConfigNeuralStyleTransfer.py
│   │
│   ├──── Data                                  # Here you can find downloaded/unpacked Datasets and Data Utilities
│   │     ├── Downloads
│   │     ├── DataPipeline.py
│   │     ├── DatasetDownloader.py
│   │     └── Data_Utilities.py
│   │
│   ├──── Logs                                  # Here you can find generated images and Tensorboard Logs
│   │
│   ├──── Models                                # Here you can find all used Models
│   │     ├── BaseModel.py
│   │     ├── CycleGAN.py
│   │     ├── NeuralStyleTransfer.py
│   │     └── PatchGAN.py
│   │
│   ├──── Utilities                             # Here you can find general Utilities
│   │     ├── Callbacks                         # Here you can find custom Callbacks
│   │     └── Visualizer.py
│   │
│   ├──── wandb
│   ├─ main_CycleGAN.py                         # Run this main for CycleGAN
│   └─ main_NeuralStyleTransfer.py              # Run this main for NeuralStyleTransfer
│
│── .gitignore
│── LICENSE
│── main_all_colab.ipynb
│── main_CycleGAN_colab.ipynb
│── main_NeuralStyleTransfer_colab.ipynb
│── README.md
└── requirements.txt

(back to top)

Getting Started

Neural Style Transfer Example 1:

Art Style Reference:

drawing

Paris before Style Transfer Paris after Style Transfer
drawing drawing

Neural Style Transfer Example 2:

Art Style Reference:

drawing

Dog before Style Transfer Dog after Style Transfer
drawing drawing

CycleGAN Example 1:

Content Reference:

drawing

Generated Image:

drawing

CycleGAN Example 2:

drawing

Prerequisites

The only thing you need to do, is to install all the requirements that are listed in requirements.txt. Feel free to use following command inside "IANNwTF" Project.

pip install -r requirements.txt

In this Project "Weights & Biases"(short wandb) is utilized. You can disable it in src/Configs/Config_(CycleGAN | NeuralStyleTransfer) under config>settings>use_wandb.

Otherwise you need to create a wandb account and get your API Key. I can fully recommend it! Besides that we have also included the option to use Tensorboard.

(back to top)

Colab Version

Alternatively you can use the provided Jupyter Notebooks main_*_colab.ipynb to instantly start using our project, without any hassle.

Feel also free to use this Online Colab Version: Colab Link

(back to top)

Usage

Run main_(CycleGAN | NeuralStyleTransfer).py with "IANNwTF/src/" as Working Directory.

You can change the most important settings and hyperparameters in the Configs section.

(back to top)

Authors

  • Erik Bossow
  • Julia Fülling
  • Lena Kagoshima
  • Peter Keffer
  • Linda Ariel Ventura di Lorenzo Lopes
  • Jan-Eric Wiemann

(back to top)

Acknowledgments

Extensively used resources besides Original-Papers:

https://keras.io/examples/generative/neural_style_transfer/

https://machinelearningmastery.com/cyclegan-tutorial-with-keras/

Tools:

https://wandb.ai/site

(back to top)

About

Project for IANNwTF Course WiSe 21/22 Cognitive Science at University Osnabrück

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published