Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,11 @@ restorer = GFPGANer(model_path='https://github.com/TencentARC/GFPGAN/releases/do
|
|
40 |
def restore_faces(input_img):
|
41 |
# 入力画像を処理
|
42 |
img = np.array(input_img)
|
|
|
|
|
43 |
_, restored_img, _ = restorer.enhance(img, has_aligned=False, only_center_face=False)
|
44 |
|
45 |
-
#
|
46 |
return restored_img
|
47 |
|
48 |
# Gradioインターフェースの作成
|
@@ -54,3 +56,4 @@ iface = gr.Interface(fn=restore_faces,
|
|
54 |
|
55 |
# アプリケーションを起動
|
56 |
iface.launch()
|
|
|
|
40 |
def restore_faces(input_img):
|
41 |
# 入力画像を処理
|
42 |
img = np.array(input_img)
|
43 |
+
|
44 |
+
# GFPGANのenhanceメソッドで顔を補正
|
45 |
_, restored_img, _ = restorer.enhance(img, has_aligned=False, only_center_face=False)
|
46 |
|
47 |
+
# 補正された画像 (restored_img) を返す
|
48 |
return restored_img
|
49 |
|
50 |
# Gradioインターフェースの作成
|
|
|
56 |
|
57 |
# アプリケーションを起動
|
58 |
iface.launch()
|
59 |
+
|