akhaliq HF staff commited on
Commit
92b1fb6
1 Parent(s): d0012d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -57,13 +57,14 @@ def inference(img):
57
  return Image.fromarray(np.uint8(panoptic_result)).convert('RGB'),Image.fromarray(np.uint8(instance_result)).convert('RGB'),Image.fromarray(np.uint8(semantic_result)).convert('RGB')
58
 
59
 
60
- title = "Detectron 2"
61
- description = "Gradio demo for Detectron 2: A PyTorch-based modular object detection library. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
62
- article = "<p style='text-align: center'><a href='https://ai.facebook.com/blog/-detectron2-a-pytorch-based-modular-object-detection-library-/' target='_blank'>Detectron2: A PyTorch-based modular object detection library</a> | <a href='https://github.com/facebookresearch/detectron2' target='_blank'>Github Repo</a></p>"
 
63
 
64
  examples = [['Vj17K5z.jpg']]
65
 
66
- gr.Interface(inference, inputs=gr.inputs.Image(type="filepath"), outputs=[gr.outputs.Image(label="Panoptic segmentation",type="pil"),gr.outputs.Image(label="instance segmentation",type="pil"),gr.outputs.Image(label="semantic segmentation",type="pil")],enable_queue=True, title=title,
67
  description=description,
68
  article=article,
69
- examples=examples).launch()
 
57
  return Image.fromarray(np.uint8(panoptic_result)).convert('RGB'),Image.fromarray(np.uint8(instance_result)).convert('RGB'),Image.fromarray(np.uint8(semantic_result)).convert('RGB')
58
 
59
 
60
+ title = "Mask2Former"
61
+ description = "Gradio demo for Mask2Former: Masked-attention Mask Transformer for Universal Image Segmentation. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
62
+
63
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.01527' target='_blank'>Masked-attention Mask Transformer for Universal Image Segmentation</a> | <a href='https://github.com/facebookresearch/Mask2Former' target='_blank'>Github Repo</a></p>"
64
 
65
  examples = [['Vj17K5z.jpg']]
66
 
67
+ gr.Interface(inference, inputs=gr.inputs.Image(type="filepath"), outputs=[gr.outputs.Image(label="Panoptic segmentation",type="pil"),gr.outputs.Image(label="instance segmentation",type="pil"),gr.outputs.Image(label="semantic segmentation",type="pil")], title=title,
68
  description=description,
69
  article=article,
70
+ examples=examples).launch(enable_queue=True,cache_examples=True)