Spaces:
Running
on
T4
Running
on
T4
Ahsen Khaliq
commited on
Commit
·
3c69e99
1
Parent(s):
a19e8b2
Update app.py
Browse files
app.py
CHANGED
@@ -125,13 +125,16 @@ def fit(img,maxsize=512):
|
|
125 |
img = img.resize(size)
|
126 |
return img
|
127 |
|
|
|
|
|
|
|
128 |
def process(im, version):
|
129 |
if version == 'version 0.3':
|
130 |
-
|
|
|
131 |
else:
|
132 |
-
|
133 |
-
|
134 |
-
res = proc_pil_img(im, model)
|
135 |
return res
|
136 |
|
137 |
title = "ArcaneGAN"
|
|
|
125 |
img = img.resize(size)
|
126 |
return img
|
127 |
|
128 |
+
modelv3 = torch.jit.load('./ArcaneGANv0.3.jit').eval().cuda().half()
|
129 |
+
modelv2 = torch.jit.load('./ArcaneGANv0.2.jit').eval().cuda().half()
|
130 |
+
|
131 |
def process(im, version):
|
132 |
if version == 'version 0.3':
|
133 |
+
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=2)
|
134 |
+
res = proc_pil_img(im, modelv3)
|
135 |
else:
|
136 |
+
im = scale_by_face_size(im, target_face=300, max_res=1_500_000, max_upscale=2)
|
137 |
+
res = proc_pil_img(im, modelv2)
|
|
|
138 |
return res
|
139 |
|
140 |
title = "ArcaneGAN"
|