Spaces:
Running
on
Zero
Running
on
Zero
ohayonguy
commited on
Commit
·
595f913
1
Parent(s):
bfc1040
improved interface
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ import torch
|
|
10 |
from basicsr.archs.srvgg_arch import SRVGGNetCompact
|
11 |
from basicsr.utils import img2tensor, tensor2img
|
12 |
from gradio_imageslider import ImageSlider
|
13 |
-
from pytorch_lightning.utilities.seed import seed_everything
|
14 |
from facexlib.utils.face_restoration_helper import FaceRestoreHelper
|
15 |
from realesrgan.utils import RealESRGANer
|
16 |
|
@@ -113,7 +112,7 @@ def enhance_face(img, face_helper, has_aligned, num_flow_steps, only_center_face
|
|
113 |
def inference(seed, randomize_seed, img, aligned, scale, num_flow_steps):
|
114 |
if randomize_seed:
|
115 |
seed = random.randint(0, MAX_SEED)
|
116 |
-
|
117 |
if scale > 4:
|
118 |
scale = 4 # avoid too large scale value
|
119 |
img = cv2.imread(img, cv2.IMREAD_UNCHANGED)
|
|
|
10 |
from basicsr.archs.srvgg_arch import SRVGGNetCompact
|
11 |
from basicsr.utils import img2tensor, tensor2img
|
12 |
from gradio_imageslider import ImageSlider
|
|
|
13 |
from facexlib.utils.face_restoration_helper import FaceRestoreHelper
|
14 |
from realesrgan.utils import RealESRGANer
|
15 |
|
|
|
112 |
def inference(seed, randomize_seed, img, aligned, scale, num_flow_steps):
|
113 |
if randomize_seed:
|
114 |
seed = random.randint(0, MAX_SEED)
|
115 |
+
torch.manual_seed(seed)
|
116 |
if scale > 4:
|
117 |
scale = 4 # avoid too large scale value
|
118 |
img = cv2.imread(img, cv2.IMREAD_UNCHANGED)
|