更改布局为 3:1
This commit is contained in:
19
main.py
19
main.py
@@ -18,6 +18,7 @@ PAGE_TITLE = "training data configer"
|
|||||||
st.set_page_config(
|
st.set_page_config(
|
||||||
page_title=PAGE_TITLE,
|
page_title=PAGE_TITLE,
|
||||||
page_icon="🧊",
|
page_icon="🧊",
|
||||||
|
layout="wide",
|
||||||
initial_sidebar_state="expanded",
|
initial_sidebar_state="expanded",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ df = pd.DataFrame(data=st.session_state.data_table)
|
|||||||
|
|
||||||
data_frame_container = st.container()
|
data_frame_container = st.container()
|
||||||
config_container = st.container()
|
config_container = st.container()
|
||||||
|
left_col, right_col = st.columns([3, 1])
|
||||||
|
|
||||||
|
|
||||||
def train():
|
def train():
|
||||||
@@ -67,14 +69,14 @@ def update_config(*args, **kwargs):
|
|||||||
st.session_state.configs['mode'] = st.session_state.mode
|
st.session_state.configs['mode'] = st.session_state.mode
|
||||||
|
|
||||||
|
|
||||||
with data_frame_container:
|
with left_col:
|
||||||
edited_df = st.data_editor(
|
edited_df = st.data_editor(
|
||||||
df, key="edited_info",
|
df, key="edited_info",
|
||||||
height=600,
|
height=600,
|
||||||
hide_index=True,
|
hide_index=True,
|
||||||
use_container_width=True,
|
use_container_width=True,
|
||||||
on_change=update_handler,
|
on_change=update_handler,
|
||||||
column_order=('id', 'year', 'census_batch', 'id_code', 'precision', 'is_train', 'is_validation'),
|
column_order=('id', 'year', 'census_batch', 'id_code', 'precision', 'is_train', 'is_validation', 'ann_file', 'img_prefix'),
|
||||||
column_config={
|
column_config={
|
||||||
"year": st.column_config.NumberColumn("年份", format="%d 年", ),
|
"year": st.column_config.NumberColumn("年份", format="%d 年", ),
|
||||||
'census_batch': "普查批次",
|
'census_batch': "普查批次",
|
||||||
@@ -82,30 +84,25 @@ with data_frame_container:
|
|||||||
'precision': "精度",
|
'precision': "精度",
|
||||||
'is_train': "是否是训练集",
|
'is_train': "是否是训练集",
|
||||||
'is_validation': "是否是验证集",
|
'is_validation': "是否是验证集",
|
||||||
|
'ann_file': "path",
|
||||||
|
'ann_file_lbs': "lbs_path",
|
||||||
})
|
})
|
||||||
|
# col1, col2, col3, col4, col5 = st.columns(5)
|
||||||
|
with right_col:
|
||||||
|
|
||||||
col1, col2, col3, col4, col5 = st.columns(5)
|
|
||||||
with config_container:
|
|
||||||
st.divider()
|
|
||||||
|
|
||||||
with col1:
|
|
||||||
st.slider(label='evolve_r', key='evolve_r',
|
st.slider(label='evolve_r', key='evolve_r',
|
||||||
min_value=0.0, max_value=0.5, step=0.01,
|
min_value=0.0, max_value=0.5, step=0.01,
|
||||||
on_change=update_config)
|
on_change=update_config)
|
||||||
with col2:
|
|
||||||
st.selectbox(label='n_trail', key='n_trail',
|
st.selectbox(label='n_trail', key='n_trail',
|
||||||
options=(i for i in range(10, 51, 10)))
|
options=(i for i in range(10, 51, 10)))
|
||||||
st.selectbox(label='n_epoch', key='n_epoch',
|
st.selectbox(label='n_epoch', key='n_epoch',
|
||||||
options=(i for i in range(1, 6)))
|
options=(i for i in range(1, 6)))
|
||||||
with col3:
|
|
||||||
st.selectbox(label='ckpt_path', key='ckpt_path',
|
st.selectbox(label='ckpt_path', key='ckpt_path',
|
||||||
options=(os.listdir(BASE_CKPT_DIR)))
|
options=(os.listdir(BASE_CKPT_DIR)))
|
||||||
with col4:
|
|
||||||
st.selectbox(label='mode', key='mode',
|
st.selectbox(label='mode', key='mode',
|
||||||
format_func=lambda x: RUN_MODE[x],
|
format_func=lambda x: RUN_MODE[x],
|
||||||
options=RUN_MODE,
|
options=RUN_MODE,
|
||||||
on_change=update_config)
|
on_change=update_config)
|
||||||
with col5:
|
|
||||||
st.json(st.session_state.configs)
|
st.json(st.session_state.configs)
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|||||||
Reference in New Issue
Block a user