Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from gluoncv.data.transforms.presets.segmentation import test_transform
|
|
9 |
# using cpu
|
10 |
ctx = mx.cpu(0)
|
11 |
|
12 |
-
model = gluoncv.model_zoo.get_model("
|
13 |
|
14 |
|
15 |
def segmentation(image):
|
@@ -18,7 +18,7 @@ def segmentation(image):
|
|
18 |
img = test_transform(img, ctx)
|
19 |
output = model.predict(img)
|
20 |
predict = mx.nd.squeeze(mx.nd.argmax(output, 1)).asnumpy()
|
21 |
-
mask = get_color_pallete(predict, "
|
22 |
return mask
|
23 |
|
24 |
|
|
|
9 |
# using cpu
|
10 |
ctx = mx.cpu(0)
|
11 |
|
12 |
+
model = gluoncv.model_zoo.get_model("deeplab_resnet101_ade", pretrained=True)
|
13 |
|
14 |
|
15 |
def segmentation(image):
|
|
|
18 |
img = test_transform(img, ctx)
|
19 |
output = model.predict(img)
|
20 |
predict = mx.nd.squeeze(mx.nd.argmax(output, 1)).asnumpy()
|
21 |
+
mask = get_color_pallete(predict, "ade20k")
|
22 |
return mask
|
23 |
|
24 |
|