Spaces:
Running
Running
Xintao
commited on
Commit
·
b1fd1a9
1
Parent(s):
60126cc
update
Browse files
app.py
CHANGED
|
@@ -44,9 +44,10 @@ upsampler = RealESRGANer(scale=4, model_path=model_path, model=model, tile=0, ti
|
|
| 44 |
os.makedirs('output', exist_ok=True)
|
| 45 |
|
| 46 |
|
| 47 |
-
def inference(img, version, scale, weight):
|
| 48 |
-
|
| 49 |
-
|
|
|
|
| 50 |
try:
|
| 51 |
extension = os.path.splitext(os.path.basename(str(img)))[1]
|
| 52 |
img = cv2.imread(img, cv2.IMREAD_UNCHANGED)
|
|
@@ -79,7 +80,8 @@ def inference(img, version, scale, weight):
|
|
| 79 |
# model_path='CodeFormer.pth', upscale=2, arch='CodeFormer', channel_multiplier=2, bg_upsampler=upsampler)
|
| 80 |
|
| 81 |
try:
|
| 82 |
-
_, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True, weight=weight)
|
|
|
|
| 83 |
except RuntimeError as error:
|
| 84 |
print('Error', error)
|
| 85 |
|
|
|
|
| 44 |
os.makedirs('output', exist_ok=True)
|
| 45 |
|
| 46 |
|
| 47 |
+
# def inference(img, version, scale, weight):
|
| 48 |
+
def inference(img, version, scale):
|
| 49 |
+
# weight /= 100
|
| 50 |
+
print(img, version, scale)
|
| 51 |
try:
|
| 52 |
extension = os.path.splitext(os.path.basename(str(img)))[1]
|
| 53 |
img = cv2.imread(img, cv2.IMREAD_UNCHANGED)
|
|
|
|
| 80 |
# model_path='CodeFormer.pth', upscale=2, arch='CodeFormer', channel_multiplier=2, bg_upsampler=upsampler)
|
| 81 |
|
| 82 |
try:
|
| 83 |
+
# _, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True, weight=weight)
|
| 84 |
+
_, _, output = face_enhancer.enhance(img, has_aligned=False, only_center_face=False, paste_back=True)
|
| 85 |
except RuntimeError as error:
|
| 86 |
print('Error', error)
|
| 87 |
|