File size: 1,814 Bytes
74e80c5
 
 
 
 
 
 
 
 
 
49c0458
 
 
0f0148b
bbf4029
72bac2a
 
 
 
 
 
 
 
 
 
 
 
bbf4029
6567232
49c0458
6567232
 
 
49c0458
72bac2a
 
6567232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49c0458
6567232
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import os

if not os.path.exists("data/"):
    os.makedirs("data/")
    # now curl -L -o data/human-segmentation-dataset.zip https://www.kaggle.com/api/v1/datasets/download/trainingdatapro/human-segmentation-dataset
    os.system("curl -L -o data/human-segmentation-dataset.zip https://www.kaggle.com/api/v1/datasets/download/trainingdatapro/human-segmentation-dataset")
    os.system("unzip data/human-segmentation-dataset.zip -d data/")
    os.system("rm data/human-segmentation-dataset.zip")


import streamlit as st
import pandas as pd
import numpy as np


voters = [
    "osman",
    "eren",
    "robin",
    "mira",
    "bilal",
    "volunteer-1",
    "volunteer-2",
    "volunteer-3",
    "volunteer-4",
    "volunteer-5",
]

# login page
with st.form("images"):
    username = st.text_input("Username")
    password = st.text_input("Password", type="password")
    submitted = st.form_submit_button("Login")



if submitted:
    if not password == os.environ.get("app_password"):
        st.error("The password you entered is incorrect")
        st.stop()
    else:
        st.success("Welcome, " + username)
        st.write("You are now logged in")

    with st.form("images"):

        st.write("Inside the form")
        healthiness = st.slider("How healthy is this picture?", 0, 100, 50)
        fat_level = st.slider("How fat are you", 0, 100, 50)
        muscle_level = st.slider("How muscular are you?", 0, 100, 50)
        password = st.text_input("Password", type="password")

        # select voter from the list
        username = st.selectbox("Select voter", voters)

        # Every form must have a submit button.
        submitted = st.form_submit_button("Submit")
        if submitted:
            st.write("slideers", healthiness, fat_level, muscle_level)
    st.write("Outside the form")