File size: 563 Bytes
9567606
1ea8e84
9567606
3fdadb5
 
1ea8e84
 
 
9567606
1ea8e84
3fdadb5
1ea8e84
3fdadb5
 
9567606
3fdadb5
 
 
 
9567606
 
3fdadb5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
from rembg import remove

# Функция для удаления водяных знаков с изображения
def remove_watermark(input_image):
    # Загрузка изображения и удаление фона
    with open("input.png", "wb") as f:
        f.write(input_image.read())

    output = remove("input.png")

    return output.tobytes()

# Создание Gradio приложения
iface = gr.Interface(
    fn=remove_watermark,
    inputs=gr.Image(),
    outputs=gr.Image(),
    live=True,
)

iface.launch()