weepiess / StyleFlow-Content-Fixed-I2I

81 stars 15 forks source link

Method to use "sampling based image to image translation" #9

Closed naruki-segawa-78092 closed 1 year ago

naruki-segawa-78092 commented 1 year ago

I want to use "sampling based image to image translation" which is described in your paper (https://arxiv.org/abs/2207.01909). But I can't understand the method using it. If I need set some options or implement some function, please let me know about them.

weepiess commented 1 year ago

I want to use "sampling based image to image translation" which is described in your paper (https://arxiv.org/abs/2207.01909). But I can't understand the method using it. If I need set some options or implement some function, please let me know about them.

Hi, Thank you for your interest.

Given two style images $I_a$ and $I_b$, we want to transfer the source image into a style between $I_a$ and $I_b$. There are two ways to do so.

Method 1: we first use the VGG style encoder to encode the style images into style features $S_a$ and $S_b$ respectively. Then you can sample between $S_a$ and $Sb$ to get $S{mix}$ (for example: $S_{mix} = (S_a + Sb)/2$). Input the $S{mix}$ into SAN module to decode the image.

Method 2: we first use the VGG style encoder to encode the style images into style features $S_a$ and $S_b$ respectively. And send them into SAN module to get translated features $f_a$ and $f_b$. Then you can sample between $f_a$ and $fb$ to get $f{mix}$ (for example: $f_{mix} = (f_a + fb)/2$). After that, you can directly decode the $f{mix}$ to get the translated image.


The first approach requires that the model has better generalizability (usually trained with a large amount of data). The second approach could perform well even trained with small-scale data.

Feel free to let me know if you have any questions.

naruki-segawa-78092 commented 1 year ago

I appreciate your help so much.