Spaces:
Running
on
Zero
Running
on
Zero
ohayonguy
commited on
Commit
•
0305973
1
Parent(s):
ad47941
improved description
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ if os.getenv('SPACES_ZERO_GPU') == "true":
|
|
3 |
os.environ['SPACES_ZERO_GPU'] = "1"
|
4 |
os.environ['K_DIFFUSION_USE_COMPILE'] = "0"
|
5 |
import spaces
|
6 |
-
from facelib.utils.misc import is_gray
|
7 |
import cv2
|
8 |
import gradio as gr
|
9 |
import torch
|
@@ -65,9 +64,6 @@ def enhance_face(img, face_helper, has_aligned, num_flow_steps, only_center_face
|
|
65 |
if has_aligned:
|
66 |
# the input faces are already cropped and aligned
|
67 |
img = cv2.resize(img, (512, 512), interpolation=cv2.INTER_LINEAR)
|
68 |
-
face_helper.is_gray = is_gray(img, threshold=5)
|
69 |
-
if face_helper.is_gray:
|
70 |
-
print('\tgrayscale input: True')
|
71 |
face_helper.cropped_faces = [img]
|
72 |
else:
|
73 |
face_helper.read_image(img)
|
|
|
3 |
os.environ['SPACES_ZERO_GPU'] = "1"
|
4 |
os.environ['K_DIFFUSION_USE_COMPILE'] = "0"
|
5 |
import spaces
|
|
|
6 |
import cv2
|
7 |
import gradio as gr
|
8 |
import torch
|
|
|
64 |
if has_aligned:
|
65 |
# the input faces are already cropped and aligned
|
66 |
img = cv2.resize(img, (512, 512), interpolation=cv2.INTER_LINEAR)
|
|
|
|
|
|
|
67 |
face_helper.cropped_faces = [img]
|
68 |
else:
|
69 |
face_helper.read_image(img)
|