├── README.md
├── closed_form_matting.py
├── deep_photostyle.py
├── examples
├── final_results
│ ├── best10_t_1000.png
│ ├── best11_t_1000.png
│ ├── best12_t_1000.png
│ ├── best13_t_1000.png
│ ├── best14_t_1000.png
│ ├── best15_t_1000.png
│ ├── best16_t_1000.png
│ ├── best17_t_1000.png
│ ├── best18_t_1000.png
│ ├── best19_t_1000.png
│ ├── best1_t_1000.png
│ ├── best20_t_1000.png
│ ├── best21_t_1000.png
│ ├── best22_t_1000.png
│ ├── best23_t_1000.png
│ ├── best24_t_1000.png
│ ├── best25_t_1000.png
│ ├── best26_t_1000.png
│ ├── best27_t_1000.png
│ ├── best28_t_1000.png
│ ├── best29_t_1000.png
│ ├── best2_t_1000.png
│ ├── best30_t_1000.png
│ ├── best31_t_1000.png
│ ├── best32_t_1000.png
│ ├── best33_t_1000.png
│ ├── best34_t_1000.png
│ ├── best35_t_1000.png
│ ├── best36_t_1000.png
│ ├── best37_t_1000.png
│ ├── best38_t_1000.png
│ ├── best39_t_1000.png
│ ├── best3_t_1000.png
│ ├── best40_t_1000.png
│ ├── best41_t_1000.png
│ ├── best42_t_1000.png
│ ├── best43_t_1000.png
│ ├── best44_t_1000.png
│ ├── best45_t_1000.png
│ ├── best46_t_1000.png
│ ├── best47_t_1000.png
│ ├── best48_t_1000.png
│ ├── best49_t_1000.png
│ ├── best4_t_1000.png
│ ├── best50_t_1000.png
│ ├── best51_t_1000.png
│ ├── best52_t_1000.png
│ ├── best53_t_1000.png
│ ├── best54_t_1000.png
│ ├── best55_t_1000.png
│ ├── best56_t_1000.png
│ ├── best57_t_1000.png
│ ├── best58_t_1000.png
│ ├── best59_t_1000.png
│ ├── best5_t_1000.png
│ ├── best60_t_1000.png
│ ├── best6_t_1000.png
│ ├── best7_t_1000.png
│ ├── best8_t_1000.png
│ └── best9_t_1000.png
├── high_res
│ ├── 1
│ │ ├── input.png
│ │ ├── output.png
│ │ └── style.png
│ ├── 2
│ │ ├── input.jpg
│ │ ├── output.png
│ │ └── style.png
│ ├── 3
│ │ ├── input.jpg
│ │ ├── output.png
│ │ └── style.png
│ ├── 4
│ │ ├── input.png
│ │ ├── output.png
│ │ └── style.png
│ └── 5
│ │ ├── input.jpg
│ │ ├── output.png
│ │ └── style.png
├── input
│ ├── in1.png
│ ├── in10.png
│ ├── in11.png
│ ├── in12.png
│ ├── in13.png
│ ├── in14.png
│ ├── in15.png
│ ├── in16.png
│ ├── in17.png
│ ├── in18.png
│ ├── in19.png
│ ├── in2.png
│ ├── in20.png
│ ├── in21.png
│ ├── in22.png
│ ├── in23.png
│ ├── in24.png
│ ├── in25.png
│ ├── in26.png
│ ├── in27.png
│ ├── in28.png
│ ├── in29.png
│ ├── in3.png
│ ├── in30.png
│ ├── in31.png
│ ├── in32.png
│ ├── in33.png
│ ├── in34.png
│ ├── in35.png
│ ├── in36.png
│ ├── in37.png
│ ├── in38.png
│ ├── in39.png
│ ├── in4.png
│ ├── in40.png
│ ├── in41.png
│ ├── in42.png
│ ├── in43.png
│ ├── in44.png
│ ├── in45.png
│ ├── in46.png
│ ├── in47.png
│ ├── in48.png
│ ├── in49.png
│ ├── in5.png
│ ├── in50.png
│ ├── in51.png
│ ├── in52.png
│ ├── in53.png
│ ├── in54.png
│ ├── in55.png
│ ├── in56.png
│ ├── in57.png
│ ├── in58.png
│ ├── in59.png
│ ├── in6.png
│ ├── in60.png
│ ├── in7.png
│ ├── in8.png
│ └── in9.png
├── readme_examples
│ └── intar5.png
├── segmentation
│ ├── in1.png
│ ├── in10.png
│ ├── in11.png
│ ├── in12.png
│ ├── in13.png
│ ├── in14.png
│ ├── in15.png
│ ├── in16.png
│ ├── in17.png
│ ├── in18.png
│ ├── in19.png
│ ├── in2.png
│ ├── in20.png
│ ├── in21.png
│ ├── in22.png
│ ├── in23.png
│ ├── in24.png
│ ├── in25.png
│ ├── in26.png
│ ├── in27.png
│ ├── in28.png
│ ├── in29.png
│ ├── in3.png
│ ├── in30.png
│ ├── in31.png
│ ├── in32.png
│ ├── in33.png
│ ├── in34.png
│ ├── in35.png
│ ├── in36.png
│ ├── in37.png
│ ├── in38.png
│ ├── in39.png
│ ├── in4.png
│ ├── in40.png
│ ├── in41.png
│ ├── in42.png
│ ├── in43.png
│ ├── in44.png
│ ├── in45.png
│ ├── in46.png
│ ├── in47.png
│ ├── in48.png
│ ├── in49.png
│ ├── in5.png
│ ├── in50.png
│ ├── in51.png
│ ├── in52.png
│ ├── in53.png
│ ├── in54.png
│ ├── in55.png
│ ├── in56.png
│ ├── in57.png
│ ├── in58.png
│ ├── in59.png
│ ├── in6.png
│ ├── in60.png
│ ├── in7.png
│ ├── in8.png
│ ├── in9.png
│ ├── tar1.png
│ ├── tar10.png
│ ├── tar11.png
│ ├── tar12.png
│ ├── tar13.png
│ ├── tar14.png
│ ├── tar15.png
│ ├── tar16.png
│ ├── tar17.png
│ ├── tar18.png
│ ├── tar19.png
│ ├── tar2.png
│ ├── tar20.png
│ ├── tar21.png
│ ├── tar22.png
│ ├── tar23.png
│ ├── tar24.png
│ ├── tar25.png
│ ├── tar26.png
│ ├── tar27.png
│ ├── tar28.png
│ ├── tar29.png
│ ├── tar3.png
│ ├── tar30.png
│ ├── tar31.png
│ ├── tar32.png
│ ├── tar33.png
│ ├── tar34.png
│ ├── tar35.png
│ ├── tar36.png
│ ├── tar37.png
│ ├── tar38.png
│ ├── tar39.png
│ ├── tar4.png
│ ├── tar40.png
│ ├── tar41.png
│ ├── tar42.png
│ ├── tar43.png
│ ├── tar44.png
│ ├── tar45.png
│ ├── tar46.png
│ ├── tar47.png
│ ├── tar48.png
│ ├── tar49.png
│ ├── tar5.png
│ ├── tar50.png
│ ├── tar51.png
│ ├── tar52.png
│ ├── tar53.png
│ ├── tar54.png
│ ├── tar55.png
│ ├── tar56.png
│ ├── tar57.png
│ ├── tar58.png
│ ├── tar59.png
│ ├── tar6.png
│ ├── tar60.png
│ ├── tar7.png
│ ├── tar8.png
│ └── tar9.png
├── style
│ ├── tar1.png
│ ├── tar10.png
│ ├── tar11.png
│ ├── tar12.png
│ ├── tar13.png
│ ├── tar14.png
│ ├── tar15.png
│ ├── tar16.png
│ ├── tar17.png
│ ├── tar18.png
│ ├── tar19.png
│ ├── tar2.png
│ ├── tar20.png
│ ├── tar21.png
│ ├── tar22.png
│ ├── tar23.png
│ ├── tar24.png
│ ├── tar25.png
│ ├── tar26.png
│ ├── tar27.png
│ ├── tar28.png
│ ├── tar29.png
│ ├── tar3.png
│ ├── tar30.png
│ ├── tar31.png
│ ├── tar32.png
│ ├── tar33.png
│ ├── tar34.png
│ ├── tar35.png
│ ├── tar36.png
│ ├── tar37.png
│ ├── tar38.png
│ ├── tar39.png
│ ├── tar4.png
│ ├── tar40.png
│ ├── tar41.png
│ ├── tar42.png
│ ├── tar43.png
│ ├── tar44.png
│ ├── tar45.png
│ ├── tar46.png
│ ├── tar47.png
│ ├── tar48.png
│ ├── tar49.png
│ ├── tar5.png
│ ├── tar50.png
│ ├── tar51.png
│ ├── tar52.png
│ ├── tar53.png
│ ├── tar54.png
│ ├── tar55.png
│ ├── tar56.png
│ ├── tar57.png
│ ├── tar58.png
│ ├── tar59.png
│ ├── tar6.png
│ ├── tar60.png
│ ├── tar7.png
│ ├── tar8.png
│ └── tar9.png
└── tmp_results
│ ├── out10_t_1000.png
│ ├── out11_t_1000.png
│ ├── out12_t_1000.png
│ ├── out13_t_1000.png
│ ├── out14_t_1000.png
│ ├── out15_t_1000.png
│ ├── out16_t_1000.png
│ ├── out17_t_1000.png
│ ├── out18_t_1000.png
│ ├── out19_t_1000.png
│ ├── out1_t_1000.png
│ ├── out20_t_1000.png
│ ├── out21_t_1000.png
│ ├── out22_t_1000.png
│ ├── out23_t_1000.png
│ ├── out24_t_1000.png
│ ├── out25_t_1000.png
│ ├── out26_t_1000.png
│ ├── out27_t_1000.png
│ ├── out28_t_1000.png
│ ├── out29_t_1000.png
│ ├── out2_t_1000.png
│ ├── out30_t_1000.png
│ ├── out31_t_1000.png
│ ├── out32_t_1000.png
│ ├── out33_t_1000.png
│ ├── out34_t_1000.png
│ ├── out35_t_1000.png
│ ├── out36_t_1000.png
│ ├── out37_t_1000.png
│ ├── out38_t_1000.png
│ ├── out39_t_1000.png
│ ├── out3_t_1000.png
│ ├── out40_t_1000.png
│ ├── out41_t_1000.png
│ ├── out42_t_1000.png
│ ├── out43_t_1000.png
│ ├── out44_t_1000.png
│ ├── out45_t_1000.png
│ ├── out46_t_1000.png
│ ├── out47_t_1000.png
│ ├── out48_t_1000.png
│ ├── out49_t_1000.png
│ ├── out4_t_1000.png
│ ├── out50_t_1000.png
│ ├── out51_t_1000.png
│ ├── out52_t_1000.png
│ ├── out53_t_1000.png
│ ├── out54_t_1000.png
│ ├── out55_t_1000.png
│ ├── out56_t_1000.png
│ ├── out57_t_1000.png
│ ├── out58_t_1000.png
│ ├── out59_t_1000.png
│ ├── out5_t_1000.png
│ ├── out60_t_1000.png
│ ├── out6_t_1000.png
│ ├── out7_t_1000.png
│ ├── out8_t_1000.png
│ └── out9_t_1000.png
├── photo_style.py
├── smooth_local_affine.py
├── some_results
├── best10.png
├── best11.png
├── best5.png
├── best6.png
├── best7.png
├── best8.png
└── best9.png
└── vgg19
├── __init__.py
└── vgg.py
/README.md:
--------------------------------------------------------------------------------
1 | # deep-photo-styletransfer-tf
2 |
3 | This is a pure Tensorflow implementation of [Deep Photo Styletransfer](https://arxiv.org/abs/1703.07511), the torch implementation could be found [here](https://github.com/luanfujun/deep-photo-styletransfer)
4 |
5 | This implementation support [L-BFGS-B](https://www.tensorflow.org/api_docs/python/tf/contrib/opt/ScipyOptimizerInterface) (which is what the original authors used) and [Adam](https://www.tensorflow.org/api_docs/python/tf/train/AdamOptimizer) in case the ScipyOptimizerInterface incompatible when Tensorflow upgrades to higher version.
6 |
7 | This implementation may seem to be a little bit simpler thanks to Tensorflow's [automatic differentiation](https://en.wikipedia.org/wiki/Automatic_differentiation)
8 |
9 | Additionally, there is no dependency on MATLAB thanks to another [repository](https://github.com/martinbenson/deep-photo-styletransfer/blob/master/deep_photo.py) computing Matting Laplacian Sparse Matrix. Below is example of transferring the photo style to another photograph.
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## Disclaimer
17 | **This software is published for academic and non-commercial use only.**
18 |
19 | ## Setup
20 | ### Dependencies
21 | * [Tensorflow](https://www.tensorflow.org/)
22 | * [Numpy](www.numpy.org/)
23 | * [Pillow](https://pypi.python.org/pypi/Pillow/)
24 | * [Scipy](https://www.scipy.org/)
25 | * [PyCUDA](https://pypi.python.org/pypi/pycuda) (used in smooth local affine, tested on CUDA 8.0)
26 |
27 | ***It is recommended to use [Anaconda Python](https://www.continuum.io/anaconda-overview), since you only need to install Tensorflow and PyCUDA manually to setup. The CUDA is optional but really recommended***
28 |
29 | ### Download the VGG-19 model weights
30 | The VGG-19 model of tensorflow is adopted from [VGG Tensorflow](https://github.com/machrisaa/tensorflow-vgg) with few modifications on the class interface. The VGG-19 model weights is stored as .npy file and could be download from [Google Drive](https://drive.google.com/file/d/0BxvKyd83BJjYY01PYi1XQjB5R0E/view?usp=sharing&resourcekey=0-Q2AewV9J7IYVNUDSnwPuCA) or [BaiduYun Pan](https://pan.baidu.com/s/1o9weflK). After downloading, copy the weight file to the **./project/vgg19** directory
31 |
32 | ## Usage
33 | ### Basic Usage
34 | You need to specify the path of content image, style image, content image segmentation, style image segmentation and then run the command
35 |
36 | ```
37 | python deep_photostyle.py --content_image_path --style_image_path --content_seg_path --style_seg_path --style_option 2
38 | ```
39 |
40 | *Example:*
41 | ```
42 | python deep_photostyle.py --content_image_path ./examples/input/in11.png --style_image_path ./examples/style/tar11.png --content_seg_path ./examples/segmentation/in11.png --style_seg_path ./examples/segmentation/tar11.png --style_option 2
43 | ```
44 |
45 | ### Other Options
46 |
47 | `--style_option` specifies three different ways of style transferring. `--style_option 0` is to generate segmented intermediate result like torch file **neuralstyle_seg.lua** in torch. `--style_option 1` uses this intermediate result to generate final result like torch file **deepmatting_seg.lua**. `--style_option 2` combines these two steps as a one line command to generate the final result directly.
48 |
49 | `--content_weight` specifies the weight of the content loss (default=5), `--style_weight` specifies the weight of the style loss (default=100), `--tv_weight` specifies the weight of variational loss (default=1e-3) and `--affine_weight` specifies the weight of affine loss (default=1e4). You can change the values of these weight and play with them to create different photos.
50 |
51 | `--serial` specifies the folder that you want to store the temporary result **out_iter_XXX.png**. The default value of it is `./`. You can simply `mkdir result` and set `--serial ./result` to store them. **Again, the temporary results are simply clipping the image into [0, 255] without smoothing. Since for now, the smoothing operations need pycuda and pycuda will have conflict with tensorflow when using single GPU**
52 |
53 | Run `python deep_photostyle.py --help` to see a list of all options
54 |
55 | ### Image Segmentation
56 | This repository doesn't offer image segmentation script and simply use the segmentation image from the [torch version](https://github.com/luanfujun/deep-photo-styletransfer). The mask colors used are also the same as them. You could specify your own segmentation model and mask color to customize your own style transfer.
57 |
58 |
59 | ## Examples
60 | Here are more results from tensorflow algorithm (from left to right are input, style, torch results and tensorflow results)
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | ## Acknowledgement
105 |
106 | * This work was done when Yang Liu was a research intern at *Alibaba-Zhejiang University Joint Research Institute of Frontier Technologies*, under the supervision of [Prof. Mingli Song](http://person.zju.edu.cn/en/msong) and [Yongcheng Jing](http://yongchengjing.com/).
107 |
108 | * Our tensorflow implementation basically follows the [torch code](https://github.com/luanfujun/deep-photo-styletransfer).
109 |
110 | * We use [martinbenson](https://github.com/martinbenson)'s [python code](https://github.com/martinbenson/deep-photo-styletransfer/blob/master/deep_photo.py) to compute Matting Laplacian.
111 |
112 | ## Citation
113 | If you find this code useful for your research, please cite:
114 | ```
115 | @misc{YangPhotoStyle2017,
116 | author = {Yang Liu},
117 | title = {deep-photo-style-transfer-tf},
118 | publisher = {GitHub},
119 | organization={Alibaba-Zhejiang University Joint Research Institute of Frontier Technologies},
120 | year = {2017},
121 | howpublished = {\url{https://github.com/LouieYang/deep-photo-styletransfer-tf}}
122 | }
123 | ```
124 |
125 | ## Contact
126 | Feel free to contact me if there is any question (Yang Liu lyng_95@zju.edu.cn).
127 |
--------------------------------------------------------------------------------
/closed_form_matting.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 | import argparse
3 | import os
4 | import scipy.misc as spm
5 | import scipy.ndimage as spi
6 | import scipy.sparse as sps
7 | import numpy as np
8 | import tensorflow as tf
9 |
10 | def getlaplacian1(i_arr, consts, epsilon=1e-5, win_rad=1):
11 | neb_size = (win_rad * 2 + 1) ** 2
12 | h, w, c = i_arr.shape
13 | img_size = w * h
14 | consts = spi.morphology.grey_erosion(consts, footprint=np.ones(shape=(win_rad * 2 + 1, win_rad * 2 + 1)))
15 |
16 | indsM = np.reshape(np.array(range(img_size)), newshape=(h, w), order='F')
17 | tlen = int((-consts[win_rad:-win_rad, win_rad:-win_rad] + 1).sum() * (neb_size ** 2))
18 | row_inds = np.zeros(tlen)
19 | col_inds = np.zeros(tlen)
20 | vals = np.zeros(tlen)
21 | l = 0
22 | for j in range(win_rad, w - win_rad):
23 | for i in range(win_rad, h - win_rad):
24 | if consts[i, j]:
25 | continue
26 | win_inds = indsM[i - win_rad:i + win_rad + 1, j - win_rad: j + win_rad + 1]
27 | win_inds = win_inds.ravel(order='F')
28 | win_i = i_arr[i - win_rad:i + win_rad + 1, j - win_rad: j + win_rad + 1, :]
29 | win_i = win_i.reshape((neb_size, c), order='F')
30 | win_mu = np.mean(win_i, axis=0).reshape(c, 1)
31 | win_var = np.linalg.inv(
32 | np.matmul(win_i.T, win_i) / neb_size - np.matmul(win_mu, win_mu.T) + epsilon / neb_size * np.identity(
33 | c))
34 |
35 | win_i2 = win_i - np.repeat(win_mu.transpose(), neb_size, 0)
36 | tvals = (1 + np.matmul(np.matmul(win_i2, win_var), win_i2.T)) / neb_size
37 |
38 | ind_mat = np.broadcast_to(win_inds, (neb_size, neb_size))
39 | row_inds[l: (neb_size ** 2 + l)] = ind_mat.ravel(order='C')
40 | col_inds[l: neb_size ** 2 + l] = ind_mat.ravel(order='F')
41 | vals[l: neb_size ** 2 + l] = tvals.ravel(order='F')
42 | l += neb_size ** 2
43 |
44 | vals = vals.ravel(order='F')[0: l]
45 | row_inds = row_inds.ravel(order='F')[0: l]
46 | col_inds = col_inds.ravel(order='F')[0: l]
47 | a_sparse = sps.csr_matrix((vals, (row_inds, col_inds)), shape=(img_size, img_size))
48 |
49 | sum_a = a_sparse.sum(axis=1).T.tolist()[0]
50 | a_sparse = sps.diags([sum_a], [0], shape=(img_size, img_size)) - a_sparse
51 |
52 | return a_sparse
53 |
54 | def getLaplacian(img):
55 | h, w, _ = img.shape
56 | coo = getlaplacian1(img, np.zeros(shape=(h, w)), 1e-5, 1).tocoo()
57 | indices = np.mat([coo.row, coo.col]).transpose()
58 | return tf.SparseTensor(indices, coo.data, coo.shape)
59 |
--------------------------------------------------------------------------------
/deep_photostyle.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | from PIL import Image
3 | import numpy as np
4 | import os
5 | from photo_style import stylize
6 |
7 | parser = argparse.ArgumentParser()
8 | # Input Options
9 | parser.add_argument("--content_image_path", dest='content_image_path', nargs='?',
10 | help="Path to the content image")
11 | parser.add_argument("--style_image_path", dest='style_image_path', nargs='?',
12 | help="Path to the style image")
13 | parser.add_argument("--content_seg_path", dest='content_seg_path', nargs='?',
14 | help="Path to the style segmentation")
15 | parser.add_argument("--style_seg_path", dest='style_seg_path', nargs='?',
16 | help="Path to the style segmentation")
17 | parser.add_argument("--init_image_path", dest='init_image_path', nargs='?',
18 | help="Path to init image", default="")
19 | parser.add_argument("--output_image", dest='output_image', nargs='?',
20 | help='Path to output the stylized image', default="best_stylized.png")
21 | parser.add_argument("--serial", dest='serial', nargs='?',
22 | help='Path to save the serial out_iter_X.png', default='./')
23 |
24 | # Training Optimizer Options
25 | parser.add_argument("--max_iter", dest='max_iter', nargs='?', type=int,
26 | help='maximum image iteration', default=1000)
27 | parser.add_argument("--learning_rate", dest='learning_rate', nargs='?', type=float,
28 | help='learning rate for adam optimizer', default=1.0)
29 | parser.add_argument("--print_iter", dest='print_iter', nargs='?', type=int,
30 | help='print loss per iterations', default=1)
31 | # Note the result might not be smooth enough since not applying smooth for temp result
32 | parser.add_argument("--save_iter", dest='save_iter', nargs='?', type=int,
33 | help='save temporary result per iterations', default=100)
34 | parser.add_argument("--lbfgs", dest='lbfgs', nargs='?',
35 | help="True=lbfgs, False=Adam", default=True)
36 |
37 | # Weight Options
38 | parser.add_argument("--content_weight", dest='content_weight', nargs='?', type=float,
39 | help="weight of content loss", default=5e0)
40 | parser.add_argument("--style_weight", dest='style_weight', nargs='?', type=float,
41 | help="weight of style loss", default=1e2)
42 | parser.add_argument("--tv_weight", dest='tv_weight', nargs='?', type=float,
43 | help="weight of total variational loss", default=1e-3)
44 | parser.add_argument("--affine_weight", dest='affine_weight', nargs='?', type=float,
45 | help="weight of affine loss", default=1e4)
46 |
47 | # Style Options
48 | parser.add_argument("--style_option", dest='style_option', nargs='?', type=int,
49 | help="0=non-Matting, 1=only Matting, 2=first non-Matting, then Matting", default=0)
50 | parser.add_argument("--apply_smooth", dest='apply_smooth', nargs='?',
51 | help="if apply local affine smooth", default=True)
52 |
53 | # Smoothing Argument
54 | parser.add_argument("--f_radius", dest='f_radius', nargs='?', type=int,
55 | help="smooth argument", default=15)
56 | parser.add_argument("--f_edge", dest='f_edge', nargs='?', type=float,
57 | help="smooth argument", default=1e-1)
58 |
59 | args = parser.parse_args()
60 |
61 | def main():
62 | if args.style_option == 0:
63 | best_image_bgr = stylize(args, False)
64 | result = Image.fromarray(np.uint8(np.clip(best_image_bgr[:, :, ::-1], 0, 255.0)))
65 | result.save(args.output_image)
66 | elif args.style_option == 1:
67 | best_image_bgr = stylize(args, True)
68 | if not args.apply_smooth:
69 | result = Image.fromarray(np.uint8(np.clip(best_image_bgr[:, :, ::-1], 0, 255.0)))
70 | result.save(args.output_image)
71 | else:
72 | # Pycuda runtime incompatible with Tensorflow
73 | from smooth_local_affine import smooth_local_affine
74 | content_input = np.array(Image.open(args.content_image_path).convert("RGB"), dtype=np.float32)
75 | # RGB to BGR
76 | content_input = content_input[:, :, ::-1]
77 | # H * W * C to C * H * W
78 | content_input = content_input.transpose((2, 0, 1))
79 | input_ = np.ascontiguousarray(content_input, dtype=np.float32) / 255.
80 |
81 | _, H, W = np.shape(input_)
82 |
83 | output_ = np.ascontiguousarray(best_image_bgr.transpose((2, 0, 1)), dtype=np.float32) / 255.
84 | best_ = smooth_local_affine(output_, input_, 1e-7, 3, H, W, args.f_radius, args.f_edge).transpose(1, 2, 0)
85 | result = Image.fromarray(np.uint8(np.clip(best_ * 255., 0, 255.)))
86 | result.save(args.output_image)
87 | elif args.style_option == 2:
88 | args.max_iter = 2 * args.max_iter
89 | tmp_image_bgr = stylize(args, False)
90 | result = Image.fromarray(np.uint8(np.clip(tmp_image_bgr[:, :, ::-1], 0, 255.0)))
91 | args.init_image_path = os.path.join(args.serial, "tmp_result.png")
92 | result.save(args.init_image_path)
93 |
94 | best_image_bgr = stylize(args, True)
95 | if not args.apply_smooth:
96 | result = Image.fromarray(np.uint8(np.clip(best_image_bgr[:, :, ::-1], 0, 255.0)))
97 | result.save(args.output_image)
98 | else:
99 | from smooth_local_affine import smooth_local_affine
100 | content_input = np.array(Image.open(args.content_image_path).convert("RGB"), dtype=np.float32)
101 | # RGB to BGR
102 | content_input = content_input[:, :, ::-1]
103 | # H * W * C to C * H * W
104 | content_input = content_input.transpose((2, 0, 1))
105 | input_ = np.ascontiguousarray(content_input, dtype=np.float32) / 255.
106 |
107 | _, H, W = np.shape(input_)
108 |
109 | output_ = np.ascontiguousarray(best_image_bgr.transpose((2, 0, 1)), dtype=np.float32) / 255.
110 | best_ = smooth_local_affine(output_, input_, 1e-7, 3, H, W, args.f_radius, args.f_edge).transpose(1, 2, 0)
111 | result = Image.fromarray(np.uint8(np.clip(best_ * 255., 0, 255.)))
112 | result.save(args.output_image)
113 |
114 | if __name__ == "__main__":
115 | main()
116 |
--------------------------------------------------------------------------------
/examples/final_results/best10_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best10_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best11_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best11_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best12_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best12_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best13_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best13_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best14_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best14_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best15_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best15_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best16_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best16_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best17_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best17_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best18_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best18_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best19_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best19_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best1_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best1_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best20_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best20_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best21_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best21_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best22_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best22_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best23_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best23_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best24_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best24_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best25_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best25_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best26_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best26_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best27_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best27_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best28_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best28_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best29_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best29_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best2_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best2_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best30_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best30_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best31_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best31_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best32_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best32_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best33_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best33_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best34_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best34_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best35_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best35_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best36_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best36_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best37_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best37_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best38_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best38_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best39_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best39_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best3_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best3_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best40_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best40_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best41_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best41_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best42_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best42_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best43_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best43_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best44_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best44_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best45_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best45_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best46_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best46_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best47_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best47_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best48_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best48_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best49_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best49_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best4_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best4_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best50_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best50_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best51_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best51_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best52_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best52_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best53_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best53_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best54_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best54_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best55_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best55_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best56_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best56_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best57_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best57_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best58_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best58_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best59_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best59_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best5_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best5_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best60_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best60_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best6_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best6_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best7_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best7_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best8_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best8_t_1000.png
--------------------------------------------------------------------------------
/examples/final_results/best9_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/final_results/best9_t_1000.png
--------------------------------------------------------------------------------
/examples/high_res/1/input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/1/input.png
--------------------------------------------------------------------------------
/examples/high_res/1/output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/1/output.png
--------------------------------------------------------------------------------
/examples/high_res/1/style.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/1/style.png
--------------------------------------------------------------------------------
/examples/high_res/2/input.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/2/input.jpg
--------------------------------------------------------------------------------
/examples/high_res/2/output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/2/output.png
--------------------------------------------------------------------------------
/examples/high_res/2/style.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/2/style.png
--------------------------------------------------------------------------------
/examples/high_res/3/input.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/3/input.jpg
--------------------------------------------------------------------------------
/examples/high_res/3/output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/3/output.png
--------------------------------------------------------------------------------
/examples/high_res/3/style.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/3/style.png
--------------------------------------------------------------------------------
/examples/high_res/4/input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/4/input.png
--------------------------------------------------------------------------------
/examples/high_res/4/output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/4/output.png
--------------------------------------------------------------------------------
/examples/high_res/4/style.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/4/style.png
--------------------------------------------------------------------------------
/examples/high_res/5/input.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/5/input.jpg
--------------------------------------------------------------------------------
/examples/high_res/5/output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/5/output.png
--------------------------------------------------------------------------------
/examples/high_res/5/style.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/high_res/5/style.png
--------------------------------------------------------------------------------
/examples/input/in1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in1.png
--------------------------------------------------------------------------------
/examples/input/in10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in10.png
--------------------------------------------------------------------------------
/examples/input/in11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in11.png
--------------------------------------------------------------------------------
/examples/input/in12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in12.png
--------------------------------------------------------------------------------
/examples/input/in13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in13.png
--------------------------------------------------------------------------------
/examples/input/in14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in14.png
--------------------------------------------------------------------------------
/examples/input/in15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in15.png
--------------------------------------------------------------------------------
/examples/input/in16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in16.png
--------------------------------------------------------------------------------
/examples/input/in17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in17.png
--------------------------------------------------------------------------------
/examples/input/in18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in18.png
--------------------------------------------------------------------------------
/examples/input/in19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in19.png
--------------------------------------------------------------------------------
/examples/input/in2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in2.png
--------------------------------------------------------------------------------
/examples/input/in20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in20.png
--------------------------------------------------------------------------------
/examples/input/in21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in21.png
--------------------------------------------------------------------------------
/examples/input/in22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in22.png
--------------------------------------------------------------------------------
/examples/input/in23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in23.png
--------------------------------------------------------------------------------
/examples/input/in24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in24.png
--------------------------------------------------------------------------------
/examples/input/in25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in25.png
--------------------------------------------------------------------------------
/examples/input/in26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in26.png
--------------------------------------------------------------------------------
/examples/input/in27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in27.png
--------------------------------------------------------------------------------
/examples/input/in28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in28.png
--------------------------------------------------------------------------------
/examples/input/in29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in29.png
--------------------------------------------------------------------------------
/examples/input/in3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in3.png
--------------------------------------------------------------------------------
/examples/input/in30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in30.png
--------------------------------------------------------------------------------
/examples/input/in31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in31.png
--------------------------------------------------------------------------------
/examples/input/in32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in32.png
--------------------------------------------------------------------------------
/examples/input/in33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in33.png
--------------------------------------------------------------------------------
/examples/input/in34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in34.png
--------------------------------------------------------------------------------
/examples/input/in35.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in35.png
--------------------------------------------------------------------------------
/examples/input/in36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in36.png
--------------------------------------------------------------------------------
/examples/input/in37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in37.png
--------------------------------------------------------------------------------
/examples/input/in38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in38.png
--------------------------------------------------------------------------------
/examples/input/in39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in39.png
--------------------------------------------------------------------------------
/examples/input/in4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in4.png
--------------------------------------------------------------------------------
/examples/input/in40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in40.png
--------------------------------------------------------------------------------
/examples/input/in41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in41.png
--------------------------------------------------------------------------------
/examples/input/in42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in42.png
--------------------------------------------------------------------------------
/examples/input/in43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in43.png
--------------------------------------------------------------------------------
/examples/input/in44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in44.png
--------------------------------------------------------------------------------
/examples/input/in45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in45.png
--------------------------------------------------------------------------------
/examples/input/in46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in46.png
--------------------------------------------------------------------------------
/examples/input/in47.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in47.png
--------------------------------------------------------------------------------
/examples/input/in48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in48.png
--------------------------------------------------------------------------------
/examples/input/in49.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in49.png
--------------------------------------------------------------------------------
/examples/input/in5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in5.png
--------------------------------------------------------------------------------
/examples/input/in50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in50.png
--------------------------------------------------------------------------------
/examples/input/in51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in51.png
--------------------------------------------------------------------------------
/examples/input/in52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in52.png
--------------------------------------------------------------------------------
/examples/input/in53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in53.png
--------------------------------------------------------------------------------
/examples/input/in54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in54.png
--------------------------------------------------------------------------------
/examples/input/in55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in55.png
--------------------------------------------------------------------------------
/examples/input/in56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in56.png
--------------------------------------------------------------------------------
/examples/input/in57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in57.png
--------------------------------------------------------------------------------
/examples/input/in58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in58.png
--------------------------------------------------------------------------------
/examples/input/in59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in59.png
--------------------------------------------------------------------------------
/examples/input/in6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in6.png
--------------------------------------------------------------------------------
/examples/input/in60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in60.png
--------------------------------------------------------------------------------
/examples/input/in7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in7.png
--------------------------------------------------------------------------------
/examples/input/in8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in8.png
--------------------------------------------------------------------------------
/examples/input/in9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/input/in9.png
--------------------------------------------------------------------------------
/examples/readme_examples/intar5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/readme_examples/intar5.png
--------------------------------------------------------------------------------
/examples/segmentation/in1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in1.png
--------------------------------------------------------------------------------
/examples/segmentation/in10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in10.png
--------------------------------------------------------------------------------
/examples/segmentation/in11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in11.png
--------------------------------------------------------------------------------
/examples/segmentation/in12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in12.png
--------------------------------------------------------------------------------
/examples/segmentation/in13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in13.png
--------------------------------------------------------------------------------
/examples/segmentation/in14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in14.png
--------------------------------------------------------------------------------
/examples/segmentation/in15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in15.png
--------------------------------------------------------------------------------
/examples/segmentation/in16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in16.png
--------------------------------------------------------------------------------
/examples/segmentation/in17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in17.png
--------------------------------------------------------------------------------
/examples/segmentation/in18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in18.png
--------------------------------------------------------------------------------
/examples/segmentation/in19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in19.png
--------------------------------------------------------------------------------
/examples/segmentation/in2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in2.png
--------------------------------------------------------------------------------
/examples/segmentation/in20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in20.png
--------------------------------------------------------------------------------
/examples/segmentation/in21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in21.png
--------------------------------------------------------------------------------
/examples/segmentation/in22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in22.png
--------------------------------------------------------------------------------
/examples/segmentation/in23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in23.png
--------------------------------------------------------------------------------
/examples/segmentation/in24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in24.png
--------------------------------------------------------------------------------
/examples/segmentation/in25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in25.png
--------------------------------------------------------------------------------
/examples/segmentation/in26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in26.png
--------------------------------------------------------------------------------
/examples/segmentation/in27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in27.png
--------------------------------------------------------------------------------
/examples/segmentation/in28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in28.png
--------------------------------------------------------------------------------
/examples/segmentation/in29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in29.png
--------------------------------------------------------------------------------
/examples/segmentation/in3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in3.png
--------------------------------------------------------------------------------
/examples/segmentation/in30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in30.png
--------------------------------------------------------------------------------
/examples/segmentation/in31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in31.png
--------------------------------------------------------------------------------
/examples/segmentation/in32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in32.png
--------------------------------------------------------------------------------
/examples/segmentation/in33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in33.png
--------------------------------------------------------------------------------
/examples/segmentation/in34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in34.png
--------------------------------------------------------------------------------
/examples/segmentation/in35.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in35.png
--------------------------------------------------------------------------------
/examples/segmentation/in36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in36.png
--------------------------------------------------------------------------------
/examples/segmentation/in37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in37.png
--------------------------------------------------------------------------------
/examples/segmentation/in38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in38.png
--------------------------------------------------------------------------------
/examples/segmentation/in39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in39.png
--------------------------------------------------------------------------------
/examples/segmentation/in4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in4.png
--------------------------------------------------------------------------------
/examples/segmentation/in40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in40.png
--------------------------------------------------------------------------------
/examples/segmentation/in41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in41.png
--------------------------------------------------------------------------------
/examples/segmentation/in42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in42.png
--------------------------------------------------------------------------------
/examples/segmentation/in43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in43.png
--------------------------------------------------------------------------------
/examples/segmentation/in44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in44.png
--------------------------------------------------------------------------------
/examples/segmentation/in45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in45.png
--------------------------------------------------------------------------------
/examples/segmentation/in46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in46.png
--------------------------------------------------------------------------------
/examples/segmentation/in47.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in47.png
--------------------------------------------------------------------------------
/examples/segmentation/in48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in48.png
--------------------------------------------------------------------------------
/examples/segmentation/in49.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in49.png
--------------------------------------------------------------------------------
/examples/segmentation/in5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in5.png
--------------------------------------------------------------------------------
/examples/segmentation/in50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in50.png
--------------------------------------------------------------------------------
/examples/segmentation/in51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in51.png
--------------------------------------------------------------------------------
/examples/segmentation/in52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in52.png
--------------------------------------------------------------------------------
/examples/segmentation/in53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in53.png
--------------------------------------------------------------------------------
/examples/segmentation/in54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in54.png
--------------------------------------------------------------------------------
/examples/segmentation/in55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in55.png
--------------------------------------------------------------------------------
/examples/segmentation/in56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in56.png
--------------------------------------------------------------------------------
/examples/segmentation/in57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in57.png
--------------------------------------------------------------------------------
/examples/segmentation/in58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in58.png
--------------------------------------------------------------------------------
/examples/segmentation/in59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in59.png
--------------------------------------------------------------------------------
/examples/segmentation/in6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in6.png
--------------------------------------------------------------------------------
/examples/segmentation/in60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in60.png
--------------------------------------------------------------------------------
/examples/segmentation/in7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in7.png
--------------------------------------------------------------------------------
/examples/segmentation/in8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in8.png
--------------------------------------------------------------------------------
/examples/segmentation/in9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/in9.png
--------------------------------------------------------------------------------
/examples/segmentation/tar1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar1.png
--------------------------------------------------------------------------------
/examples/segmentation/tar10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar10.png
--------------------------------------------------------------------------------
/examples/segmentation/tar11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar11.png
--------------------------------------------------------------------------------
/examples/segmentation/tar12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar12.png
--------------------------------------------------------------------------------
/examples/segmentation/tar13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar13.png
--------------------------------------------------------------------------------
/examples/segmentation/tar14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar14.png
--------------------------------------------------------------------------------
/examples/segmentation/tar15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar15.png
--------------------------------------------------------------------------------
/examples/segmentation/tar16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar16.png
--------------------------------------------------------------------------------
/examples/segmentation/tar17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar17.png
--------------------------------------------------------------------------------
/examples/segmentation/tar18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar18.png
--------------------------------------------------------------------------------
/examples/segmentation/tar19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar19.png
--------------------------------------------------------------------------------
/examples/segmentation/tar2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar2.png
--------------------------------------------------------------------------------
/examples/segmentation/tar20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar20.png
--------------------------------------------------------------------------------
/examples/segmentation/tar21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar21.png
--------------------------------------------------------------------------------
/examples/segmentation/tar22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar22.png
--------------------------------------------------------------------------------
/examples/segmentation/tar23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar23.png
--------------------------------------------------------------------------------
/examples/segmentation/tar24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar24.png
--------------------------------------------------------------------------------
/examples/segmentation/tar25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar25.png
--------------------------------------------------------------------------------
/examples/segmentation/tar26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar26.png
--------------------------------------------------------------------------------
/examples/segmentation/tar27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar27.png
--------------------------------------------------------------------------------
/examples/segmentation/tar28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar28.png
--------------------------------------------------------------------------------
/examples/segmentation/tar29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar29.png
--------------------------------------------------------------------------------
/examples/segmentation/tar3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar3.png
--------------------------------------------------------------------------------
/examples/segmentation/tar30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar30.png
--------------------------------------------------------------------------------
/examples/segmentation/tar31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar31.png
--------------------------------------------------------------------------------
/examples/segmentation/tar32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar32.png
--------------------------------------------------------------------------------
/examples/segmentation/tar33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar33.png
--------------------------------------------------------------------------------
/examples/segmentation/tar34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar34.png
--------------------------------------------------------------------------------
/examples/segmentation/tar35.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar35.png
--------------------------------------------------------------------------------
/examples/segmentation/tar36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar36.png
--------------------------------------------------------------------------------
/examples/segmentation/tar37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar37.png
--------------------------------------------------------------------------------
/examples/segmentation/tar38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar38.png
--------------------------------------------------------------------------------
/examples/segmentation/tar39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar39.png
--------------------------------------------------------------------------------
/examples/segmentation/tar4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar4.png
--------------------------------------------------------------------------------
/examples/segmentation/tar40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar40.png
--------------------------------------------------------------------------------
/examples/segmentation/tar41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar41.png
--------------------------------------------------------------------------------
/examples/segmentation/tar42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar42.png
--------------------------------------------------------------------------------
/examples/segmentation/tar43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar43.png
--------------------------------------------------------------------------------
/examples/segmentation/tar44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar44.png
--------------------------------------------------------------------------------
/examples/segmentation/tar45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar45.png
--------------------------------------------------------------------------------
/examples/segmentation/tar46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar46.png
--------------------------------------------------------------------------------
/examples/segmentation/tar47.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar47.png
--------------------------------------------------------------------------------
/examples/segmentation/tar48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar48.png
--------------------------------------------------------------------------------
/examples/segmentation/tar49.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar49.png
--------------------------------------------------------------------------------
/examples/segmentation/tar5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar5.png
--------------------------------------------------------------------------------
/examples/segmentation/tar50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar50.png
--------------------------------------------------------------------------------
/examples/segmentation/tar51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar51.png
--------------------------------------------------------------------------------
/examples/segmentation/tar52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar52.png
--------------------------------------------------------------------------------
/examples/segmentation/tar53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar53.png
--------------------------------------------------------------------------------
/examples/segmentation/tar54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar54.png
--------------------------------------------------------------------------------
/examples/segmentation/tar55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar55.png
--------------------------------------------------------------------------------
/examples/segmentation/tar56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar56.png
--------------------------------------------------------------------------------
/examples/segmentation/tar57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar57.png
--------------------------------------------------------------------------------
/examples/segmentation/tar58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar58.png
--------------------------------------------------------------------------------
/examples/segmentation/tar59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar59.png
--------------------------------------------------------------------------------
/examples/segmentation/tar6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar6.png
--------------------------------------------------------------------------------
/examples/segmentation/tar60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar60.png
--------------------------------------------------------------------------------
/examples/segmentation/tar7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar7.png
--------------------------------------------------------------------------------
/examples/segmentation/tar8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar8.png
--------------------------------------------------------------------------------
/examples/segmentation/tar9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/segmentation/tar9.png
--------------------------------------------------------------------------------
/examples/style/tar1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar1.png
--------------------------------------------------------------------------------
/examples/style/tar10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar10.png
--------------------------------------------------------------------------------
/examples/style/tar11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar11.png
--------------------------------------------------------------------------------
/examples/style/tar12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar12.png
--------------------------------------------------------------------------------
/examples/style/tar13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar13.png
--------------------------------------------------------------------------------
/examples/style/tar14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar14.png
--------------------------------------------------------------------------------
/examples/style/tar15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar15.png
--------------------------------------------------------------------------------
/examples/style/tar16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar16.png
--------------------------------------------------------------------------------
/examples/style/tar17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar17.png
--------------------------------------------------------------------------------
/examples/style/tar18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar18.png
--------------------------------------------------------------------------------
/examples/style/tar19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar19.png
--------------------------------------------------------------------------------
/examples/style/tar2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar2.png
--------------------------------------------------------------------------------
/examples/style/tar20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar20.png
--------------------------------------------------------------------------------
/examples/style/tar21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar21.png
--------------------------------------------------------------------------------
/examples/style/tar22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar22.png
--------------------------------------------------------------------------------
/examples/style/tar23.png:
--------------------------------------------------------------------------------
1 | examples/input/in23.png
--------------------------------------------------------------------------------
/examples/style/tar24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar24.png
--------------------------------------------------------------------------------
/examples/style/tar25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar25.png
--------------------------------------------------------------------------------
/examples/style/tar26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar26.png
--------------------------------------------------------------------------------
/examples/style/tar27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar27.png
--------------------------------------------------------------------------------
/examples/style/tar28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar28.png
--------------------------------------------------------------------------------
/examples/style/tar29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar29.png
--------------------------------------------------------------------------------
/examples/style/tar3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar3.png
--------------------------------------------------------------------------------
/examples/style/tar30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar30.png
--------------------------------------------------------------------------------
/examples/style/tar31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar31.png
--------------------------------------------------------------------------------
/examples/style/tar32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar32.png
--------------------------------------------------------------------------------
/examples/style/tar33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar33.png
--------------------------------------------------------------------------------
/examples/style/tar34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar34.png
--------------------------------------------------------------------------------
/examples/style/tar35.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar35.png
--------------------------------------------------------------------------------
/examples/style/tar36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar36.png
--------------------------------------------------------------------------------
/examples/style/tar37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar37.png
--------------------------------------------------------------------------------
/examples/style/tar38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar38.png
--------------------------------------------------------------------------------
/examples/style/tar39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar39.png
--------------------------------------------------------------------------------
/examples/style/tar4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar4.png
--------------------------------------------------------------------------------
/examples/style/tar40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar40.png
--------------------------------------------------------------------------------
/examples/style/tar41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar41.png
--------------------------------------------------------------------------------
/examples/style/tar42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar42.png
--------------------------------------------------------------------------------
/examples/style/tar43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar43.png
--------------------------------------------------------------------------------
/examples/style/tar44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar44.png
--------------------------------------------------------------------------------
/examples/style/tar45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar45.png
--------------------------------------------------------------------------------
/examples/style/tar46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar46.png
--------------------------------------------------------------------------------
/examples/style/tar47.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar47.png
--------------------------------------------------------------------------------
/examples/style/tar48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar48.png
--------------------------------------------------------------------------------
/examples/style/tar49.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar49.png
--------------------------------------------------------------------------------
/examples/style/tar5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar5.png
--------------------------------------------------------------------------------
/examples/style/tar50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar50.png
--------------------------------------------------------------------------------
/examples/style/tar51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar51.png
--------------------------------------------------------------------------------
/examples/style/tar52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar52.png
--------------------------------------------------------------------------------
/examples/style/tar53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar53.png
--------------------------------------------------------------------------------
/examples/style/tar54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar54.png
--------------------------------------------------------------------------------
/examples/style/tar55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar55.png
--------------------------------------------------------------------------------
/examples/style/tar56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar56.png
--------------------------------------------------------------------------------
/examples/style/tar57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar57.png
--------------------------------------------------------------------------------
/examples/style/tar58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar58.png
--------------------------------------------------------------------------------
/examples/style/tar59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar59.png
--------------------------------------------------------------------------------
/examples/style/tar6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar6.png
--------------------------------------------------------------------------------
/examples/style/tar60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar60.png
--------------------------------------------------------------------------------
/examples/style/tar7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar7.png
--------------------------------------------------------------------------------
/examples/style/tar8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar8.png
--------------------------------------------------------------------------------
/examples/style/tar9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/style/tar9.png
--------------------------------------------------------------------------------
/examples/tmp_results/out10_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out10_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out11_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out11_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out12_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out12_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out13_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out13_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out14_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out14_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out15_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out15_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out16_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out16_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out17_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out17_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out18_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out18_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out19_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out19_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out1_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out1_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out20_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out20_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out21_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out21_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out22_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out22_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out23_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out23_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out24_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out24_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out25_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out25_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out26_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out26_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out27_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out27_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out28_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out28_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out29_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out29_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out2_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out2_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out30_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out30_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out31_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out31_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out32_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out32_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out33_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out33_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out34_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out34_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out35_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out35_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out36_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out36_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out37_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out37_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out38_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out38_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out39_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out39_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out3_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out3_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out40_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out40_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out41_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out41_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out42_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out42_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out43_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out43_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out44_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out44_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out45_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out45_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out46_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out46_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out47_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out47_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out48_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out48_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out49_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out49_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out4_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out4_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out50_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out50_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out51_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out51_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out52_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out52_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out53_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out53_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out54_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out54_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out55_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out55_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out56_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out56_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out57_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out57_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out58_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out58_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out59_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out59_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out5_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out5_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out60_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out60_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out6_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out6_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out7_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out7_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out8_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out8_t_1000.png
--------------------------------------------------------------------------------
/examples/tmp_results/out9_t_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/examples/tmp_results/out9_t_1000.png
--------------------------------------------------------------------------------
/photo_style.py:
--------------------------------------------------------------------------------
1 | from __future__ import division, print_function
2 |
3 | import numpy as np
4 | import tensorflow as tf
5 | from vgg19.vgg import Vgg19
6 | from PIL import Image
7 | import time
8 | from closed_form_matting import getLaplacian
9 | import math
10 | from functools import partial
11 | import copy
12 | import os
13 |
14 | try:
15 | xrange # Python 2
16 | except NameError:
17 | xrange = range # Python 3
18 |
19 | VGG_MEAN = [103.939, 116.779, 123.68]
20 |
21 | def rgb2bgr(rgb, vgg_mean=True):
22 | if vgg_mean:
23 | return rgb[:, :, ::-1] - VGG_MEAN
24 | else:
25 | return rgb[:, :, ::-1]
26 |
27 | def bgr2rgb(bgr, vgg_mean=False):
28 | if vgg_mean:
29 | return bgr[:, :, ::-1] + VGG_MEAN
30 | else:
31 | return bgr[:, :, ::-1]
32 |
33 | def load_seg(content_seg_path, style_seg_path, content_shape, style_shape):
34 | color_codes = ['BLUE', 'GREEN', 'BLACK', 'WHITE', 'RED', 'YELLOW', 'GREY', 'LIGHT_BLUE', 'PURPLE']
35 | def _extract_mask(seg, color_str):
36 | h, w, c = np.shape(seg)
37 | if color_str == "BLUE":
38 | mask_r = (seg[:, :, 0] < 0.1).astype(np.uint8)
39 | mask_g = (seg[:, :, 1] < 0.1).astype(np.uint8)
40 | mask_b = (seg[:, :, 2] > 0.9).astype(np.uint8)
41 | elif color_str == "GREEN":
42 | mask_r = (seg[:, :, 0] < 0.1).astype(np.uint8)
43 | mask_g = (seg[:, :, 1] > 0.9).astype(np.uint8)
44 | mask_b = (seg[:, :, 2] < 0.1).astype(np.uint8)
45 | elif color_str == "BLACK":
46 | mask_r = (seg[:, :, 0] < 0.1).astype(np.uint8)
47 | mask_g = (seg[:, :, 1] < 0.1).astype(np.uint8)
48 | mask_b = (seg[:, :, 2] < 0.1).astype(np.uint8)
49 | elif color_str == "WHITE":
50 | mask_r = (seg[:, :, 0] > 0.9).astype(np.uint8)
51 | mask_g = (seg[:, :, 1] > 0.9).astype(np.uint8)
52 | mask_b = (seg[:, :, 2] > 0.9).astype(np.uint8)
53 | elif color_str == "RED":
54 | mask_r = (seg[:, :, 0] > 0.9).astype(np.uint8)
55 | mask_g = (seg[:, :, 1] < 0.1).astype(np.uint8)
56 | mask_b = (seg[:, :, 2] < 0.1).astype(np.uint8)
57 | elif color_str == "YELLOW":
58 | mask_r = (seg[:, :, 0] > 0.9).astype(np.uint8)
59 | mask_g = (seg[:, :, 1] > 0.9).astype(np.uint8)
60 | mask_b = (seg[:, :, 2] < 0.1).astype(np.uint8)
61 | elif color_str == "GREY":
62 | mask_r = np.multiply((seg[:, :, 0] > 0.4).astype(np.uint8),
63 | (seg[:, :, 0] < 0.6).astype(np.uint8))
64 | mask_g = np.multiply((seg[:, :, 1] > 0.4).astype(np.uint8),
65 | (seg[:, :, 1] < 0.6).astype(np.uint8))
66 | mask_b = np.multiply((seg[:, :, 2] > 0.4).astype(np.uint8),
67 | (seg[:, :, 2] < 0.6).astype(np.uint8))
68 | elif color_str == "LIGHT_BLUE":
69 | mask_r = (seg[:, :, 0] < 0.1).astype(np.uint8)
70 | mask_g = (seg[:, :, 1] > 0.9).astype(np.uint8)
71 | mask_b = (seg[:, :, 2] > 0.9).astype(np.uint8)
72 | elif color_str == "PURPLE":
73 | mask_r = (seg[:, :, 0] > 0.9).astype(np.uint8)
74 | mask_g = (seg[:, :, 1] < 0.1).astype(np.uint8)
75 | mask_b = (seg[:, :, 2] > 0.9).astype(np.uint8)
76 | return np.multiply(np.multiply(mask_r, mask_g), mask_b).astype(np.float32)
77 |
78 | # PIL resize has different order of np.shape
79 | content_seg = np.array(Image.open(content_seg_path).convert("RGB").resize(content_shape, resample=Image.BILINEAR), dtype=np.float32) / 255.0
80 | style_seg = np.array(Image.open(style_seg_path).convert("RGB").resize(style_shape, resample=Image.BILINEAR), dtype=np.float32) / 255.0
81 |
82 | color_content_masks = []
83 | color_style_masks = []
84 | for i in xrange(len(color_codes)):
85 | color_content_masks.append(tf.expand_dims(tf.expand_dims(tf.constant(_extract_mask(content_seg, color_codes[i])), 0), -1))
86 | color_style_masks.append(tf.expand_dims(tf.expand_dims(tf.constant(_extract_mask(style_seg, color_codes[i])), 0), -1))
87 |
88 | return color_content_masks, color_style_masks
89 |
90 | def gram_matrix(activations):
91 | height = tf.shape(activations)[1]
92 | width = tf.shape(activations)[2]
93 | num_channels = tf.shape(activations)[3]
94 | gram_matrix = tf.transpose(activations, [0, 3, 1, 2])
95 | gram_matrix = tf.reshape(gram_matrix, [num_channels, width * height])
96 | gram_matrix = tf.matmul(gram_matrix, gram_matrix, transpose_b=True)
97 | return gram_matrix
98 |
99 | def content_loss(const_layer, var_layer, weight):
100 | return tf.reduce_mean(tf.squared_difference(const_layer, var_layer)) * weight
101 |
102 | def style_loss(CNN_structure, const_layers, var_layers, content_segs, style_segs, weight):
103 | loss_styles = []
104 | layer_count = float(len(const_layers))
105 | layer_index = 0
106 |
107 | _, content_seg_height, content_seg_width, _ = content_segs[0].get_shape().as_list()
108 | _, style_seg_height, style_seg_width, _ = style_segs[0].get_shape().as_list()
109 | for layer_name in CNN_structure:
110 | layer_name = layer_name[layer_name.find("/") + 1:]
111 |
112 | # downsampling segmentation
113 | if "pool" in layer_name:
114 | content_seg_width, content_seg_height = int(math.ceil(content_seg_width / 2)), int(math.ceil(content_seg_height / 2))
115 | style_seg_width, style_seg_height = int(math.ceil(style_seg_width / 2)), int(math.ceil(style_seg_height / 2))
116 |
117 | for i in xrange(len(content_segs)):
118 | content_segs[i] = tf.image.resize_bilinear(content_segs[i], tf.constant((content_seg_height, content_seg_width)))
119 | style_segs[i] = tf.image.resize_bilinear(style_segs[i], tf.constant((style_seg_height, style_seg_width)))
120 |
121 | elif "conv" in layer_name:
122 | for i in xrange(len(content_segs)):
123 | # have some differences on border with torch
124 | content_segs[i] = tf.nn.avg_pool(tf.pad(content_segs[i], [[0, 0], [1, 1], [1, 1], [0, 0]], "CONSTANT"), \
125 | ksize=[1, 3, 3, 1], strides=[1, 1, 1, 1], padding='VALID')
126 | style_segs[i] = tf.nn.avg_pool(tf.pad(style_segs[i], [[0, 0], [1, 1], [1, 1], [0, 0]], "CONSTANT"), \
127 | ksize=[1, 3, 3, 1], strides=[1, 1, 1, 1], padding='VALID')
128 |
129 | if layer_name == var_layers[layer_index].name[var_layers[layer_index].name.find("/") + 1:]:
130 | print("Setting up style layer: <{}>".format(layer_name))
131 | const_layer = const_layers[layer_index]
132 | var_layer = var_layers[layer_index]
133 |
134 | layer_index = layer_index + 1
135 |
136 | layer_style_loss = 0.0
137 | for content_seg, style_seg in zip(content_segs, style_segs):
138 | gram_matrix_const = gram_matrix(tf.multiply(const_layer, style_seg))
139 | style_mask_mean = tf.reduce_mean(style_seg)
140 | gram_matrix_const = tf.cond(tf.greater(style_mask_mean, 0.),
141 | lambda: gram_matrix_const / (tf.to_float(tf.size(const_layer)) * style_mask_mean),
142 | lambda: gram_matrix_const
143 | )
144 |
145 | gram_matrix_var = gram_matrix(tf.multiply(var_layer, content_seg))
146 | content_mask_mean = tf.reduce_mean(content_seg)
147 | gram_matrix_var = tf.cond(tf.greater(content_mask_mean, 0.),
148 | lambda: gram_matrix_var / (tf.to_float(tf.size(var_layer)) * content_mask_mean),
149 | lambda: gram_matrix_var
150 | )
151 |
152 | diff_style_sum = tf.reduce_mean(tf.squared_difference(gram_matrix_const, gram_matrix_var)) * content_mask_mean
153 |
154 | layer_style_loss += diff_style_sum
155 |
156 | loss_styles.append(layer_style_loss * weight)
157 | return loss_styles
158 |
159 | def total_variation_loss(output, weight):
160 | shape = output.get_shape()
161 | tv_loss = tf.reduce_sum((output[:, :-1, :-1, :] - output[:, :-1, 1:, :]) * (output[:, :-1, :-1, :] - output[:, :-1, 1:, :]) + \
162 | (output[:, :-1, :-1, :] - output[:, 1:, :-1, :]) * (output[:, :-1, :-1, :] - output[:, 1:, :-1, :])) / 2.0
163 | return tv_loss * weight
164 |
165 | def affine_loss(output, M, weight):
166 | loss_affine = 0.0
167 | output_t = output / 255.
168 | for Vc in tf.unstack(output_t, axis=-1):
169 | Vc_ravel = tf.reshape(tf.transpose(Vc), [-1])
170 | loss_affine += tf.matmul(tf.expand_dims(Vc_ravel, 0), tf.sparse_tensor_dense_matmul(M, tf.expand_dims(Vc_ravel, -1)))
171 |
172 | return loss_affine * weight
173 |
174 | def save_result(img_, str_):
175 | result = Image.fromarray(np.uint8(np.clip(img_, 0, 255.0)))
176 | result.save(str_)
177 |
178 | iter_count = 0
179 | min_loss, best_image = float("inf"), None
180 | def print_loss(args, loss_content, loss_styles_list, loss_tv, loss_affine, overall_loss, output_image):
181 | global iter_count, min_loss, best_image
182 | if iter_count % args.print_iter == 0:
183 | print('Iteration {} / {}\n\tContent loss: {}'.format(iter_count, args.max_iter, loss_content))
184 | for j, style_loss in enumerate(loss_styles_list):
185 | print('\tStyle {} loss: {}'.format(j + 1, style_loss))
186 | print('\tTV loss: {}'.format(loss_tv))
187 | print('\tAffine loss: {}'.format(loss_affine))
188 | print('\tTotal loss: {}'.format(overall_loss - loss_affine))
189 |
190 | if overall_loss < min_loss:
191 | min_loss, best_image = overall_loss, output_image
192 |
193 | if iter_count % args.save_iter == 0 and iter_count != 0:
194 | save_result(best_image[:, :, ::-1], os.path.join(args.serial, 'out_iter_{}.png'.format(iter_count)))
195 |
196 | iter_count += 1
197 |
198 | def stylize(args, Matting):
199 | config = tf.ConfigProto()
200 | config.gpu_options.allow_growth = True
201 | sess = tf.Session(config=config)
202 |
203 | start = time.time()
204 | # prepare input images
205 | content_image = np.array(Image.open(args.content_image_path).convert("RGB"), dtype=np.float32)
206 | content_width, content_height = content_image.shape[1], content_image.shape[0]
207 |
208 | if Matting:
209 | M = tf.to_float(getLaplacian(content_image / 255.))
210 |
211 | content_image = rgb2bgr(content_image)
212 | content_image = content_image.reshape((1, content_height, content_width, 3)).astype(np.float32)
213 |
214 | style_image = rgb2bgr(np.array(Image.open(args.style_image_path).convert("RGB"), dtype=np.float32))
215 | style_width, style_height = style_image.shape[1], style_image.shape[0]
216 | style_image = style_image.reshape((1, style_height, style_width, 3)).astype(np.float32)
217 |
218 | content_masks, style_masks = load_seg(args.content_seg_path, args.style_seg_path, [content_width, content_height], [style_width, style_height])
219 |
220 | if not args.init_image_path:
221 | if Matting:
222 | print(": Apply Matting with random init")
223 | init_image = np.random.randn(1, content_height, content_width, 3).astype(np.float32) * 0.0001
224 | else:
225 | init_image = np.expand_dims(rgb2bgr(np.array(Image.open(args.init_image_path).convert("RGB"), dtype=np.float32)).astype(np.float32), 0)
226 |
227 | mean_pixel = tf.constant(VGG_MEAN)
228 | input_image = tf.Variable(init_image)
229 |
230 | with tf.name_scope("constant"):
231 | vgg_const = Vgg19()
232 | vgg_const.build(tf.constant(content_image), clear_data=False)
233 |
234 | content_fv = sess.run(vgg_const.conv4_2)
235 | content_layer_const = tf.constant(content_fv)
236 |
237 | vgg_const.build(tf.constant(style_image))
238 | style_layers_const = [vgg_const.conv1_1, vgg_const.conv2_1, vgg_const.conv3_1, vgg_const.conv4_1, vgg_const.conv5_1]
239 | style_fvs = sess.run(style_layers_const)
240 | style_layers_const = [tf.constant(fv) for fv in style_fvs]
241 |
242 | with tf.name_scope("variable"):
243 | vgg_var = Vgg19()
244 | vgg_var.build(input_image)
245 |
246 | # which layers we want to use?
247 | style_layers_var = [vgg_var.conv1_1, vgg_var.conv2_1, vgg_var.conv3_1, vgg_var.conv4_1, vgg_var.conv5_1]
248 | content_layer_var = vgg_var.conv4_2
249 |
250 | # The whole CNN structure to downsample mask
251 | layer_structure_all = [layer.name for layer in vgg_var.get_all_layers()]
252 |
253 | # Content Loss
254 | loss_content = content_loss(content_layer_const, content_layer_var, float(args.content_weight))
255 |
256 | # Style Loss
257 | loss_styles_list = style_loss(layer_structure_all, style_layers_const, style_layers_var, content_masks, style_masks, float(args.style_weight))
258 | loss_style = 0.0
259 | for loss in loss_styles_list:
260 | loss_style += loss
261 |
262 | input_image_plus = tf.squeeze(input_image + mean_pixel, [0])
263 |
264 | # Affine Loss
265 | if Matting:
266 | loss_affine = affine_loss(input_image_plus, M, args.affine_weight)
267 | else:
268 | loss_affine = tf.constant(0.00001) # junk value
269 |
270 | # Total Variational Loss
271 | loss_tv = total_variation_loss(input_image, float(args.tv_weight))
272 |
273 | if args.lbfgs:
274 | if not Matting:
275 | overall_loss = loss_content + loss_tv + loss_style
276 | else:
277 | overall_loss = loss_content + loss_style + loss_tv + loss_affine
278 |
279 | optimizer = tf.contrib.opt.ScipyOptimizerInterface(overall_loss, method='L-BFGS-B', options={'maxiter': args.max_iter, 'disp': 0})
280 | sess.run(tf.global_variables_initializer())
281 | print_loss_partial = partial(print_loss, args)
282 | optimizer.minimize(sess, fetches=[loss_content, loss_styles_list, loss_tv, loss_affine, overall_loss, input_image_plus], loss_callback=print_loss_partial)
283 |
284 | global min_loss, best_image, iter_count
285 | best_result = copy.deepcopy(best_image)
286 | min_loss, best_image = float("inf"), None
287 | return best_result
288 | else:
289 | VGGNetLoss = loss_content + loss_tv + loss_style
290 | optimizer = tf.train.AdamOptimizer(learning_rate=args.learning_rate, beta1=0.9, beta2=0.999, epsilon=1e-08)
291 | VGG_grads = optimizer.compute_gradients(VGGNetLoss, [input_image])
292 |
293 | if Matting:
294 | b, g, r = tf.unstack(input_image_plus / 255., axis=-1)
295 | b_gradient = tf.transpose(tf.reshape(2 * tf.sparse_tensor_dense_matmul(M, tf.expand_dims(tf.reshape(tf.transpose(b), [-1]), -1)), [content_width, content_height]))
296 | g_gradient = tf.transpose(tf.reshape(2 * tf.sparse_tensor_dense_matmul(M, tf.expand_dims(tf.reshape(tf.transpose(g), [-1]), -1)), [content_width, content_height]))
297 | r_gradient = tf.transpose(tf.reshape(2 * tf.sparse_tensor_dense_matmul(M, tf.expand_dims(tf.reshape(tf.transpose(r), [-1]), -1)), [content_width, content_height]))
298 |
299 | Matting_grad = tf.expand_dims(tf.stack([b_gradient, g_gradient, r_gradient], axis=-1), 0) / 255. * args.affine_weight
300 | VGGMatting_grad = [(VGG_grad[0] + Matting_grad, VGG_grad[1]) for VGG_grad in VGG_grads]
301 |
302 | train_op = optimizer.apply_gradients(VGGMatting_grad)
303 | else:
304 | train_op = optimizer.apply_gradients(VGG_grads)
305 |
306 | sess.run(tf.global_variables_initializer())
307 | min_loss, best_image = float("inf"), None
308 | for i in xrange(1, args.max_iter):
309 | _, loss_content_, loss_styles_list_, loss_tv_, loss_affine_, overall_loss_, output_image_ = sess.run([
310 | train_op, loss_content, loss_styles_list, loss_tv, loss_affine, VGGNetLoss, input_image_plus
311 | ])
312 | if i % args.print_iter == 0:
313 | print('Iteration {} / {}\n\tContent loss: {}'.format(i, args.max_iter, loss_content_))
314 | for j, style_loss_ in enumerate(loss_styles_list_):
315 | print('\tStyle {} loss: {}'.format(j + 1, style_loss_))
316 | print('\tTV loss: {}'.format(loss_tv_))
317 | if Matting:
318 | print('\tAffine loss: {}'.format(loss_affine_))
319 | print('\tTotal loss: {}'.format(overall_loss_ - loss_tv_))
320 |
321 | if overall_loss_ < min_loss:
322 | min_loss, best_image = overall_loss_, output_image_
323 |
324 | if i % args.save_iter == 0 and i != 0:
325 | save_result(best_image[:, :, ::-1], os.path.join(args.serial, 'out_iter_{}.png'.format(i)))
326 |
327 | return best_image
328 |
329 | if __name__ == "__main__":
330 | stylize()
331 |
--------------------------------------------------------------------------------
/smooth_local_affine.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from PIL import Image
3 | import pycuda.autoinit
4 | import pycuda.driver as drv
5 | import scipy.io
6 | from pycuda.compiler import SourceModule
7 |
8 | def smooth_local_affine(output_, input_, epsilon, patch, h, w, f_r, f_e):
9 | mod = SourceModule("""
10 |
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | #define TB 256
19 | #define EPS 1e-7
20 |
21 | __device__ bool InverseMat4x4(double m_in[4][4], double inv_out[4][4]) {
22 | double m[16], inv[16];
23 | for (int i = 0; i < 4; i++) {
24 | for (int j = 0; j < 4; j++) {
25 | m[i * 4 + j] = m_in[i][j];
26 | }
27 | }
28 |
29 | inv[0] = m[5] * m[10] * m[15] -
30 | m[5] * m[11] * m[14] -
31 | m[9] * m[6] * m[15] +
32 | m[9] * m[7] * m[14] +
33 | m[13] * m[6] * m[11] -
34 | m[13] * m[7] * m[10];
35 |
36 | inv[4] = -m[4] * m[10] * m[15] +
37 | m[4] * m[11] * m[14] +
38 | m[8] * m[6] * m[15] -
39 | m[8] * m[7] * m[14] -
40 | m[12] * m[6] * m[11] +
41 | m[12] * m[7] * m[10];
42 |
43 | inv[8] = m[4] * m[9] * m[15] -
44 | m[4] * m[11] * m[13] -
45 | m[8] * m[5] * m[15] +
46 | m[8] * m[7] * m[13] +
47 | m[12] * m[5] * m[11] -
48 | m[12] * m[7] * m[9];
49 |
50 | inv[12] = -m[4] * m[9] * m[14] +
51 | m[4] * m[10] * m[13] +
52 | m[8] * m[5] * m[14] -
53 | m[8] * m[6] * m[13] -
54 | m[12] * m[5] * m[10] +
55 | m[12] * m[6] * m[9];
56 |
57 | inv[1] = -m[1] * m[10] * m[15] +
58 | m[1] * m[11] * m[14] +
59 | m[9] * m[2] * m[15] -
60 | m[9] * m[3] * m[14] -
61 | m[13] * m[2] * m[11] +
62 | m[13] * m[3] * m[10];
63 |
64 | inv[5] = m[0] * m[10] * m[15] -
65 | m[0] * m[11] * m[14] -
66 | m[8] * m[2] * m[15] +
67 | m[8] * m[3] * m[14] +
68 | m[12] * m[2] * m[11] -
69 | m[12] * m[3] * m[10];
70 |
71 | inv[9] = -m[0] * m[9] * m[15] +
72 | m[0] * m[11] * m[13] +
73 | m[8] * m[1] * m[15] -
74 | m[8] * m[3] * m[13] -
75 | m[12] * m[1] * m[11] +
76 | m[12] * m[3] * m[9];
77 |
78 | inv[13] = m[0] * m[9] * m[14] -
79 | m[0] * m[10] * m[13] -
80 | m[8] * m[1] * m[14] +
81 | m[8] * m[2] * m[13] +
82 | m[12] * m[1] * m[10] -
83 | m[12] * m[2] * m[9];
84 |
85 | inv[2] = m[1] * m[6] * m[15] -
86 | m[1] * m[7] * m[14] -
87 | m[5] * m[2] * m[15] +
88 | m[5] * m[3] * m[14] +
89 | m[13] * m[2] * m[7] -
90 | m[13] * m[3] * m[6];
91 |
92 | inv[6] = -m[0] * m[6] * m[15] +
93 | m[0] * m[7] * m[14] +
94 | m[4] * m[2] * m[15] -
95 | m[4] * m[3] * m[14] -
96 | m[12] * m[2] * m[7] +
97 | m[12] * m[3] * m[6];
98 |
99 | inv[10] = m[0] * m[5] * m[15] -
100 | m[0] * m[7] * m[13] -
101 | m[4] * m[1] * m[15] +
102 | m[4] * m[3] * m[13] +
103 | m[12] * m[1] * m[7] -
104 | m[12] * m[3] * m[5];
105 |
106 | inv[14] = -m[0] * m[5] * m[14] +
107 | m[0] * m[6] * m[13] +
108 | m[4] * m[1] * m[14] -
109 | m[4] * m[2] * m[13] -
110 | m[12] * m[1] * m[6] +
111 | m[12] * m[2] * m[5];
112 |
113 | inv[3] = -m[1] * m[6] * m[11] +
114 | m[1] * m[7] * m[10] +
115 | m[5] * m[2] * m[11] -
116 | m[5] * m[3] * m[10] -
117 | m[9] * m[2] * m[7] +
118 | m[9] * m[3] * m[6];
119 |
120 | inv[7] = m[0] * m[6] * m[11] -
121 | m[0] * m[7] * m[10] -
122 | m[4] * m[2] * m[11] +
123 | m[4] * m[3] * m[10] +
124 | m[8] * m[2] * m[7] -
125 | m[8] * m[3] * m[6];
126 |
127 | inv[11] = -m[0] * m[5] * m[11] +
128 | m[0] * m[7] * m[9] +
129 | m[4] * m[1] * m[11] -
130 | m[4] * m[3] * m[9] -
131 | m[8] * m[1] * m[7] +
132 | m[8] * m[3] * m[5];
133 |
134 | inv[15] = m[0] * m[5] * m[10] -
135 | m[0] * m[6] * m[9] -
136 | m[4] * m[1] * m[10] +
137 | m[4] * m[2] * m[9] +
138 | m[8] * m[1] * m[6] -
139 | m[8] * m[2] * m[5];
140 |
141 | double det = m[0] * inv[0] + m[1] * inv[4] + m[2] * inv[8] + m[3] * inv[12];
142 |
143 | if (abs(det) < 1e-9) {
144 | return false;
145 | }
146 |
147 |
148 | det = 1.0 / det;
149 |
150 | for (int i = 0; i < 4; i++) {
151 | for (int j = 0; j < 4; j++) {
152 | inv_out[i][j] = inv[i * 4 + j] * det;
153 | }
154 | }
155 |
156 | return true;
157 | }
158 |
159 | __global__ void best_local_affine_kernel(
160 | float *output, float *input, float *affine_model,
161 | int h, int w, float epsilon, int kernel_radius
162 | )
163 | {
164 | int size = h * w;
165 | int id = blockIdx.x * blockDim.x + threadIdx.x;
166 |
167 | if (id < size) {
168 | int x = id % w, y = id / w;
169 |
170 | double Mt_M[4][4] = {}; // 4x4
171 | double invMt_M[4][4] = {};
172 | double Mt_S[3][4] = {}; // RGB -> 1x4
173 | double A[3][4] = {};
174 | for (int i = 0; i < 4; i++)
175 | for (int j = 0; j < 4; j++) {
176 | Mt_M[i][j] = 0, invMt_M[i][j] = 0;
177 | if (i != 3) {
178 | Mt_S[i][j] = 0, A[i][j] = 0;
179 | if (i == j)
180 | Mt_M[i][j] = 1e-3;
181 | }
182 | }
183 |
184 | for (int dy = -kernel_radius; dy <= kernel_radius; dy++) {
185 | for (int dx = -kernel_radius; dx <= kernel_radius; dx++) {
186 |
187 | int xx = x + dx, yy = y + dy;
188 | int id2 = yy * w + xx;
189 |
190 | if (0 <= xx && xx < w && 0 <= yy && yy < h) {
191 |
192 | Mt_M[0][0] += input[id2 + 2*size] * input[id2 + 2*size];
193 | Mt_M[0][1] += input[id2 + 2*size] * input[id2 + size];
194 | Mt_M[0][2] += input[id2 + 2*size] * input[id2];
195 | Mt_M[0][3] += input[id2 + 2*size];
196 |
197 | Mt_M[1][0] += input[id2 + size] * input[id2 + 2*size];
198 | Mt_M[1][1] += input[id2 + size] * input[id2 + size];
199 | Mt_M[1][2] += input[id2 + size] * input[id2];
200 | Mt_M[1][3] += input[id2 + size];
201 |
202 | Mt_M[2][0] += input[id2] * input[id2 + 2*size];
203 | Mt_M[2][1] += input[id2] * input[id2 + size];
204 | Mt_M[2][2] += input[id2] * input[id2];
205 | Mt_M[2][3] += input[id2];
206 |
207 | Mt_M[3][0] += input[id2 + 2*size];
208 | Mt_M[3][1] += input[id2 + size];
209 | Mt_M[3][2] += input[id2];
210 | Mt_M[3][3] += 1;
211 |
212 | Mt_S[0][0] += input[id2 + 2*size] * output[id2 + 2*size];
213 | Mt_S[0][1] += input[id2 + size] * output[id2 + 2*size];
214 | Mt_S[0][2] += input[id2] * output[id2 + 2*size];
215 | Mt_S[0][3] += output[id2 + 2*size];
216 |
217 | Mt_S[1][0] += input[id2 + 2*size] * output[id2 + size];
218 | Mt_S[1][1] += input[id2 + size] * output[id2 + size];
219 | Mt_S[1][2] += input[id2] * output[id2 + size];
220 | Mt_S[1][3] += output[id2 + size];
221 |
222 | Mt_S[2][0] += input[id2 + 2*size] * output[id2];
223 | Mt_S[2][1] += input[id2 + size] * output[id2];
224 | Mt_S[2][2] += input[id2] * output[id2];
225 | Mt_S[2][3] += output[id2];
226 | }
227 | }
228 | }
229 |
230 | bool success = InverseMat4x4(Mt_M, invMt_M);
231 |
232 | for (int i = 0; i < 3; i++) {
233 | for (int j = 0; j < 4; j++) {
234 | for (int k = 0; k < 4; k++) {
235 | A[i][j] += invMt_M[j][k] * Mt_S[i][k];
236 | }
237 | }
238 | }
239 |
240 | for (int i = 0; i < 3; i++) {
241 | for (int j = 0; j < 4; j++) {
242 | int affine_id = i * 4 + j;
243 | affine_model[12 * id + affine_id] = A[i][j];
244 | }
245 | }
246 |
247 |
248 |
249 | }
250 | return ;
251 | }
252 |
253 | __global__ void bilateral_smooth_kernel(
254 | float *affine_model, float *filtered_affine_model, float *guide,
255 | int h, int w, int kernel_radius, float sigma1, float sigma2
256 | )
257 | {
258 | int id = blockIdx.x * blockDim.x + threadIdx.x;
259 | int size = h * w;
260 | if (id < size) {
261 | int x = id % w;
262 | int y = id / w;
263 |
264 | double sum_affine[12] = {};
265 | double sum_weight = 0;
266 | for (int dx = -kernel_radius; dx <= kernel_radius; dx++) {
267 | for (int dy = -kernel_radius; dy <= kernel_radius; dy++) {
268 | int yy = y + dy, xx = x + dx;
269 | int id2 = yy * w + xx;
270 | if (0 <= xx && xx < w && 0 <= yy && yy < h) {
271 | float color_diff1 = guide[yy*w + xx] - guide[y*w + x];
272 | float color_diff2 = guide[yy*w + xx + size] - guide[y*w + x + size];
273 | float color_diff3 = guide[yy*w + xx + 2*size] - guide[y*w + x + 2*size];
274 | float color_diff_sqr =
275 | (color_diff1*color_diff1 + color_diff2*color_diff2 + color_diff3*color_diff3) / 3;
276 |
277 | float v1 = exp(-(dx * dx + dy * dy) / (2 * sigma1 * sigma1));
278 | float v2 = exp(-(color_diff_sqr) / (2 * sigma2 * sigma2));
279 | float weight = v1 * v2;
280 |
281 | for (int i = 0; i < 3; i++) {
282 | for (int j = 0; j < 4; j++) {
283 | int affine_id = i * 4 + j;
284 | sum_affine[affine_id] += weight * affine_model[id2*12 + affine_id];
285 | }
286 | }
287 | sum_weight += weight;
288 | }
289 | }
290 | }
291 |
292 | for (int i = 0; i < 3; i++) {
293 | for (int j = 0; j < 4; j++) {
294 | int affine_id = i * 4 + j;
295 | filtered_affine_model[id*12 + affine_id] = sum_affine[affine_id] / sum_weight;
296 | }
297 | }
298 | }
299 | return ;
300 | }
301 |
302 | __global__ void reconstruction_best_kernel(
303 | float *input, float *filtered_affine_model, float *filtered_best_output,
304 | int h, int w
305 | )
306 | {
307 | int id = blockIdx.x * blockDim.x + threadIdx.x;
308 | int size = h * w;
309 | if (id < size) {
310 | double out1 =
311 | input[id + 2*size] * filtered_affine_model[id*12 + 0] + // A[0][0] +
312 | input[id + size] * filtered_affine_model[id*12 + 1] + // A[0][1] +
313 | input[id] * filtered_affine_model[id*12 + 2] + // A[0][2] +
314 | filtered_affine_model[id*12 + 3]; //A[0][3];
315 | double out2 =
316 | input[id + 2*size] * filtered_affine_model[id*12 + 4] + //A[1][0] +
317 | input[id + size] * filtered_affine_model[id*12 + 5] + //A[1][1] +
318 | input[id] * filtered_affine_model[id*12 + 6] + //A[1][2] +
319 | filtered_affine_model[id*12 + 7]; //A[1][3];
320 | double out3 =
321 | input[id + 2*size] * filtered_affine_model[id*12 + 8] + //A[2][0] +
322 | input[id + size] * filtered_affine_model[id*12 + 9] + //A[2][1] +
323 | input[id] * filtered_affine_model[id*12 + 10] + //A[2][2] +
324 | filtered_affine_model[id*12 + 11]; // A[2][3];
325 |
326 | filtered_best_output[id] = out1;
327 | filtered_best_output[id + size] = out2;
328 | filtered_best_output[id + 2*size] = out3;
329 | }
330 | return ;
331 | }
332 | """)
333 | _best_local_affine_kernel = mod.get_function("best_local_affine_kernel")
334 | _bilateral_smooth_kernel = mod.get_function("bilateral_smooth_kernel")
335 | _reconstruction_best_kernel = mod.get_function("reconstruction_best_kernel")
336 |
337 | filter_radius = f_r
338 | sigma1, sigma2 = filter_radius / 3, f_e
339 |
340 | filtered_best_output = np.zeros(np.shape(input_), dtype=np.float32)
341 | affine_model = np.zeros((h * w, 12), dtype=np.float32)
342 | filtered_affine_model = np.zeros((h * w, 12), dtype=np.float32)
343 |
344 | radius = (patch - 1) / 2
345 |
346 | _best_local_affine_kernel(
347 | drv.InOut(output_), drv.InOut(input_), drv.InOut(affine_model),
348 | np.int32(h), np.int32(w), np.float32(epsilon), np.int32(radius), block=(256, 1, 1), grid=(int((h * w) / 256 + 1), 1)
349 | )
350 |
351 | _bilateral_smooth_kernel(
352 | drv.InOut(affine_model), drv.InOut(filtered_affine_model),
353 | drv.InOut(input_), np.int32(h), np.int32(w), np.int32(f_r), np.float32(sigma1), np.float32(sigma2),
354 | block=(256, 1, 1), grid=(int((h * w) / 256 + 1), 1)
355 | )
356 | _reconstruction_best_kernel(
357 | drv.InOut(input_), drv.InOut(filtered_affine_model), drv.InOut(filtered_best_output),
358 | np.int32(h), np.int32(w), block=(256, 1, 1), grid=(int((h * w) / 256 + 1), 1)
359 | )
360 | return filtered_best_output
361 |
362 | if __name__ == "__main__":
363 | X = scipy.io.loadmat("./best3_t_1000.mat")
364 | output_ = np.ascontiguousarray(X['output'], dtype=np.float32) / 256.
365 | # output_ = np.ascontiguousarray(np.array(Image.open("test2.png").convert("RGB"), dtype=np.float32)[:, :, ::-1].transpose((2, 0, 1)), dtype=np.float32) / 256.
366 | input_ = np.ascontiguousarray(np.array(Image.open("./examples/input/in3.png").convert("RGB"), dtype=np.float32)[:, :, ::-1].transpose((2, 0, 1)), dtype=np.float32)/256.
367 | c, h, w = np.shape(input_)
368 | best = smooth_local_affine(output_, input_, 1e-7, 3, h, w, 15, 0.01).transpose(1, 2, 0)
369 | best_img = Image.fromarray(np.uint8(np.clip(best * 256, 0, 255.0)))
370 | best_img.save("./best2.png")
371 |
--------------------------------------------------------------------------------
/some_results/best10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/some_results/best10.png
--------------------------------------------------------------------------------
/some_results/best11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/some_results/best11.png
--------------------------------------------------------------------------------
/some_results/best5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/some_results/best5.png
--------------------------------------------------------------------------------
/some_results/best6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/some_results/best6.png
--------------------------------------------------------------------------------
/some_results/best7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/some_results/best7.png
--------------------------------------------------------------------------------
/some_results/best8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/some_results/best8.png
--------------------------------------------------------------------------------
/some_results/best9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/some_results/best9.png
--------------------------------------------------------------------------------
/vgg19/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LouieYang/deep-photo-styletransfer-tf/ae8e773b2a876eeb9c1fb3a7aa1ac3643083649d/vgg19/__init__.py
--------------------------------------------------------------------------------
/vgg19/vgg.py:
--------------------------------------------------------------------------------
1 | import os
2 | import tensorflow as tf
3 |
4 | import numpy as np
5 | import time
6 | import inspect
7 |
8 | class Vgg19:
9 | def __init__(self, vgg19_npy_path=None):
10 | if vgg19_npy_path is None:
11 | path = inspect.getfile(Vgg19)
12 | path = os.path.abspath(os.path.join(path, os.pardir))
13 | path = os.path.join(path, "vgg19.npy")
14 | vgg19_npy_path = path
15 |
16 | self.data_dict = np.load(vgg19_npy_path, encoding='latin1').item()
17 |
18 | def build(self, bgr, clear_data=True):
19 | """
20 | load variable from npy to build the VGG
21 | """
22 | self.conv1_1 = self.conv_layer(bgr, "conv1_1")
23 | self.conv1_2 = self.conv_layer(self.conv1_1, "conv1_2")
24 | self.pool1 = self.max_pool(self.conv1_2, 'pool1')
25 |
26 | self.conv2_1 = self.conv_layer(self.pool1, "conv2_1")
27 | self.conv2_2 = self.conv_layer(self.conv2_1, "conv2_2")
28 | self.pool2 = self.max_pool(self.conv2_2, 'pool2')
29 |
30 | self.conv3_1 = self.conv_layer(self.pool2, "conv3_1")
31 | self.conv3_2 = self.conv_layer(self.conv3_1, "conv3_2")
32 | self.conv3_3 = self.conv_layer(self.conv3_2, "conv3_3")
33 | self.conv3_4 = self.conv_layer(self.conv3_3, "conv3_4")
34 | self.pool3 = self.max_pool(self.conv3_4, 'pool3')
35 |
36 | self.conv4_1 = self.conv_layer(self.pool3, "conv4_1")
37 | self.conv4_2 = self.conv_layer(self.conv4_1, "conv4_2")
38 | self.conv4_3 = self.conv_layer(self.conv4_2, "conv4_3")
39 | self.conv4_4 = self.conv_layer(self.conv4_3, "conv4_4")
40 | self.pool4 = self.max_pool(self.conv4_4, 'pool4')
41 |
42 | self.conv5_1 = self.conv_layer(self.pool4, "conv5_1")
43 | #self.conv5_2 = self.conv_layer(self.conv5_1, "conv5_2")
44 | #self.conv5_3 = self.conv_layer(self.conv5_2, "conv5_3")
45 | #self.conv5_4 = self.conv_layer(self.conv5_3, "conv5_4")
46 | #self.pool5 = self.max_pool(self.conv5_4, 'pool5')
47 |
48 | if clear_data:
49 | self.data_dict = None
50 |
51 | def get_all_layers(self):
52 | return [self.conv1_1, self.conv1_2, self.pool1,\
53 | self.conv2_1, self.conv2_2, self.pool2, \
54 | self.conv3_1, self.conv3_2, self.conv3_3, self.conv3_4, self.pool3, \
55 | self.conv4_1, self.conv4_2, self.conv4_3, self.conv4_4, self.pool4, \
56 | self.conv5_1]
57 |
58 | def avg_pool(self, bottom, name):
59 | return tf.nn.avg_pool(bottom, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME', name=name)
60 |
61 | def max_pool(self, bottom, name):
62 | return tf.nn.max_pool(bottom, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME', name=name)
63 |
64 | def conv_layer(self, bottom, name):
65 | with tf.variable_scope(name):
66 | filt = self.get_conv_filter(name)
67 | conv = tf.nn.conv2d(bottom, filt, [1, 1, 1, 1], padding='SAME')
68 |
69 | conv_biases = self.get_bias(name)
70 | bias = tf.nn.bias_add(conv, conv_biases)
71 |
72 | relu = tf.nn.relu(bias)
73 | return relu
74 |
75 | def get_conv_filter(self, name):
76 | return tf.constant(self.data_dict[name][0], name="filter")
77 |
78 | def get_bias(self, name):
79 | return tf.constant(self.data_dict[name][1], name="biases")
80 |
--------------------------------------------------------------------------------