Vignesh455 commited on
Commit
e419bb4
1 Parent(s): f8df26e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,7 +2,7 @@
2
  import insightface
3
  from insightface.app import FaceAnalysis
4
  import gradio as gr
5
- import gfpgan
6
 
7
 
8
  def Swap_Face(image1,image2):
@@ -11,7 +11,7 @@ def Swap_Face(image1,image2):
11
 
12
  swapper = insightface.model_zoo.get_model("inswapper_128.onnx", download=False,
13
  download_zip=False)
14
- face_enhancer = gfpgan.GFPGANer(model_path="GFPGANv1.4.pth", upscale=1)
15
 
16
  # Do the swap
17
  face1 = app.get(image1)[0]
@@ -20,7 +20,7 @@ def Swap_Face(image1,image2):
20
  img1_ = image1.copy()
21
  result = swapper.get(img1_, face1, face2, paste_back=True)
22
 
23
- _, _, result = face_enhancer.enhance(result)
24
 
25
  return result
26
 
 
2
  import insightface
3
  from insightface.app import FaceAnalysis
4
  import gradio as gr
5
+ #import gfpgan
6
 
7
 
8
  def Swap_Face(image1,image2):
 
11
 
12
  swapper = insightface.model_zoo.get_model("inswapper_128.onnx", download=False,
13
  download_zip=False)
14
+ #face_enhancer = gfpgan.GFPGANer(model_path="GFPGANv1.4.pth", upscale=1)
15
 
16
  # Do the swap
17
  face1 = app.get(image1)[0]
 
20
  img1_ = image1.copy()
21
  result = swapper.get(img1_, face1, face2, paste_back=True)
22
 
23
+ #_, _, result = face_enhancer.enhance(result)
24
 
25
  return result
26