Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ cfg.MODEL.WEIGHTS = "model_weights/chatswood_buildings_poc.pth"
|
|
31 |
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 8
|
32 |
predictor = DefaultPredictor(cfg)
|
33 |
|
34 |
-
def segment_buildings(
|
35 |
|
36 |
im = cv2.imread(im)
|
37 |
outputs = predictor(im)
|
@@ -49,16 +49,16 @@ gr_slider_confidence = gr.inputs.Slider(0,1,.1,.7,
|
|
49 |
label='Set confidence threshold % for masks')
|
50 |
"""
|
51 |
# gradio outputs
|
52 |
-
inputs = gr.inputs.Image(type="pil", label="Input Image")
|
53 |
-
outputs = gr.outputs.Image(type="pil", label="Output Image")
|
54 |
|
55 |
title = "Building Segmentation"
|
56 |
description = "An instance segmentation demo for identifying boundaries of buildings in aerial images using DETR (End-to-End Object Detection) model with MaskRCNN-101 backbone"
|
57 |
|
58 |
# Create user interface and launch
|
59 |
gr.Interface(segment_buildings,
|
60 |
-
inputs =
|
61 |
-
outputs =
|
62 |
title = title,
|
63 |
enable_queue = True,
|
64 |
description = description).launch()
|
|
|
31 |
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 8
|
32 |
predictor = DefaultPredictor(cfg)
|
33 |
|
34 |
+
def segment_buildings(inp):
|
35 |
|
36 |
im = cv2.imread(im)
|
37 |
outputs = predictor(im)
|
|
|
49 |
label='Set confidence threshold % for masks')
|
50 |
"""
|
51 |
# gradio outputs
|
52 |
+
# inputs = gr.inputs.Image(type="pil", label="Input Image")
|
53 |
+
# outputs = gr.outputs.Image(type="pil", label="Output Image")
|
54 |
|
55 |
title = "Building Segmentation"
|
56 |
description = "An instance segmentation demo for identifying boundaries of buildings in aerial images using DETR (End-to-End Object Detection) model with MaskRCNN-101 backbone"
|
57 |
|
58 |
# Create user interface and launch
|
59 |
gr.Interface(segment_buildings,
|
60 |
+
inputs = "image",
|
61 |
+
outputs = "image",
|
62 |
title = title,
|
63 |
enable_queue = True,
|
64 |
description = description).launch()
|