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 & Classification", description="") io.launch()