Pontarids commited on
Commit
2139316
·
verified ·
1 Parent(s): e316a66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,7 +5,6 @@ from io import BytesIO
5
  import requests
6
  import cv2
7
  import numpy as np
8
- import webbrowser
9
 
10
  def remove_and_replace_background(subject, background, blur_radius, replace_background, use_color_picker, color):
11
  with open(subject, 'rb') as subject_img_file:
@@ -109,8 +108,8 @@ def rotate_image(img_input, degrees):
109
  cv2.imwrite(image_path, rotated_image_rgb)
110
  return image_path
111
 
112
- def open_iopaint_link():
113
- webbrowser.open("https://huggingface.co/spaces/Pontarids/IOPaint_Runner")
114
 
115
  with gr.Blocks() as demo:
116
 
@@ -155,7 +154,8 @@ with gr.Blocks() as demo:
155
  img_button_rotate.click(rotate_image, inputs=[img_input_rotate, temp_slider], outputs=img_output_rotate)
156
 
157
  with gr.Tab("Object Remover"):
158
- link_button = gr.Button("Go to IOPaint Runner")
159
- link_button.click(open_iopaint_link)
 
160
 
161
  demo.launch(share=True)
 
5
  import requests
6
  import cv2
7
  import numpy as np
 
8
 
9
  def remove_and_replace_background(subject, background, blur_radius, replace_background, use_color_picker, color):
10
  with open(subject, 'rb') as subject_img_file:
 
108
  cv2.imwrite(image_path, rotated_image_rgb)
109
  return image_path
110
 
111
+ def generate_iopaint_link():
112
+ return "https://huggingface.co/spaces/Pontarids/IOPaint_Runner"
113
 
114
  with gr.Blocks() as demo:
115
 
 
154
  img_button_rotate.click(rotate_image, inputs=[img_input_rotate, temp_slider], outputs=img_output_rotate)
155
 
156
  with gr.Tab("Object Remover"):
157
+ link_output = gr.Markdown()
158
+ link_button = gr.Button("Generate IOPaint Link")
159
+ link_button.click(generate_iopaint_link, outputs=link_output)
160
 
161
  demo.launch(share=True)