Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -133,10 +133,11 @@ def inference(file, mode):
|
|
133 |
elif mode == "inpainting":
|
134 |
im1 = cv2.imread(file, cv2.IMREAD_COLOR)
|
135 |
im2 = image_resize(im1, width = 1024)
|
|
|
136 |
model = {'name':'GPEN-Inpainting-1024', 'size':1024}
|
137 |
faceinpainter = FaceInpainting(size=model['size'], model=model['name'], channel_multiplier=2, device='cpu')
|
138 |
-
|
139 |
-
inpaint = faceinpainter.process(
|
140 |
|
141 |
cv2.imwrite(os.path.join("output.png"), inpaint)
|
142 |
return os.path.join("output.png")
|
|
|
133 |
elif mode == "inpainting":
|
134 |
im1 = cv2.imread(file, cv2.IMREAD_COLOR)
|
135 |
im2 = image_resize(im1, width = 1024)
|
136 |
+
im3 = cv2.resize(im2, (0,0), fx=3, fy=3)
|
137 |
model = {'name':'GPEN-Inpainting-1024', 'size':1024}
|
138 |
faceinpainter = FaceInpainting(size=model['size'], model=model['name'], channel_multiplier=2, device='cpu')
|
139 |
+
im4 = np.asarray(brush_stroke_mask(Image.fromarray(im3)))
|
140 |
+
inpaint = faceinpainter.process(im4)
|
141 |
|
142 |
cv2.imwrite(os.path.join("output.png"), inpaint)
|
143 |
return os.path.join("output.png")
|