Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bob.paper.ijcb2021_synthetic_dataset
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.paper.ijcb2021_synthetic_dataset
Commits
64bc5ca7
Commit
64bc5ca7
authored
3 years ago
by
Laurent COLBOIS
Browse files
Options
Downloads
Patches
Plain Diff
Fix StyleGAN2 pickle loading
parent
84ef2f60
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/paper/ijcb2021_synthetic_dataset/stylegan2/generator.py
+5
-2
5 additions, 2 deletions
bob/paper/ijcb2021_synthetic_dataset/stylegan2/generator.py
bob/paper/ijcb2021_synthetic_dataset/stylegan2/pretrained_networks.py
+0
-1
0 additions, 1 deletion
...cb2021_synthetic_dataset/stylegan2/pretrained_networks.py
with
5 additions
and
3 deletions
bob/paper/ijcb2021_synthetic_dataset/stylegan2/generator.py
+
5
−
2
View file @
64bc5ca7
from
.
import
dnnlib
,
pretrained_networks
from
.
import
dnnlib
from
.dnnlib
import
tflib
from
..
import
utils
from
bob.extension
import
rc
import
numpy
as
np
import
bob.io.image
import
tensorflow
as
tf
import
pickle
class
StyleGAN2Generator
(
object
):
def
__init__
(
self
,
...
...
@@ -24,7 +25,9 @@ class StyleGAN2Generator(object):
and for all at initialization.
:param image_postprocessing_fn : Additional function to apply to the generated images before saving.
"""
_G
,
_D
,
Gs
=
pretrained_networks
.
load_networks
(
sg2_path
)
with
open
(
sg2_path
,
'
rb
'
)
as
pkl_file
:
_G
,
_D
,
Gs
=
pickle
.
load
(
pkl_file
)
self
.
network
=
Gs
self
.
latent_dim
=
self
.
network
.
input_shape
[
-
1
]
self
.
run_kwargs
=
{
'
randomize_noise
'
:
randomize_noise
,
...
...
This diff is collapsed.
Click to expand it.
bob/paper/ijcb2021_synthetic_dataset/stylegan2/pretrained_networks.py
+
0
−
1
View file @
64bc5ca7
...
...
@@ -9,7 +9,6 @@
import
pickle
import
sys
import
os
sys
.
path
.
append
(
'
/idiap/home/lcolbois/colbois_reporting/synthface/synthface/stylegan2
'
)
from
.
import
dnnlib
from
dnnlib
import
tflib
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment