-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.py
56 lines (44 loc) · 1.18 KB
/
sidebar.py
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
import streamlit as st
import datetime
# local imports
from callbacks import slide_seg
def show_sidebar(loaded):
with st.sidebar:
if loaded:
show_cropped_images()
show_annotations()
show_about()
def show_threshold_slider():
st.subheader("Thresholding Strength")
st.slider(
"Thresholding Strength",
min_value=0,
max_value=10,
value=0,
on_change=slide_seg,
key="slider_seg",
label_visibility="collapsed",
)
def show_cropped_images():
st.header("Cropped Images")
show_threshold_slider()
cur_i = st.session_state.cur_i
imgs = st.session_state.cropped_imgs[cur_i]
if imgs:
for img in imgs:
st.image(img, use_column_width=True)
def show_annotations():
st.header("Annotations")
st.json(st.session_state.json_out)
def show_about():
st.divider()
st.subheader("James Chen (<[email protected]>)")
st.write(
"""
School of Animal Sciences, Virginia Tech
Blacksburg, VA, USA
"""
)
st.divider()
today = datetime.date.today().strftime("%B %d, %Y")
st.write("Last updated:", today)