amirgame197
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,7 @@ from PIL import Image
|
|
6 |
from transparent_background import Remover
|
7 |
|
8 |
# Load model
|
9 |
-
remover = Remover() #
|
10 |
-
remover = Remover(mode='fast', jit=True, device='cuda:0', ckpt='~/latest.pth') # custom setting
|
11 |
-
remover = Remover(mode='base-nightly') # nightly release checkpoint
|
12 |
|
13 |
# Usage for image
|
14 |
|
@@ -30,6 +28,7 @@ def doo(image):
|
|
30 |
out = remover.process(img, threshold=0.5) # use threhold parameter for hard prediction.
|
31 |
|
32 |
out.save('output.png') # save result
|
|
|
33 |
|
34 |
iface = gr.Interface(fn=doo, inputs="image", outputs="image")
|
35 |
iface.launch()
|
|
|
6 |
from transparent_background import Remover
|
7 |
|
8 |
# Load model
|
9 |
+
remover = Remover(mode='fast') # custom setting
|
|
|
|
|
10 |
|
11 |
# Usage for image
|
12 |
|
|
|
28 |
out = remover.process(img, threshold=0.5) # use threhold parameter for hard prediction.
|
29 |
|
30 |
out.save('output.png') # save result
|
31 |
+
return out
|
32 |
|
33 |
iface = gr.Interface(fn=doo, inputs="image", outputs="image")
|
34 |
iface.launch()
|