Spaces:
Runtime error
Runtime error
ovshake
commited on
Commit
•
152d97b
1
Parent(s):
1646c1f
fix gpu error
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ def process_image(args, inpainting_pipeline, net):
|
|
107 |
num_inference_steps=args.num_steps).images[0]
|
108 |
clothed_image_from_pipeline = remove(clothed_image_from_pipeline)
|
109 |
clothed_image_from_pipeline = change_bg_color(clothed_image_from_pipeline, "WHITE")
|
110 |
-
return clothed_image_from_pipeline.convert("RGB")
|
111 |
|
112 |
net = load_u2net()
|
113 |
inpainting_pipeline = load_inpainting_pipeline()
|
@@ -141,8 +141,9 @@ stable_fashion_args.num_steps = num_steps
|
|
141 |
|
142 |
|
143 |
if file_name is not None:
|
144 |
-
result_image = process_image(stable_fashion_args, inpainting_pipeline, net)
|
145 |
st.image(result_image, caption='Result')
|
|
|
146 |
else:
|
147 |
stock_image = Image.open('assets/abhishek_yellow.jpg')
|
148 |
st.image(stock_image, caption='Result')
|
|
|
107 |
num_inference_steps=args.num_steps).images[0]
|
108 |
clothed_image_from_pipeline = remove(clothed_image_from_pipeline)
|
109 |
clothed_image_from_pipeline = change_bg_color(clothed_image_from_pipeline, "WHITE")
|
110 |
+
return clothed_image_from_pipeline.convert("RGB"). mask_PIL
|
111 |
|
112 |
net = load_u2net()
|
113 |
inpainting_pipeline = load_inpainting_pipeline()
|
|
|
141 |
|
142 |
|
143 |
if file_name is not None:
|
144 |
+
result_image, mask_PIL = process_image(stable_fashion_args, inpainting_pipeline, net)
|
145 |
st.image(result_image, caption='Result')
|
146 |
+
st.image(mask_PIL, caption='Mask')
|
147 |
else:
|
148 |
stock_image = Image.open('assets/abhishek_yellow.jpg')
|
149 |
st.image(stock_image, caption='Result')
|