| # Self-Distilled StyleGAN | |
| - https://arxiv.org/abs/2202.12211 | |
| - https://github.com/self-distilled-stylegan/self-distilled-internet-photos | |
| - weights | |
| - https://storage.googleapis.com/self-distilled-stylegan/dogs_1024_pytorch.pkl | |
| - https://storage.googleapis.com/self-distilled-stylegan/elephants_512_pytorch.pkl | |
| - https://storage.googleapis.com/self-distilled-stylegan/horses_256_pytorch.pkl | |
| - https://storage.googleapis.com/self-distilled-stylegan/bicycles_256_pytorch.pkl | |
| - https://storage.googleapis.com/self-distilled-stylegan/lions_512_pytorch.pkl | |
| - https://storage.googleapis.com/self-distilled-stylegan/giraffes_512_pytorch.pkl | |
| - https://storage.googleapis.com/self-distilled-stylegan/parrots_512_pytorch.pkl | |
| ```python | |
| import pathlib | |
| import pickle | |
| sys.path.insert(0, '~/codes/clones/stylegan3') | |
| paths = sorted(pathlib.Path('orig/').glob('*')) | |
| out_dir = pathlib.Path('models') | |
| out_dir.mkdir() | |
| for path in paths: | |
| with open(path, 'rb') as f: | |
| ckpt = pickle.load(f) | |
| for key in list(ckpt.keys()): | |
| if key != 'G_ema': | |
| del ckpt[key] | |
| out_path = out_dir / path.name | |
| with open(out_path, 'wb') as f: | |
| pickle.dump(ckpt, f) | |
| ``` | |