Spaces:
doevent
/
Running on Zero

ohayonguy commited on
Commit
8b15c69
1 Parent(s): 797cd30

trying to fix daemonic processes error

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -56,7 +56,6 @@ def enhance_face(img, face_helper, has_aligned, only_center_face=False, paste_ba
56
  # TODO: even with eye_dist_threshold, it will still introduce wrong detections and restorations.
57
  # align and warp each face
58
  face_helper.align_warp_face()
59
- return img, img, img
60
  # face restoration
61
  for cropped_face in face_helper.cropped_faces:
62
  # prepare data
@@ -64,9 +63,10 @@ def enhance_face(img, face_helper, has_aligned, only_center_face=False, paste_ba
64
  cropped_face_t = cropped_face_t.unsqueeze(0).to(device)
65
 
66
  try:
67
- dummy_x = torch.zeros_like(cropped_face_t)
68
- output = pmrf.generate_reconstructions(dummy_x, cropped_face_t, None, 25, device)
69
- restored_face = tensor2img(output.squeeze(0), rgb2bgr=True, min_max=(0, 1))
 
70
  except RuntimeError as error:
71
  print(f'\tFailed inference for PMRF: {error}.')
72
  restored_face = cropped_face
 
56
  # TODO: even with eye_dist_threshold, it will still introduce wrong detections and restorations.
57
  # align and warp each face
58
  face_helper.align_warp_face()
 
59
  # face restoration
60
  for cropped_face in face_helper.cropped_faces:
61
  # prepare data
 
63
  cropped_face_t = cropped_face_t.unsqueeze(0).to(device)
64
 
65
  try:
66
+ restored_face = img
67
+ # dummy_x = torch.zeros_like(cropped_face_t)
68
+ # output = pmrf.generate_reconstructions(dummy_x, cropped_face_t, None, 25, device)
69
+ # restored_face = tensor2img(output.squeeze(0), rgb2bgr=True, min_max=(0, 1))
70
  except RuntimeError as error:
71
  print(f'\tFailed inference for PMRF: {error}.')
72
  restored_face = cropped_face