Spaces:
Sleeping
Sleeping
Commit
·
c1dd8ce
1
Parent(s):
5fd022f
up 1
Browse files
app.py
CHANGED
|
@@ -23,8 +23,8 @@ def predict(input_img1,
|
|
| 23 |
):
|
| 24 |
|
| 25 |
print("predict")
|
| 26 |
-
input_img1 = Image.fromarray(input_img1)
|
| 27 |
-
input_img2 = Image.fromarray(input_img2)
|
| 28 |
|
| 29 |
input_img1 = input_img1.resize((WIDTH, HEIGHT))
|
| 30 |
input_img2 = input_img2.resize((WIDTH, WIDTH))
|
|
@@ -32,31 +32,32 @@ def predict(input_img1,
|
|
| 32 |
canvas_mask = np.array(input_img2)
|
| 33 |
mask = get_mask(canvas_mask)
|
| 34 |
|
| 35 |
-
print(input_img1, mask)
|
| 36 |
|
| 37 |
-
result_image = make_inpainting(positive_prompt=
|
| 38 |
image=input_img1,
|
| 39 |
mask_image=mask,
|
| 40 |
-
negative_prompt=
|
| 41 |
)
|
| 42 |
|
| 43 |
return result_image
|
| 44 |
|
| 45 |
-
def test1(param1):
|
| 46 |
-
return "here !"
|
| 47 |
|
| 48 |
-
gr.Interface(
|
| 49 |
predict,
|
| 50 |
-
inputs=[gr.Image(label="img", sources=['upload'
|
| 51 |
-
gr.Image(label="mask", sources=['upload'
|
| 52 |
-
gr.Textbox(label="positive_prompt"),
|
| 53 |
-
gr.Textbox(label="negative_prompt")
|
| 54 |
],
|
| 55 |
outputs= gr.Image(label="resp"),
|
| 56 |
title="rem fur 1",
|
| 57 |
-
)
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
#
|
|
|
|
|
|
|
|
|
|
| 60 |
# gr.Interface(
|
| 61 |
# test1,
|
| 62 |
# inputs=[gr.Textbox(label="param1")],
|
|
|
|
| 23 |
):
|
| 24 |
|
| 25 |
print("predict")
|
| 26 |
+
# input_img1 = Image.fromarray(input_img1)
|
| 27 |
+
# input_img2 = Image.fromarray(input_img2)
|
| 28 |
|
| 29 |
input_img1 = input_img1.resize((WIDTH, HEIGHT))
|
| 30 |
input_img2 = input_img2.resize((WIDTH, WIDTH))
|
|
|
|
| 32 |
canvas_mask = np.array(input_img2)
|
| 33 |
mask = get_mask(canvas_mask)
|
| 34 |
|
| 35 |
+
print(input_img1, mask,positive_prompt,negative_prompt)
|
| 36 |
|
| 37 |
+
result_image = make_inpainting(positive_prompt="empty room",
|
| 38 |
image=input_img1,
|
| 39 |
mask_image=mask,
|
| 40 |
+
negative_prompt="",
|
| 41 |
)
|
| 42 |
|
| 43 |
return result_image
|
| 44 |
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
app = gr.Interface(
|
| 47 |
predict,
|
| 48 |
+
inputs=[gr.Image(label="img", sources=['upload'], type="pil"),
|
| 49 |
+
gr.Image(label="mask", sources=['upload'], type="pil")
|
|
|
|
|
|
|
| 50 |
],
|
| 51 |
outputs= gr.Image(label="resp"),
|
| 52 |
title="rem fur 1",
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
app.launch(share=True)
|
| 56 |
+
|
| 57 |
#
|
| 58 |
+
# gr.Textbox(label="positive_prompt"),
|
| 59 |
+
# gr.Textbox(label="negative_prompt")
|
| 60 |
+
|
| 61 |
# gr.Interface(
|
| 62 |
# test1,
|
| 63 |
# inputs=[gr.Textbox(label="param1")],
|