mit-han-lab / anycost-gan

[CVPR 2021] Anycost GANs for Interactive Image Synthesis and Editing
https://hanlab.mit.edu/projects/anycost-gan/
MIT License
776 stars 97 forks source link

Recommendations on speeding up tools/project.py #20

Closed jackkwok closed 2 years ago

jackkwok commented 2 years ago

I don't provide any optional argument and the projection takes 19 seconds even with a GPU. Besides tweaking n_iter, is there any other argument that I should tweak to speed up the projection process?

usage: project.py [-h] [--config CONFIG] [--encoder] [--optimizer OPTIMIZER]
                  [--n_iter N_ITER] [--optimize_sub_g]
                  [--mse_weight MSE_WEIGHT] [--enc_reg_weight ENC_REG_WEIGHT]
                  FILES [FILES ...]

Image projector to the generator latent spaces

positional arguments:
  FILES                 path to image files to be projected

optional arguments:
  -h, --help            show this help message and exit
  --config CONFIG       models config
  --encoder             use encoder prediction as init
  --optimizer OPTIMIZER
                        optimizer used
  --n_iter N_ITER       optimize iterations
  --optimize_sub_g      also optimize the sub-generators
  --mse_weight MSE_WEIGHT
                        weight of MSE loss
  --enc_reg_weight ENC_REG_WEIGHT
                        weight of encoder regularization loss
tonylins commented 2 years ago

Hi, thanks for the question. We do not have a concrete benchmark about the image projection part, since it is not the focus of this paper. Therefore, I cannot recommend on how to accelerate the projection process.

I will close the issue for now. Feel free to reopen for discussion!