Spaces:
Running
Running
Update
Browse files- dualstylegan.py +4 -1
dualstylegan.py
CHANGED
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
2 |
|
3 |
import argparse
|
4 |
import os
|
|
|
5 |
import sys
|
6 |
from typing import Callable, Union
|
7 |
|
@@ -17,7 +18,9 @@ if os.environ.get('SYSTEM') == 'spaces':
|
|
17 |
os.system("sed -i '10,17d' DualStyleGAN/model/stylegan/op/fused_act.py")
|
18 |
os.system("sed -i '10,17d' DualStyleGAN/model/stylegan/op/upfirdn2d.py")
|
19 |
|
20 |
-
|
|
|
|
|
21 |
|
22 |
from model.dualstylegan import DualStyleGAN
|
23 |
from model.encoder.align_all_parallel import align_face
|
|
|
2 |
|
3 |
import argparse
|
4 |
import os
|
5 |
+
import pathlib
|
6 |
import sys
|
7 |
from typing import Callable, Union
|
8 |
|
|
|
18 |
os.system("sed -i '10,17d' DualStyleGAN/model/stylegan/op/fused_act.py")
|
19 |
os.system("sed -i '10,17d' DualStyleGAN/model/stylegan/op/upfirdn2d.py")
|
20 |
|
21 |
+
app_dir = pathlib.Path(__file__).parent
|
22 |
+
submodule_dir = app_dir / 'DualStyleGAN'
|
23 |
+
sys.path.insert(0, submodule_dir.as_posix())
|
24 |
|
25 |
from model.dualstylegan import DualStyleGAN
|
26 |
from model.encoder.align_all_parallel import align_face
|