KilicMehmet commited on
Commit
fd74233
·
verified ·
1 Parent(s): f8c4b8c

Upload app.py.py

Browse files
Files changed (1) hide show
  1. app.py.py +25 -0
app.py.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cv2 as cv
2
+ import numpy as np
3
+ import gradio as gr
4
+
5
+ # Görseli siyah-beyaza dönüştüren fonksiyon
6
+ def nostalji(resim):
7
+ resim = np.array(resim)
8
+ geri_resim = cv.cvtColor(resim, cv.COLOR_BGR2GRAY) # resmi grı yapar
9
+ return geri_resim
10
+
11
+ # Gradio arayüzü oluştur
12
+ with gr.Blocks() as demo:
13
+ gr.Markdown("# Görseli Siyah Beyaza Çevir!")
14
+ gr.Markdown("Bir resim yükleyin ve siyah beyaza çevrilsin!")
15
+
16
+ image_input = gr.Image(type='pil', label="Girdi Görseli")
17
+ image_output = gr.Image(type="numpy", label="Sonuç Görseli")
18
+
19
+ # Bileşenleri fonksiyonla bağla
20
+ btn = gr.Button("Çevir")
21
+ btn.click(fn=nostalji, inputs=image_input, outputs=image_output)
22
+
23
+ # Gradio arayüzünü başlat
24
+ if __name__ == "__main__":
25
+ demo.launch(share=True)