HighCWu commited on
Commit
99497f5
1 Parent(s): ce24a6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -25,7 +25,6 @@ from face_inpainting import FaceInpainting
25
 
26
 
27
  def inference(file, mode):
28
-
29
 
30
  im_orig = cv2.imread(file, cv2.IMREAD_COLOR)
31
  im = cv2.resize(im_orig, (0,0), fx=2, fy=2)
@@ -47,8 +46,7 @@ def inference(file, mode):
47
  elif mode == "inpainting":
48
  model = {'name':'GPEN-Inpainting-1024', 'size':1024}
49
  faceinpainter = FaceInpainting(size=model['size'], model=model['name'], channel_multiplier=2, device='cpu')
50
- im = np.asarray(brush_stroke_mask(Image.fromarray(im_orig)))
51
- inpaint = faceinpainter.process(im)
52
  cv2.imwrite(os.path.join("output.png"), inpaint)
53
  return os.path.join("output.png")
54
  elif mode == "selfie":
 
25
 
26
 
27
  def inference(file, mode):
 
28
 
29
  im_orig = cv2.imread(file, cv2.IMREAD_COLOR)
30
  im = cv2.resize(im_orig, (0,0), fx=2, fy=2)
 
46
  elif mode == "inpainting":
47
  model = {'name':'GPEN-Inpainting-1024', 'size':1024}
48
  faceinpainter = FaceInpainting(size=model['size'], model=model['name'], channel_multiplier=2, device='cpu')
49
+ inpaint = faceinpainter.process(im_orig)
 
50
  cv2.imwrite(os.path.join("output.png"), inpaint)
51
  return os.path.join("output.png")
52
  elif mode == "selfie":