CoolFace
Apppublic

Abdul09/Capstone-project

sourceHugging Faceupdated 4y agoView on Hugging Face
0likes
app.py29 linesDownload Raw Back to root
1import gradio as gr2import numpy as np3 4 5 6def detect(img):7    img = img.reshape(-1,180,180,3)8    prediction = np.around(model.predict(img)[0], decimals=0)[0]9 10    if prediction == 1:11        return "Pneumonia Detected!"12 13    return "Pneumonia Not Detected!"14 15#set the user uploaded image as the input array16#match same shape as the input shape in the model17 18image_input = gr.inputs.Image( shape=(180, 180) ,invert_colors=False  ,   type="numpy"    )19 20title = "PneumoDetect: Pneumonia Detection from Chest X-Rays"21 22 23#setup the interface24iface = gr.Interface(25  fn = detect,26  inputs = image_input,27  outputs = gr.outputs.Label(),28)29iface.launch(share=True , debug = True )