Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
7422b24
1
Parent(s):
e2aae4e
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,8 @@ os.mkdir("dataout")
|
|
| 12 |
model = hub.Module(name='U2Net')
|
| 13 |
def infer(img,mask,option):
|
| 14 |
img = ImageOps.contain(img, (700,700))
|
| 15 |
-
|
|
|
|
| 16 |
img.save("./data/data.png")
|
| 17 |
if option == "automatic (U2net)":
|
| 18 |
result = model.Segmentation(
|
|
|
|
| 12 |
model = hub.Module(name='U2Net')
|
| 13 |
def infer(img,mask,option):
|
| 14 |
img = ImageOps.contain(img, (700,700))
|
| 15 |
+
width, height = img.size
|
| 16 |
+
mask = mask.resize(width,height)
|
| 17 |
img.save("./data/data.png")
|
| 18 |
if option == "automatic (U2net)":
|
| 19 |
result = model.Segmentation(
|