File size: 536 Bytes
4a28b42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b74900f
4a28b42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()