import streamlit as st import requests from PIL import Image image_path = 'images/image.jpg' image = Image.open(image_path) # Set API Endpoint URL = 'https://radiant-lowlands-86946.herokuapp.com/predict' # Create a function to make prediction def make_prediction(pg: float, bwr1: float, bp : float, bwr2: float, bwr3: float, bmi: float, bwr4: float, age: int, insurance: bool): parameters={ 'plasma_glucose':pg, 'blood_work_result_1':bwr1, 'blood_pressure':bp, 'blood_work_result_2':bwr2, 'blood_work_result_3':bwr3, 'body_mass_index':bmi, 'blood_work_result_4':bwr4, 'age':int(age), 'insurance':bool(insurance)} response = requests.post(URL, params=parameters) response_text = response.json() sepsis_status = response_text['results'][0]['0']['output']['Predicted Label'] return sepsis_status # set page configuration st.set_page_config( page_title='Sepsis Prediction', page_icon="🤖", initial_sidebar_state="expanded", menu_items={ 'About': "# This is a Health App. Call it the Covid Vaccine Sepsis Analyzer!" } ) # create a sidebar and contents st.sidebar.markdown(""" ## Demo App This app return sepsis status base on the input parameters """) st.markdown('''