Professional Documents
Culture Documents
Data Set For Project
Data Set For Project
com/datasets/kmader/skin-cancer-mnist-ham10000
https://github.com/tommasocarraro/SkinCancerClassificationCNN
https://github.com/anitadala/Skin-Lesion-Detector-Web-Tool
from __future__ import division, print_function
# coding=utf-8
import sys
import os
import glob
import re
import numpy as np
from PIL import Image as pil_image
# Keras
# Flask utils
from flask import Flask, redirect, url_for, request, render_template
from werkzeug.utils import secure_filename
from gevent.pywsgi import WSGIServer
app = Flask(__name__)
Model= load_model('model12345.h5')
lesion_classes_dict = {
0 : 'Melanocytic nevi',
1 : 'Melanoma',
2 : 'Benign keratosis-like lesions ',
3 : 'Basal cell carcinoma',
4 : 'Actinic keratoses',
5 : 'Vascular lesions',
6 : 'Dermatofibroma'
}
#img = np.asarray(pil_image.open('img').resize((120,90)))
#x = np.asarray(img.tolist())
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)
preds = Model.predict(x)
return preds
@app.route('/', methods=['GET'])
def index():
# Main page
return render_template('index.html')
# Make prediction
preds = model_predict(file_path , Model)
if __name__ == '__main__':
app.run(debug=True)