Spaces:
Sleeping
Sleeping
#Importer les librairies | |
import streamlit as st | |
import tensorflow as tf | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from tensorflow.keras.utils import load_img,img_to_array | |
from tensorflow.keras.preprocessing import image | |
from PIL import Image,ImageOps | |
from tensorflow.keras.applications import InceptionV3 | |
st.sidebar.image("keyce.jpg") | |
menu_options = ["Documentation", "Application"] | |
selection = st.sidebar.selectbox("Sélectionnez une page", menu_options) | |
if selection == "Documentation": | |
st.title("Bienvenue sur la documentation") | |
st.write("L'application de surveillance médicale pour COVID, Pneumonie et Tuberculose est un outil interactif conçu pour aider les professionnels de la santé à suivre et analyser les cas de ces maladies respiratoires. L'application fournit des fonctionnalités permettant de visualiser les données, d'effectuer des analyses approfondies et de prendre des décisions éclairées.") | |
st.header("Configuration Requise") | |
st.subheader("1.Matériel") | |
st.markdown("* Un ordinateur ou un appareil mobile avec un accès à Internet. ",unsafe_allow_html=True) | |
st.subheader("2.Logiciels:") | |
st.markdown("* Un navigateur web moderne (Chrome, Firefox). ",unsafe_allow_html=True) | |
elif selection == "Application": | |
def main(): | |
st.title(":red[APPLICATION DE PREDICTION DU COVID] :bar_chart: :chart:") | |
st.markdown("* NOM: FOSSO TCHATAT SIDOINE ",unsafe_allow_html=True) | |
model = tf.keras.models.load_model("model.h5") | |
covid_classes = {'COVID19': 0, 'NORMAL': 1, 'PNEUMONIA': 2, 'TURBERCULOSIS': 3} | |
tab1, tab2,tab3= st.tabs(["Uploader le fichier",":bar_chart: Evaluation du model", ":mask: :smile: Prediction"]) | |
with tab1: | |
upload_file = st.file_uploader("Telecharger un fichier",type = ['JPEG','jpg','png','PNG']) | |
with tab2: | |
st.image("loss.png") | |
with tab3: | |
if upload_file: | |
st.image(upload_file,caption="Image téléchargée",use_column_width=True) | |
test_image = image.load_img(upload_file,target_size=(299,299)) | |
image_array = img_to_array(test_image) | |
image_array = np.expand_dims(image_array,axis=0) | |
#Boutton pour effectuer la prédiction | |
btn_prediction = st.button("Effectuer le diagnostic") | |
if btn_prediction: | |
predictions = model.predict(image_array) | |
classes = np.argmax(predictions[0]) | |
for cle, valeur in covid_classes.items(): | |
if valeur == classes: | |
st.write("The diagostic is :",cle) | |
if __name__ == '__main__': | |
main() | |