ESTR4998 Final Year Project. This is a head portrait style transfer based on VGG19 neural network feature.
The overall process (we disabled the histogram match in the current version)
The VGG decoder structure.
tensorboardX
pytorch(GPU)
dlib
numpy
opencv-python
pillow
Download weights from this link, then put them under the ./weight directory.
The program was designed only for one input with multiple styles. You can put your input image into the ./test/input folder, put your style references (it should have a clear face which could be regonized by dlib face detector) into the ./test/style directory.
goto the /gainmap directory, run run.py and get result from ./test/result as well as alignment result from ./test/align.
- this program can only test for front face and please make sure the portrait is the main part of the input image.
- There must be many bugs and low efficiency implementation details in this baby project...
Reference paper reading, two parts initially: image alignment and feature gain map (VGG19 based).
TODOLIST:
- Dlib landmark model -> 68 facial landmarks -> test performance of image morphing.
- VGG feature extraction (conv3, conv4, conv5). Visualization of feature, gain map implementation.
- Dlib feature extraction implementation (68 facial landmarks).
- The gain map implementation and stageA transfer process.
- Still confusing about the transpose part and weight balance between two loss terms. Needs DEBUG in ./gainmap/modify.py. The layers used for feature extraction needs furthur confirmation.
Facial landmark detection COMPLETED.
Delaunay trianglation (index vs coordinates) -> further working.
Morphing COMPLETED.
Multilayer feature extraction implementation, not tested yet.
Loss implementaion completed. Future work: back-propagation effectiveness, detail preserving and new style testing.
All layer testing (stated in the paper presentation). No satisfying improvements, time increased.
More samples needed... PLEASE!
Unet-like reconstructor implementation.
Facial detection crop. Experiments around different set of parameters to balance loss terms.
- ADD landmarks -- up to 81+8 now.
- Reconstruction network completed, GPU account is required to train it.
- Reconstruction for VGG works well.
- sift flow used, but get a unsatisfying effect.
- (Future works)) StyLit implementation
Happy progammer's day!
Coordinate Network is uner construction.
Traditional StyLit is needed.
The first part pipeline completed!
Before that, we try to use stylit algorithm to get the detailed high frequency features. Also, we use the texture synthesis method to get the stylized video result.