Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import cv2
|
3 |
+
import os
|
4 |
+
|
5 |
+
def to_black(image):
|
6 |
+
output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
7 |
+
key = os.getenv("TUSHARE_TOKEN")
|
8 |
+
return output, key
|
9 |
+
|
10 |
+
|
11 |
+
kk = gr.Textbox(label="S: ", lines=5)
|
12 |
+
img = gr.outputs.Image(type='numpy')
|
13 |
+
|
14 |
+
interface = gr.Interface(fn=to_black, inputs="image", outputs=[img,kk])
|
15 |
+
interface.launch()
|