lkeab commited on
Commit
6b8f616
1 Parent(s): 6e5b173

update app

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -38,10 +38,12 @@ predictor = DefaultPredictor(cfg)
38
 
39
 
40
  def inference(image):
41
- img = np.array(image)
 
 
42
  outputs = predictor(img)
43
 
44
- v = Visualizer(img, MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale=1.2)
45
  out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
46
 
47
  return out.get_image()
@@ -49,7 +51,7 @@ def inference(image):
49
 
50
 
51
  title = "Mask Transfiner R50 model"
52
- description = "Demo for Mask Transfiner based on R50-FPN. To use it, simply upload your image, or click one of the examples to load them. It runs in the cpu environment provided by Hugging Face. Read more at the links below."
53
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.13673'>Mask Transfiner for High-Quality Instance Segmentation, CVPR 2022</a> | <a href='https://github.com/SysCV/transfiner'>Mask Transfiner Github</a></p>"
54
 
55
  gr.Interface(
 
38
 
39
 
40
  def inference(image):
41
+ image = np.asarray(image)
42
+
43
+ #img = np.array(image)
44
  outputs = predictor(img)
45
 
46
+ v = Visualizer(img, MetadataCatalog.get(cfg.DATASETS.TRAIN[0]))
47
  out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
48
 
49
  return out.get_image()
 
51
 
52
 
53
  title = "Mask Transfiner R50 model"
54
+ description = "Demo for <a href='https://arxiv.org/abs/2111.13673'>Mask Transfiner for High-Quality Instance Segmentation, CVPR 2022</a> based on R50-FPN. To use it, simply upload your image, or click one of the examples to load them. It runs in the cpu environment provided by Hugging Face. Read more at the links below."
55
  article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.13673'>Mask Transfiner for High-Quality Instance Segmentation, CVPR 2022</a> | <a href='https://github.com/SysCV/transfiner'>Mask Transfiner Github</a></p>"
56
 
57
  gr.Interface(