Spaces:
Build error
Build error
Jeremy Hummel
commited on
Commit
Β·
5e8bcf0
1
Parent(s):
9c66f40
fixes imports
Browse files- {stylegan3/dnnlib β dnnlib}/__init__.py +0 -0
- {stylegan3/dnnlib β dnnlib}/util.py +0 -0
- stylegan3/legacy.py β legacy.py +2 -2
- stylegan3/__init__.py +0 -2
- {stylegan3/torch_utils β torch_utils}/__init__.py +0 -0
- {stylegan3/torch_utils β torch_utils}/custom_ops.py +0 -0
- {stylegan3/torch_utils β torch_utils}/misc.py +1 -1
- {stylegan3/torch_utils β torch_utils}/ops/__init__.py +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/bias_act.cpp +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/bias_act.cu +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/bias_act.h +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/bias_act.py +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/conv2d_gradfix.py +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/conv2d_resample.py +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.cpp +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.cu +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.h +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.py +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu_ns.cu +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu_rd.cu +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu_wr.cu +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/fma.py +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/grid_sample_gradfix.py +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.cpp +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.cu +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.h +0 -0
- {stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.py +0 -0
- {stylegan3/torch_utils β torch_utils}/persistence.py +0 -0
- {stylegan3/torch_utils β torch_utils}/training_stats.py +0 -0
- visualize.py +4 -3
{stylegan3/dnnlib β dnnlib}/__init__.py
RENAMED
File without changes
|
{stylegan3/dnnlib β dnnlib}/util.py
RENAMED
File without changes
|
stylegan3/legacy.py β legacy.py
RENAMED
@@ -14,8 +14,8 @@ import re
|
|
14 |
import copy
|
15 |
import numpy as np
|
16 |
import torch
|
17 |
-
|
18 |
-
from
|
19 |
|
20 |
#----------------------------------------------------------------------------
|
21 |
|
|
|
14 |
import copy
|
15 |
import numpy as np
|
16 |
import torch
|
17 |
+
import dnnlib
|
18 |
+
from torch_utils import misc
|
19 |
|
20 |
#----------------------------------------------------------------------------
|
21 |
|
stylegan3/__init__.py
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
from stylegan3.dnnlib.util import open_url
|
2 |
-
from stylegan3.legacy import load_network_pkl
|
|
|
|
|
|
{stylegan3/torch_utils β torch_utils}/__init__.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/custom_ops.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/misc.py
RENAMED
@@ -11,7 +11,7 @@ import contextlib
|
|
11 |
import numpy as np
|
12 |
import torch
|
13 |
import warnings
|
14 |
-
|
15 |
|
16 |
#----------------------------------------------------------------------------
|
17 |
# Cached construction of constant tensors. Avoids CPU=>GPU copy when the
|
|
|
11 |
import numpy as np
|
12 |
import torch
|
13 |
import warnings
|
14 |
+
import dnnlib
|
15 |
|
16 |
#----------------------------------------------------------------------------
|
17 |
# Cached construction of constant tensors. Avoids CPU=>GPU copy when the
|
{stylegan3/torch_utils β torch_utils}/ops/__init__.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/bias_act.cpp
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/bias_act.cu
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/bias_act.h
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/bias_act.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/conv2d_gradfix.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/conv2d_resample.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.cpp
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.cu
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.h
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu_ns.cu
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu_rd.cu
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/filtered_lrelu_wr.cu
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/fma.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/grid_sample_gradfix.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.cpp
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.cu
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.h
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/ops/upfirdn2d.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/persistence.py
RENAMED
File without changes
|
{stylegan3/torch_utils β torch_utils}/training_stats.py
RENAMED
File without changes
|
visualize.py
CHANGED
@@ -5,7 +5,8 @@ import random
|
|
5 |
import torch
|
6 |
from moviepy.audio.AudioClip import AudioArrayClip
|
7 |
from tqdm import tqdm
|
8 |
-
import
|
|
|
9 |
|
10 |
target_sr = 22050
|
11 |
|
@@ -64,8 +65,8 @@ def visualize(audio_file,
|
|
64 |
|
65 |
# Load pre-trained model
|
66 |
device = torch.device('cuda')
|
67 |
-
with
|
68 |
-
G =
|
69 |
G.eval()
|
70 |
|
71 |
with torch.no_grad():
|
|
|
5 |
import torch
|
6 |
from moviepy.audio.AudioClip import AudioArrayClip
|
7 |
from tqdm import tqdm
|
8 |
+
import dnnlib
|
9 |
+
import legacy
|
10 |
|
11 |
target_sr = 22050
|
12 |
|
|
|
65 |
|
66 |
# Load pre-trained model
|
67 |
device = torch.device('cuda')
|
68 |
+
with dnnlib.util.open_url(network) as f:
|
69 |
+
G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
|
70 |
G.eval()
|
71 |
|
72 |
with torch.no_grad():
|