Benzagon/IARA_CNN
0
1# -*- coding: utf-8 -*-2"""Untitled1.ipynb3 4Automatically generated by Colaboratory.5 6Original file is located at7 https://colab.research.google.com/drive/1xS5gaNQZORuhMxXjc7ztu8RFq-Kkdr-l8"""9 10import streamlit as st11#import tensorflow as tf12from tensorflow import keras13from PIL import Image14import matplotlib.pyplot as plt15import numpy as np16from skimage import transform17#import cv218 19def load(filename):20 np_image = Image.open(filename)21 plt.imshow(np_image, cmap = 'gray')22 plt.xticks([])23 plt.yticks([])24 np_image = np.array(np_image).astype('float32')/25525 np_image = transform.resize(np_image, (256, 256, 3))26 np_image = np.expand_dims(np_image, axis=0)27 return np_image28 29st.title('IARA - TBC Detector')30st.subheader('Your health, our mission')31img = st.file_uploader("Choose a file")32if img:33 model = tf.keras.models.load_model(r"C:\Users\julik\OneDrive\Desktop\IARAsStreamlitApp\TBC_CNN_Fusion_AugementedData.h5")34 img = load(img)35 st.image(img)36 st.subheader("TBC percentage: %" + ((str((model.predict(img))*100)).split("[")[2]).split("]")[0])37 st.write("It is important to know this ISN'T A DIAGNOSIS and this should be checked by an expert and blah blah blah")38 