williamyang1991 / VToonify

[SIGGRAPH Asia 2022] VToonify: Controllable High-Resolution Portrait Video Style Transfer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to change the resolution of output image?

dongyun-kim-arch opened this issue · comments

Awesome model!

I would like to know if I can change the size of output image. It looks like the resolution of generated image is not the same as the input image, I mean, it just resizes the result. I wonder if I can adjust the setting to get detailed toonified results.

Use padding to adjust the output resolution:
--padding (default: 200, 200, 200, 200): left, right, top, bottom paddings to the eye center.

image

Our encoder accepts H/4xW/4 input for HxW output.
If you want the input to have the same resolution of output,
you need to train your own model with in_size=1024,

VToonify/model/vtoonify.py

Lines 130 to 139 in db57c27

class VToonify(nn.Module):
def __init__(self,
in_size=256,
out_size=1024,
img_channels=3,
style_channels=512,
num_mlps=8,
channel_multiplier=2,
num_res_layers=6,
backbone = 'dualstylegan',

Thank you for the explanation.

I tested 2000x2000 image as an input, and the size of generated image was the same, but the image was blurry so I thought it was just resized. Could you explain the details of this part?
It seems like the model was trained with 256 size and it is able to generate 4 times bigger image, maintaining the quality.

This is the relationship between the input resolution and output resolution.
The face will be resized so that the eye distance is about 64 pixels to match the scale of our model.

image

ahhh! I see. So, the output size is quite fixed... Thank you for the quick reply and detailed explanation!