Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,16 +18,17 @@ def predict(inp):
|
|
| 18 |
inp_np = np.array(inp)
|
| 19 |
fg = np.uint8((mask[:,:,None]*inp_np))
|
| 20 |
print("***********Inference finish****************")
|
| 21 |
-
print("***********MASK****************", inp_np.max(), mask.max())
|
|
|
|
| 22 |
|
| 23 |
-
return [mask,
|
| 24 |
|
| 25 |
print("MODEL LOADED")
|
| 26 |
print("************************************")
|
| 27 |
|
| 28 |
iface = gr.Interface(fn=predict,
|
| 29 |
inputs=gr.Image(type="numpy"),
|
| 30 |
-
outputs=[gr.Image(type="numpy"),gr.Image(type="
|
| 31 |
examples=["./logo.jpeg"])
|
| 32 |
print("****************Interface created******************")
|
| 33 |
|
|
|
|
| 18 |
inp_np = np.array(inp)
|
| 19 |
fg = np.uint8((mask[:,:,None]*inp_np))
|
| 20 |
print("***********Inference finish****************")
|
| 21 |
+
# print("***********MASK****************", inp_np.max(), mask.max())
|
| 22 |
+
fg_pil = Image.fromarray(fg, 'RGBA')
|
| 23 |
|
| 24 |
+
return [mask, fg_pil]
|
| 25 |
|
| 26 |
print("MODEL LOADED")
|
| 27 |
print("************************************")
|
| 28 |
|
| 29 |
iface = gr.Interface(fn=predict,
|
| 30 |
inputs=gr.Image(type="numpy"),
|
| 31 |
+
outputs=[gr.Image(type="numpy"),gr.Image(type="pil", image_mode='RGBA')],
|
| 32 |
examples=["./logo.jpeg"])
|
| 33 |
print("****************Interface created******************")
|
| 34 |
|