Spaces:
Running
on
Zero
Running
on
Zero
ohayonguy
commited on
Commit
•
930aadb
1
Parent(s):
1383ebb
issue with torch version
Browse files
app.py
CHANGED
@@ -76,14 +76,10 @@ def enhance_face(img, face_helper, has_aligned, only_center_face=False, paste_ba
|
|
76 |
cropped_face_t = img2tensor(cropped_face / 255., bgr2rgb=True, float32=True)
|
77 |
cropped_face_t = cropped_face_t.unsqueeze(0).to(device)
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
print("\tSucceeded PMRF out")
|
84 |
-
except RuntimeError as error:
|
85 |
-
print(f'\tFailed inference for PMRF: {error}.')
|
86 |
-
restored_face = cropped_face
|
87 |
|
88 |
restored_face = restored_face.astype('uint8')
|
89 |
face_helper.add_restored_face(restored_face)
|
|
|
76 |
cropped_face_t = img2tensor(cropped_face / 255., bgr2rgb=True, float32=True)
|
77 |
cropped_face_t = cropped_face_t.unsqueeze(0).to(device)
|
78 |
|
79 |
+
dummy_x = torch.zeros_like(cropped_face_t)
|
80 |
+
output = generate_reconstructions(pmrf, dummy_x, cropped_face_t, None, 25, device)
|
81 |
+
restored_face = tensor2img(output.squeeze(0), rgb2bgr=True, min_max=(0, 1))
|
82 |
+
# restored_face = cropped_face
|
|
|
|
|
|
|
|
|
83 |
|
84 |
restored_face = restored_face.astype('uint8')
|
85 |
face_helper.add_restored_face(restored_face)
|