All Projects → adepierre → Caffe_BEGAN

adepierre / Caffe_BEGAN

Licence: MIT license
Caffe/C++ implementation of Boundary Equilibrium Generative Adversarial Networks paper for face generation

Programming Languages

C++
36643 projects - #6 most used programming language
Batchfile
5799 projects
CMake
9771 projects

Projects that are alternatives of or similar to Caffe BEGAN

stylegan2-landmark-projection
Experimental repository attempting to project facial landmarks into the StyleGAN2 latent space.
Stars: ✭ 14 (-36.36%)
Mutual labels:  face-generation
crnn.caffe
crnn.caffe
Stars: ✭ 76 (+245.45%)
Mutual labels:  caffe
Stochastic-Quantization
Training Low-bits DNNs with Stochastic Quantization
Stars: ✭ 70 (+218.18%)
Mutual labels:  caffe
modified refinedet
Modified RefineDet
Stars: ✭ 23 (+4.55%)
Mutual labels:  caffe
colorchecker-detection
Multiple ColorChecker Detection. This code implements a multiple colorChecker detection method, as described in the paper Fast and Robust Multiple ColorChecker Detection.
Stars: ✭ 51 (+131.82%)
Mutual labels:  caffe
crowd density segmentation
The code for preparing the training data for crowd counting / segmentation algorithm.
Stars: ✭ 21 (-4.55%)
Mutual labels:  caffe
arcface retinaface mxnet2onnx
arcface and retinaface model convert mxnet to onnx.
Stars: ✭ 53 (+140.91%)
Mutual labels:  caffe
fooddist
An open-source food image embedding model
Stars: ✭ 26 (+18.18%)
Mutual labels:  caffe
SWCaffe
A Deep Learning Framework customized for Sunway TaihuLight
Stars: ✭ 37 (+68.18%)
Mutual labels:  caffe
caffe-unet-docker
The U-Net Segmentation server (caffe_unet) for Docker
Stars: ✭ 25 (+13.64%)
Mutual labels:  caffe
ck-crowd-scenarios
Public scenarios to crowdsource experiments (such as DNN crowd-benchmarking and crowd-tuning) using Collective Knowledge Framework across diverse mobile devices provided by volunteers. Results are continuously aggregated at the open repository of knowledge:
Stars: ✭ 22 (+0%)
Mutual labels:  caffe
VideoAudit
📹 一个短视频APP视频内容安全审核的思路调研及实现汇总
Stars: ✭ 221 (+904.55%)
Mutual labels:  caffe
Deep-Learning-with-Caffe
My tests and experiments on Caffe, the deep learning framework by Berkeley Vision and Learning Center (BVLC) and its contributors.
Stars: ✭ 30 (+36.36%)
Mutual labels:  caffe
caffe-char-rnn
Multi-layer Recurrent Neural Networks (with LSTM) for character-level language models in Caffe
Stars: ✭ 25 (+13.64%)
Mutual labels:  caffe
fpga caffe
No description or website provided.
Stars: ✭ 116 (+427.27%)
Mutual labels:  caffe
MobileNet-SSD-windows
No description or website provided.
Stars: ✭ 91 (+313.64%)
Mutual labels:  caffe
onnx2caffe
pytorch to caffe by onnx
Stars: ✭ 341 (+1450%)
Mutual labels:  caffe
dehaze
[Preprint] "Improved Techniques for Learning to Dehaze and Beyond: A Collective Study"
Stars: ✭ 46 (+109.09%)
Mutual labels:  caffe
PCN-Windows
No description or website provided.
Stars: ✭ 21 (-4.55%)
Mutual labels:  caffe
caffe-wrn-generator
Caffe Wide-Residual-Network (WRN) Generator
Stars: ✭ 19 (-13.64%)
Mutual labels:  caffe

Caffe_BEGAN: A Caffe/C++ implementation of Boundary Equilibrium Generative Adversarial Networks algorithm for face generation

Implementation of BEGAN algorithm for face generation. Here are some examples (128x128 images) with a model trained on 26 epochs of CelebA dataset (gamma = 0.5). The holes are due to the high gamma value. A smaller value of gamma (as 0.3 for example) would result in better images but with less diversity.

Test result

The evolution of the training from epoch 0 to epoch 25:

Training

Dependencies

This code relies on Caffe main branch with only two slight modifications in solver.hpp:

  • ApplyUpdate function must be moved from protected to public in Solver class definition
  • iter_ must be moved from protected to public in Solver class definition

OpenCV and boost are also used, but you should already have them installed if you have Caffe.

As Caffe doesn't have a L1-Loss layer, I have used existing layers to build the equivalent (the four last layers of launch_files/discriminator.prototxt).

I have only tested this code on Windows with Visual Studio 2015, but it should also be able to run on Linux and OS X provided that Caffe is correctly installed with the above modification.

Building

The project uses CMake as a building tool. Once you have correctly built and compiled the code, you should be abble to launch the program for both training and testing.

Testing

To test a model, set the testing parameters and then launch launch_files/test.bat. A file with the weights of a trained model is provided if you just want to see it generating faces: launch_files/BEGAN_Generator_iter_325000.caffemodel. It will display some images generated from random inputs.

Training

First, you need to create a folder with all the training images. You can have as many images as you want (jpg, png or bmp): they are loaded and unloaded on a separate thread during training so you do not need tens of Gb of RAM. If you want to use CelebA dataset, please use the aligned and cropped images because the program will always use only the center 128x128 pixels (or the whole image if it is smaller) and resize it to the desired size.

Then you can train a model: set the training parameters as you want and then launch launch_files/train.bat. Images are saved (5 per epoch) to show the evolution of the learning process. Loss values are also saved in a csv file to monitor the training. Prototxt files (generator.prototxt and discriminator.prototxt) are regenerated everytime the program is launched (because they have to change with batch size, image size, input dimension ...).

During training, several files are created:

  • caffemodel and solverstate to save networks states
  • k_t files to save k_t values along with caffe snapshots
  • log file to save losses
  • preview_values.csv to keep the random inputs used to display images during training

All those files are used if you want to stop the training and continue it later (it took me almost 3 days to train the above 128x128 model on a Nvidia GTX 1070).

If everything is correct, your learning curves should look like those ones:

Training Curve Convergence

Training Curve k_t

Resuming Training

To resume training, you just need to add the snapshosts parameters to the train.bat file and launch it again. If the program finds the log file and the preview_values file, they should be loaded as well. New ones are created otherwise (so you won't have consistent faces between the images before and after you stop).

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].