Code Monkey home page Code Monkey logo

logan's Introduction

LoGAN user guide

This README will explain how to set-up and run the code for LoGAN: Generating Logos with a Generative Adversarial Neural Network Conditioned on Colour.

Getting the data and Training the model

  • Download LLD-Icons PNG files from: https://data.vision.ee.ethz.ch/sagea/lld/data/LLD-icon_PNG.zip
  • Set up a Python 3.5 environment with the packages mentioned below
  • Run get_colors.py (change the PATH variable to main directory)
    • In your current directory a file 'colors.csv' will be created with 3 columns (name of file, top 3 colors in file, amount of each of the top 3 colors) - Run change_colors_to_words.py (change path variable to main directory)
    • A one hot encoding of the colors extracetd previously will be created in the data folder - Change the path of the data and the one-hot-encoding csv on read_images.py - Run main.py

Overview of the files

File Function Parameters
get_colors.py Uses the logos to find RGB centroids for the KMeans clusters for each image (output:colors.csv) PATH - of working directory, TRAINING - true in training mode, VERBOSE - wether to print details
change_colors_to_words.py Uses colors.csv to create a one-hot-encoding for the labels (output:one_hot_encoding_color_icon.csv) PATH - of working directory, TRAINING - true in training mode, VERBOSE - wether to print details
acgan.py The class of the ACGAN
main.py The main class. Use this to start training the model and tweak the parameters. gan_type - only ACWGANGP, dataset - only available dataset lld, epoch - number of epochs to train, batch_size - size of batch to train, z_dim - dimension of noise vector, checkpoint_dir-to save checkpoint, result_dir-directory to save results, log_dir-tensorboard log directory
ops.py Defines the layers.
utils.py Defines useful functions.
read_images.py Defines two methods, to read images, and labels in one hot encoding format. Data_PATH, label_csv_PATH, IMAGE_SIZE - size of the images, CATEGORIES - classes, BATCH_SIZE - size of batch, VERBOSE - wether to print details
make_confusion_matrix.py Used to get the confusion matrix to get the results as in paper.

Necessary packages

Python 3.5 tensorflow (1.4+) numpy (1.13.1 and 1.14.1) PIL (pillow) (5.1.0) pandas (0.20.3) webcolors (1.8.1) scikit-learn (0.19.0) matplotlib (2.12.2) cv2 (opencv-python) (3.4.0.12)

logan's People

Contributors

ajki avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.