ehristoforu commited on
Commit
045d692
1 Parent(s): a76354d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -3,11 +3,11 @@ import cv2
3
  import numpy as np
4
 
5
  def upscale_image(input_image, radio_input):
6
- # Увеличиваем размер изображения в 2 раза
7
  upscale_factor = radio_input
8
  output_image = cv2.resize(input_image, None, fx = upscale_factor, fy = upscale_factor, interpolation = cv2.INTER_CUBIC)
9
  return output_image
10
- radio_input = gr.Radio(label="Upscale Levels", choices=[2, 4], value=2)
11
- # Создаем интерфейс Gradio
12
- iface = gr.Interface(fn=upscale_image, inputs = [gr.Image(label="Input Image", interactive=True), radio_input], outputs = gr.Image(label="Upscaled Image"), title="Image Upscaler")
13
- iface.launch()
 
 
3
  import numpy as np
4
 
5
  def upscale_image(input_image, radio_input):
 
6
  upscale_factor = radio_input
7
  output_image = cv2.resize(input_image, None, fx = upscale_factor, fy = upscale_factor, interpolation = cv2.INTER_CUBIC)
8
  return output_image
9
+
10
+ radio_input = gr.Radio(label="Upscale Levels", choices=[2, 4, 6, 8], value=2)
11
+
12
+ iface = gr.Interface(fn=upscale_image, inputs = [gr.Image(label="Input Image", interactive=True), radio_input], outputs = gr.Image(label="Upscaled Image"), title="Image Upscaler", description="""In this space you can increase the size and quality of your images. \n⚠️ Enlarging the image and "Upscale Level" do not always improve image quality!""")
13
+ iface.launch(show_api=False)