taldanieli commited on
Commit
c51c906
·
verified ·
1 Parent(s): e4dbfcb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -2
app.py CHANGED
@@ -75,9 +75,35 @@ tab2 = gr.Interface(fn, inputs=text, outputs=[slider2, gr.File(label="output png
75
  tab3 = gr.Interface(process_file, inputs=image2, outputs=png_file, examples=["giraffe.jpg"], api_name="png")
76
 
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  demo = gr.TabbedInterface(
79
- [tab1, tab2], ["input image", "input url"], title="RMBG-2.0 for background removal <br> To purchase a commercial license, simply click <a href='https://go.bria.ai/3ZCBTLH' target='_blank'><b>Here</b></a>"
 
 
 
80
  )
81
 
82
  if __name__ == "__main__":
83
- demo.launch(show_error=True)
 
75
  tab3 = gr.Interface(process_file, inputs=image2, outputs=png_file, examples=["giraffe.jpg"], api_name="png")
76
 
77
 
78
+ import gradio as gr
79
+
80
+ hyperlinks = {
81
+ "BRIA.AI": "https://bria.ai",
82
+ "Commercial use license": "https://go.bria.ai/3ZCBTLH",
83
+ "Model card": "https://huggingface.co/briaai/RMBG-2.0",
84
+ "Blog": "https://blog.bria.ai/brias-new-state-of-the-art-remove-background-2.0-outperforms-the-competition"
85
+ }
86
+
87
+ # Create a formatted description with hyperlinks
88
+ description = f"""
89
+ Background removal model developed by <a href='{hyperlinks["BRIA.AI"]}' target='_blank'>BRIA.AI</a>, trained on a carefully selected dataset, and is available as an open-source model for non-commercial use.
90
+ For testing upload your image and wait.
91
+ <a href='{hyperlinks["Commercial use license"]}' target='_blank'>Commercial use license</a> |
92
+ <a href='{hyperlinks["Model card"]}' target='_blank'>Model card</a> |
93
+ <a href='{hyperlinks["Blog"]}' target='_blank'>Blog</a>
94
+ """
95
+
96
+ # Define tabs for the interface
97
+ tab1 = gr.inputs.Image(label="Upload Image")
98
+ tab2 = gr.inputs.Textbox(label="Enter URL")
99
+
100
+ # Create the Gradio interface
101
  demo = gr.TabbedInterface(
102
+ [tab1, tab2],
103
+ ["input image", "input url"],
104
+ title="RMBG-2.0 for background removal",
105
+ description=description
106
  )
107
 
108
  if __name__ == "__main__":
109
+ demo.launch(show_error=True)