forked from lernapparat/lernapparat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to make available via Pytorch hub.
- Loading branch information
1 parent
541b6b1
commit ef25e2f
Showing
4 changed files
with
564 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea/ | ||
.ipynb_checkpoints | ||
*.pt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import torch.utils.model_zoo as model_zoo | ||
|
||
# Optional list of dependencies required by the package | ||
dependencies = ['torch'] | ||
|
||
|
||
def style_gan(pretrained=False, *args, **kwargs): | ||
""" | ||
TODO: Document this | ||
""" | ||
from models import style_gan | ||
if 'config' not in kwargs or kwargs['config'] is None: | ||
kwargs['config'] = {} | ||
|
||
model = style_gan.get_style_gan() | ||
|
||
checkpoint = 'https://github.com/lernapparat/lernapparat/releases/download/v2019-02-01/karras2019stylegan-ffhq' \ | ||
'-1024x1024.for_g_all.pt ' | ||
if pretrained: | ||
state_dict = model_zoo.load_url(checkpoint, map_location='cpu') | ||
model.load_state_dict(state_dict) | ||
return model |
Oops, something went wrong.