From c51831998a0aa938a408f25d75de1f8a99719b1f Mon Sep 17 00:00:00 2001 From: AK391 Date: Wed, 5 May 2021 12:39:42 -0400 Subject: [PATCH] examples and update --- gradio/demo.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gradio/demo.py b/gradio/demo.py index 32ae04e..2ad81ef 100644 --- a/gradio/demo.py +++ b/gradio/demo.py @@ -1,6 +1,11 @@ import cv2 import paddlehub as hub import gradio as gr +import torch + +# Images +torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2018/08/12/16/59/ara-3601194_1280.jpg', 'parrot.jpg') +torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2016/10/21/14/46/fox-1758183_1280.jpg', 'fox.jpg') model = hub.Module(name='U2Net') @@ -20,9 +25,13 @@ outputs = [ gr.outputs.Image(type="numpy",label="Mask") ] -title = "Artline" -description = "demo for OpenAI's CLIP. To use it, simply upload your image, or click one of the examples to load them and optionally add a text label seperated by commas to help clip classify the image better. Read more at the links below." -article = "

CLIP: Connecting Text and Images | Github Repo

" +title = "U^2-Net" +description = "demo for U^2-Net. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below." +article = "

U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection | Github Repo

" +examples = [ + ['fox.jpg'], + ['parrot.jpg'] +] -gr.Interface(infer, inputs, outputs, title=title, description=description, article=article).launch(debug=True) \ No newline at end of file +gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, examples=examples).launch() \ No newline at end of file