File size: 373 Bytes
94d7100
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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()