Humza Ali commited on
Commit
4a28b42
·
verified ·
1 Parent(s): e969727

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from skimage import io
2
+ import base64
3
+ from tensorflow.keras.models import load_model
4
+ import numpy as np
5
+ import gradio
6
+ import moleimages
7
+
8
+ model = load_model("mymodel-2.h5")
9
+
10
+ def predict(input):
11
+ mimg = moleimages.MoleImages()
12
+ X = mimg.load_image(input)
13
+ y_pred = model.predict(X)
14
+ return {"Benign": float(y_pred[0][0]), "Malignant": float(1-y_pred[0][0])}
15
+
16
+ io = gradio.Interface(fn=predict, inputs='image', outputs='label', analytics_enabled=True,
17
+ 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]")
18
+ io.launch()