david-gpu / deep-makeover

Deep learning project to transform male portraits into female and vice versa
MIT License
235 stars 45 forks source link

Asap I can't make my boss more pretty. ))) #1

Closed chapayGhub closed 7 years ago

chapayGhub commented 7 years ago

I'm a newbie in deep learning and found your code very pretty to start dive ))) I found some problem to run next command: python3.5 dm_main.py --run train

You can check my changes in this place: https://github.com/chapayGhub/deep-makeover/tree/feature/test

briefly: in several places

Yooo hooo as result I can started training now!!!

python3.5 dm_main.py --run train:

Connected to pydev debugger (build 163.10154.50)
   69714 source images selected
   78610 target images selected

Generator input (feature) size is 100 x 80 x 3 = 24000
Generator has 0.59M parameters

Discriminator input (feature) size is 100 x 80 x 3 = 24000
Discriminator has 0.84M parameters

Building testing model...
Done.

Model training...
  Progress[  0%], ETA[ 119m], Batch [    0], gene[0.105], disc[1.384] real[0.716] fake[0.669]
    Saved train/batch000000_out.png
  Progress[  1%], ETA[ 117m], Batch [   10], gene[0.083], disc[1.315] real[0.670] fake[0.645]
  Progress[  2%], ETA[ 116m], Batch [   20], gene[0.100], disc[1.304] real[0.705] fake[0.599]
  ..................................................................
  Progress[ 49%], ETA[  60m], Batch [  600], gene[0.096], disc[1.101] real[0.575] fake[0.525]
    Saved train/batch000600_out.png
  Progress[ 50%], ETA[  59m], Batch [  610], gene[0.128], disc[1.274] real[0.603] fake[0.672]
  Progress[ 50%], ETA[  59m], Batch [  620], gene[0.104], disc[1.569] real[0.945] fake[0.624]
  ..................................................................
  Progress[ 95%], ETA[   5m], Batch [  660], gene[0.099], disc[1.356] real[0.754] fake[0.602]
  Progress[225%], ETA[-151m], Batch [  670], gene[0.079], disc[1.350] real[0.572] fake[0.778]
    Checkpoint saved
Finished training!

And we can run: python3 dm_main.py --run inference --infile ../test/arnold.schwarzenegger.jpg --outfile ../test/arnold.schwarzenegger.out.jpg

Don't worry Arnie isn't my boss ))). Only for testing!

And got result: arnold.schwarzenegger.jpg: arnold schwarzenegger 178 218

arnold.schwarzenegger.out.jpg: arnold schwarzenegger 80 100 out

So I have questions:

PS Thank you Your code very readable and moduled, it very help me!

david-gpu commented 7 years ago

Hi. I'm happy you were able to get the code up and running.

The reason you had to make some changes to the source code in order to run is because you are using an older version of Tensorflow. But that shouldn't be a problem.

There are two reasons why Arnold didn't get transformed into Cinderella. First, your training only lasted 670 batches while for the example images I trained the network for 40,000 to 50,000 batches.

After that you also need to crop and align the face such that the eyes are aligned exactly in the same way as the training samples. To see how the eyes should be aligned you can open some of the training outputs that you get in the train folder.

chapayGhub commented 7 years ago

Woooow Thank you

My configuration: MacOs Siera 10.11.6 scipy 0.18.1 numpy 1.12.0 Pillow 4.0.0 TensorFlow v0.12.1

Do you use TensorFlow 1.0.0-rc0?

david-gpu commented 7 years ago

Yes, I used Tensorflow at commit 28f5099 to be exact.