sczhou commited on
Commit
847a6aa
1 Parent(s): dcc976d

add pre_face_align option.

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -108,15 +108,17 @@ def inference(image, face_align, background_enhance, face_upsample, upscale, cod
108
  """Run a single prediction on the model"""
109
  try: # global try
110
  # take the default setting for the demo
111
- has_aligned = not face_align
112
  only_center_face = False
113
  draw_box = False
114
  detection_model = "retinaface_resnet50"
115
- print('Inp:', image, background_enhance, face_upsample, upscale, codeformer_fidelity)
116
 
 
 
117
  background_enhance = background_enhance if background_enhance is not None else True
118
  face_upsample = face_upsample if face_upsample is not None else True
119
  upscale = upscale if (upscale is not None and upscale > 0) else 2
 
 
120
  upscale = 1 if has_aligned else upscale
121
 
122
  img = cv2.imread(str(image), cv2.IMREAD_COLOR)
 
108
  """Run a single prediction on the model"""
109
  try: # global try
110
  # take the default setting for the demo
 
111
  only_center_face = False
112
  draw_box = False
113
  detection_model = "retinaface_resnet50"
 
114
 
115
+ print('Inp:', image, background_enhance, face_upsample, upscale, codeformer_fidelity)
116
+ face_align = face_align if face_align is not None else True
117
  background_enhance = background_enhance if background_enhance is not None else True
118
  face_upsample = face_upsample if face_upsample is not None else True
119
  upscale = upscale if (upscale is not None and upscale > 0) else 2
120
+
121
+ has_aligned = not face_align
122
  upscale = 1 if has_aligned else upscale
123
 
124
  img = cv2.imread(str(image), cv2.IMREAD_COLOR)