mirror of
https://git.mirrors.martin98.com/https://github.com/xuebinqin/U-2-Net
synced 2025-08-14 06:35:58 +08:00
examples and update
This commit is contained in:
parent
4fa44df9c5
commit
c51831998a
@ -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 = "<p style='text-align: center'><a href='https://openai.com/blog/clip/'>CLIP: Connecting Text and Images</a> | <a href='https://github.com/openai/CLIP'>Github Repo</a></p>"
|
||||
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 = "<p style='text-align: center'><a href='https://arxiv.org/abs/2005.09007'>U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection</a> | <a href='https://github.com/xuebinqin/U-2-Net'>Github Repo</a></p>"
|
||||
|
||||
examples = [
|
||||
['fox.jpg'],
|
||||
['parrot.jpg']
|
||||
]
|
||||
|
||||
gr.Interface(infer, inputs, outputs, title=title, description=description, article=article).launch(debug=True)
|
||||
gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, examples=examples).launch()
|
Loading…
x
Reference in New Issue
Block a user