demo1.py 368 B

123456789101112
  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. if __name__=='__main__':
  9. app,local_url, share_url= interface.launch(inbrowser=True, server_name='0.0.0.0')