import gradio as gr import numpy as np from ml_predict import preprocess_img,predict_defect image = gr.inputs.Image(shape=(256, 256)) label = gr.outputs.Label(num_top_classes=3) gr.Interface(fn=predict_defect, inputs=image, outputs=label, theme='peach',examples=[["images\Cr2.bmp"], ["images\Pa2.bmp"], ["images\scratch1.bmp"], ["images\Pit2.bmp"]]).launch()