FYP-1-Model-Demo / demo_app.py
Humza Ali
Add Files
e969727 verified
raw
history blame
628 Bytes
from skimage import io
import base64
from tensorflow.keras.models import load_model
import numpy as np
import gradio
import moleimages
model = load_model("mymodel-2.h5")
def predict(input):
mimg = moleimages.MoleImages()
X = mimg.load_image(input)
y_pred = model.predict(X)
return {"Benign": float(y_pred[0][0]), "Malignant": float(1-y_pred[0][0])}
io = gradio.Interface(fn=predict, inputs='image', outputs='label', analytics_enabled=True,
title="Skin Cancer Detection FYP Model Demo", description="FYP Demo by FYP GROUP:- 20F-18 \n [Leader: Humza Ali \n | Members: Dilshad Hussain, Yasir Ali]")
io.launch()