Ejemplo n.º 1
0
def main():
    state = _get_state()
    stt.set_theme({'primary': '#1b3388'})
    state.newsapi = NewsApiClient(api_key='68353e14ce514929ac111b8b0f24556e')
    #state.model = Summarizer()
    pages = {
        "Login": page_login,
        "Home": page_home,
        "Signup": page_signup,
    }

    st.sidebar.title(":newspaper: SummarizeR")
    page = st.sidebar.radio("Select your page", tuple(pages.keys()))

    # Display the selected page with the session state
    pages[page](state)

    # Mandatory to avoid rollbacks with widgets, must be called at the end of your app
    state.sync()
Ejemplo n.º 2
0
from sklearn.linear_model import SGDClassifier
from xgboost import XGBClassifier
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import mean_squared_error
from sklearn.metrics import r2_score
import datetime
import random
from sklearn import preprocessing
from sklearn.metrics import balanced_accuracy_score
import streamlit_theme as stt
import streamlit.components.v1 as components
from datetime import date

random.seed(10)
stt.set_theme({'primary': '#1b3388'})
st.title("Cardiovascular Disease Alert")

st.write("Created by Barış Can Tayiz")

components.html("""
<div style="background-color:black;height:10px;border-radius:10px;margin-bottom:0px;">
</div><hr>""")

st.header("Variables")
st.write("""* Age | Objective Feature | age | int (days) \n
* Height | Objective Feature | height | int (cm) | \n
* Weight | Objective Feature | weight | float (kg) | \n
* Gender | Objective Feature | gender | categorical code | \n
* Systolic blood pressure | Examination Feature | ap_hi | int | \n
* Diastolic blood pressure | Examination Feature | ap_lo | int | \n
Ejemplo n.º 3
0
import streamlit as st
from PIL import Image
import base64
import cv2
import numpy as np
from keras.models import model_from_json
import imutils
import urllib.request
from sklearn.preprocessing import LabelEncoder
from IPython.display import Image as IPythonImage
from imageai.Detection.Custom import CustomObjectDetection
from tempfile import NamedTemporaryFile
import streamlit_theme as stt

stt.set_theme({'primary': '#262730', 'textColor': '#FFFFFF'})
#main_bg = "background.jpg"
main_bg = 'https://previews.123rf.com/images/eric4094/eric40940903/eric4094090300005/4570324-abstract-design-yellow-colour-background.jpg'
main_bg_ext = "jpg"
weburl = "https://capstoneprojectmksk.s3.amazonaws.com/detection_model-ex-015--loss-0006.450.h5"

filename = weburl.split('/')[-1]
urllib.request.urlretrieve(weburl, filename)


def detector_model():
    #model_path = 'model/detection_model-ex-005--loss-0003.767.h5'
    model_path = filename
    json_path = 'model/detection_config.json'

    detector = CustomObjectDetection()
    detector.setModelTypeAsYOLOv3()
Ejemplo n.º 4
0
import os
import pickle
import warnings
import altair as alt
import streamlit as st
import streamlit_theme as stt

stt.set_theme({
    'primary': '#00cc99',
})

SAMPLES_TO_DISPALY = 20
X_LIM_MIN = -20
X_LIM_MAX = 20
Y_LIM_MIN = -20
Y_LIM_MAX = 22
seed = 42
warnings.filterwarnings(action="ignore")

LABELS = [
    "ADJ", "ADP", "ADV", "AUX", "CCONJ", "DET", "INTJ", "NOUN", "NUM", "PART",
    "PRON", "PROPN", "PUNCT", "SCONJ", "SYM", "VERB"
]


def _set_block_container_style(
    max_width: int = 1200,
    max_width_100_percent: bool = False,
    padding_top: int = 0,
    padding_right: int = 1,
    padding_left: int = 1,
Ejemplo n.º 5
0
import streamlit as st
import streamlit_theme as stt

stt.set_theme({'primary': '#f63366'})

import random
import math
import statistics
from scipy.stats import norm
import numpy as np
import re
from testcode import *
import pandas as pd
from wellrng import random as pr

PAGES = [
    "Runs Test Calculator", "Test for Random Number Generator",
    "Ranji Trophy Data", "Gold Prices", "Air Quality Index Data",
    "Runs Test Exception"
]

#runs test for binary sequence

#text templates
html_temp = """
		<div style="background-color:black;padding:10px">
		<i><b><u><h1 style="color:{};text-align:center;">{}</h1></u></b></i>
		</div>
		"""
html_temp1 = """
		<div style="background-color:black;padding:10px">
Ejemplo n.º 6
0
    body {
    background-image: url("data:image/png;base64,%s");
    background-size: cover;
    }
    </style>
    ''' % bin_str
    
    st.markdown(page_bg_img, unsafe_allow_html=True)
    return
def local_css(file_name):
    with open(file_name) as f:
        st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
local_css("style.css")

set_png_as_page_bg('bg2.png')
stt.set_theme({'primary': '#F794B9'})

st.markdown("<h1 style='text-align: center;'> FNA Result Analyser</h1>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center;'> An Accurate Tool for Breast Cancer Prediction </p>", unsafe_allow_html=True)

col1,col2,col3 = st.beta_columns(3)
with col1:
    area_se = st.number_input('Enter Area Standard Error')
with col2:
    area_mean = st.number_input('Enter Area Mean')
with col3:
    concavity_mean = st.number_input('Enter Concavity Mean')


col7,col8,col9 = st.beta_columns(3)
with col7:
Ejemplo n.º 7
0
import streamlit as st
import numpy as np
import pandas as pd
import pydeck as pdk
import streamlit_theme as stt
from PIL import Image
import urllib.request
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go


df = pd.read_csv("https://raw.githubusercontent.com/chrisbaugh-user/USWTDB/master/uswtdb_v3_1_20200717.csv")
stt.set_theme({'primary': '#064658'})


sidebar_selector = st.sidebar.selectbox('Select Category:', ('Project Information', 'Deep Dive', 'Wind Turbine Detailed Aggregation', 'US Turbine Map'))

def get_cp_agg(years, slider_choice):
    cp_df = df[(df['p_year'] >= years[0]) & (df['p_year'] <= years[1])]
    cp_df['capacity_MW'] = cp_df['t_cap']/1000

    if slider_choice == 't_county':
        mw_cap = cp_df.groupby([slider_choice, 't_state'])[['capacity_MW']].sum()
    else:
        mw_cap = cp_df.groupby(slider_choice)[['capacity_MW']].sum()

    mw_cap.sort_values(by='capacity_MW', inplace=True, ascending=False)
    mw_cap['Capacity CP'] = round((mw_cap['capacity_MW'] / mw_cap['capacity_MW'].sum()) * 100, 2)
    mw_cap['Capacity CP'] = mw_cap['Capacity CP'].astype(int)
    mw_cap['capacity_MW'] = mw_cap['capacity_MW'].astype(int)