hlydecker commited on
Commit
90d4959
·
1 Parent(s): 88d8a4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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(im):
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 = inputs,
61
- outputs = 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()