rosinality / stylegan2-pytorch

Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch
MIT License
2.74k stars 621 forks source link

How to implement the most efficient convolution #336

Open anguoyang opened 1 year ago

anguoyang commented 1 year ago

hi @rosinality , thank you for your great contribution, the result is amazing, but the huge input/output channels(1024, 512, etc) make the convolution heavy and slow, how could we implement lightweight convolutions to slim the model? thank you.

Btw, there are some mobile/lightweight open sources, like MobileStyleGAN, anycost-gan, etc, but almost all these approaches are trying to decrease the channels, but unfortunately, this will also decrease the image quality, I just wonder if we could make a super lightweight convolution without decreasing the channels but still maintain similar results with StyleGAN2.

rosinality commented 1 year ago

You can try depthwise convolutions, but generally depthwise convolution requires even more channels than standard convolutions. I think you can try approaches like FastGAN.

anguoyang commented 1 year ago

Thank you for your kind help, yes, depthwise separable convolution maybe need even more channels, and it is difficult to replace ModulatedConv2d. Let me try FastGAN