Giter VIP home page Giter VIP logo

sketch-artist's Introduction

Sketch-Artist

Overview

A Tensorflow implementation of a Conditional GAN (Generative Adversarial Network) for generating human faces from a text description. This project was created for my CSC 340 (Artificial Intelligence) final project.

TO-DO

  • Does not produce samples accurate to condition yet

Label Vector

The label is a vector with 5 indices each corresponding to a different facial feature

The values for each feature can either be 1 or -1

  • Black hair
  • Blonde hair
  • Brown hair
  • Male
  • Beard

Generator

Generator

Discriminator

Discriminator

Installation

Git clone the repository and cd into the directory

git clone https://github.com/greerviau/Sketch-Artist.git && cd Sketch-Artist

Download the CelebA dataset here and extract

In CGAN.py add data directory to CelebA object

  • Make sure that directory contains list_attr_celeba.csv and img_align_celeba
celebA = CelebA(output_size, channel, sample_size, batch_size, crop, data_dir=<path-to-data>)

Usage

python CGAN.py train
python CGAN.py test

Results

After 100 epochs

epoch_100_batch_310

sketch-artist's People

Contributors

greerviau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sketch-artist's Issues

I tried running the code on Google Colab but faced the following errors:

Few issues I faced when I tried to run the code on Google Colab:
Issue 1:
Loading: 000001.jpg - Loaded: 0Traceback (most recent call last):
File "/content/Sketch-Artist/CGAN.py", line 346, in
cgan.train()
File "/content/Sketch-Artist/CGAN.py", line 92, in train
self.celebA.load_data()
File "/content/Sketch-Artist/utils.py", line 42, in load_data
h, w, c = image.shape
AttributeError: 'NoneType' object has no attribute 'shape'

Issue 2:
File "/content/Sketch-Artist/CGAN.py", line 346, in
cgan.train()
File "/content/Sketch-Artist/CGAN.py", line 83, in train
self.saver.restore(sess, self.model_dir+self.version+'/'+self.version+'.ckpt')
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/training/saver.py", line 1282, in restore
checkpoint_prefix)
ValueError: The passed save_path is not a valid checkpoint: model/face_gen_per_batch_filtered_4/face_gen_per_batch_filtered_4.ckpt

Issue 3:
File "/content/Sketch-Artist/CGAN.py", line 346, in
cgan.train()
File "/content/Sketch-Artist/CGAN.py", line 117, in train
train_images, real_labels = self.celebA.get_next_batch(batch)
File "/content/Sketch-Artist/utils.py", line 88, in get_next_batch
length = len(self.data)
TypeError: object of type 'NoneType' has no len()

I am new to GANs. Kindly help me resolve these issues. Thanks

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.