demo1.py 276 B

1234567891011
  1. import gradio as gr
  2. import cv2
  3. def to_black(image):
  4. output = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  5. return output
  6. # GUI http://127.0.0.1:7860/
  7. interface = gr.Interface(fn=to_black, inputs="image", outputs="image", examples=[["test.png"]])
  8. interface.launch()