Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,12 +16,10 @@ model2 = torch.hub.load(
|
|
| 16 |
model1 = torch.hub.load("AK391/animegan2-pytorch:main", "generator", pretrained="celeba_distill", device="cpu")
|
| 17 |
face2paint = torch.hub.load(
|
| 18 |
'AK391/animegan2-pytorch:main', 'face2paint',
|
| 19 |
-
size=
|
| 20 |
)
|
| 21 |
def inference(img, ver):
|
| 22 |
-
|
| 23 |
-
out = face2paint(model2, img)
|
| 24 |
-
else:
|
| 25 |
out = face2paint(model1, img)
|
| 26 |
return out
|
| 27 |
|
|
|
|
| 16 |
model1 = torch.hub.load("AK391/animegan2-pytorch:main", "generator", pretrained="celeba_distill", device="cpu")
|
| 17 |
face2paint = torch.hub.load(
|
| 18 |
'AK391/animegan2-pytorch:main', 'face2paint',
|
| 19 |
+
size=img.shape[1], device="cpu",side_by_side=False
|
| 20 |
)
|
| 21 |
def inference(img, ver):
|
| 22 |
+
|
|
|
|
|
|
|
| 23 |
out = face2paint(model1, img)
|
| 24 |
return out
|
| 25 |
|