Spaces:
Sleeping
Sleeping
michaelapplydesign
commited on
Commit
•
405f281
1
Parent(s):
f5b68ac
test 1024
Browse files
app.py
CHANGED
@@ -17,7 +17,10 @@ def image_to_byte_array(image: Image) -> bytes:
|
|
17 |
return imgByteArr
|
18 |
|
19 |
def predict(input_img1,
|
20 |
-
input_img2
|
|
|
|
|
|
|
21 |
|
22 |
print("predict")
|
23 |
input_img1 = Image.fromarray(input_img1)
|
@@ -31,22 +34,35 @@ def predict(input_img1,
|
|
31 |
|
32 |
print(input_img1, mask)
|
33 |
|
34 |
-
result_image = make_inpainting(positive_prompt=
|
35 |
image=input_img1,
|
36 |
mask_image=mask,
|
37 |
-
negative_prompt=
|
38 |
)
|
39 |
|
40 |
return result_image
|
41 |
|
42 |
-
|
|
|
|
|
|
|
43 |
predict,
|
44 |
inputs=[gr.Image(label="img", sources=['upload', 'webcam'], type="numpy"),
|
45 |
-
gr.Image(label="mask", sources=['upload', 'webcam'], type="numpy")
|
|
|
|
|
46 |
],
|
47 |
outputs= gr.Image(label="resp"),
|
48 |
title="rem fur 1",
|
49 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
gradio_app.launch(share=True)
|
52 |
|
|
|
17 |
return imgByteArr
|
18 |
|
19 |
def predict(input_img1,
|
20 |
+
input_img2,
|
21 |
+
positive_prompt,
|
22 |
+
negative_prompt
|
23 |
+
):
|
24 |
|
25 |
print("predict")
|
26 |
input_img1 = Image.fromarray(input_img1)
|
|
|
34 |
|
35 |
print(input_img1, mask)
|
36 |
|
37 |
+
result_image = make_inpainting(positive_prompt=positive_prompt,
|
38 |
image=input_img1,
|
39 |
mask_image=mask,
|
40 |
+
negative_prompt=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', 'webcam'], type="numpy"),
|
51 |
+
gr.Image(label="mask", sources=['upload', 'webcam'], type="numpy"),
|
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 |
+
).launch(share=True)
|
58 |
+
#
|
59 |
+
#
|
60 |
+
# gr.Interface(
|
61 |
+
# test1,
|
62 |
+
# inputs=[gr.Textbox(label="param1")],
|
63 |
+
# outputs= gr.Textbox(label="result"),
|
64 |
+
# title="rem fur 1",
|
65 |
+
# ).launch(share=True)
|
66 |
+
|
67 |
|
|
|
68 |
|
config.py
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
"""File with configs"""
|
2 |
from palette import COLOR_MAPPING_, COLOR_MAPPING
|
3 |
|
4 |
-
HEIGHT =
|
5 |
-
WIDTH =
|
|
|
|
|
|
|
6 |
|
7 |
def to_rgb(color: str) -> tuple:
|
8 |
"""Convert hex color to rgb.
|
|
|
1 |
"""File with configs"""
|
2 |
from palette import COLOR_MAPPING_, COLOR_MAPPING
|
3 |
|
4 |
+
HEIGHT = 1024
|
5 |
+
WIDTH = 1024
|
6 |
+
# HEIGHT = 512
|
7 |
+
# WIDTH = 512
|
8 |
+
|
9 |
|
10 |
def to_rgb(color: str) -> tuple:
|
11 |
"""Convert hex color to rgb.
|