File size: 344 Bytes
0a1f388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
import cv2
import os

def to_black(image):
    output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    key = os.getenv("TUSHARE_TOKEN")
    return output, key


kk = gr.Textbox(label="S: ", lines=5)
img = gr.outputs.Image(type='numpy')

interface = gr.Interface(fn=to_black, inputs="image", outputs=[img,kk])
interface.launch()