Sticking it to DCGAN

These are notes to self; a proper blog post eventually

Working with DCGAN – https://github.com/carpedm20/DCGAN-tensorflow

This is cool too, but just doesn’t work for me (final codeblock runs, no results)

->  much depends on the input data

-> more is better

-> images need to be resized; smaller than 256 x 256

conda activate env
  • convert images to 64×64
    mogrify -resize 64x64 *.jpg
  • make sure there are no grayscale images
    identify -format "%i %[colorspace]\n" *.jpg | grep -v sRGB
    
  • fix those that are:
    convert input.jpg -colorspace sRGB -type truecolor output.jpg
    

    or, to run over the whole lot, in bash (and you might be able to pipe the identify results right into this):

    for f in *.jpg; do
      convert ./"$f" -colorspace sRGB -type truecolor ./"$f"
    done
    
  • and fire that thing off:
    python main.py --dataset images --data_dir data --train --crop

 

Buy a damned GPU