Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from src.st_image_tools import ImageTool | |
| def call_in_image_tool(cfg_path): | |
| image_tool = ImageTool(cfg_path) | |
| return image_tool | |
| def main(cfg_path="cfg/cfg.yml"): | |
| """_summary_ | |
| Args: | |
| cfg_path (str, optional): _description_. Defaults to "cfg/cfg.yml". | |
| Returns: | |
| _type_: _description_ | |
| """ | |
| st.set_page_config(layout="wide") | |
| st.markdown( | |
| """ <style> | |
| #MainMenu {visibility: hidden;} | |
| footer {visibility: hidden;} | |
| </style> """, | |
| unsafe_allow_html=True, | |
| ) | |
| image_tool = call_in_image_tool(cfg_path) | |
| # Select Plot Option | |
| # st.sidebar.markdown("Checkboxes") | |
| # checkbox_one = st.sidebar.checkbox("Show Image", value=True) # rename as necessary | |
| checkbox_two = st.sidebar.checkbox("Show Inference", value=True) | |
| checkbox_three = st.sidebar.checkbox("Show Ground Truth", value=True) | |
| checkbox_four = st.sidebar.checkbox("Show Side by Side (GT and Pred)", value=True) | |
| option = st.sidebar.selectbox("Select Image", image_tool.all_img) | |
| if checkbox_two: | |
| if checkbox_three: | |
| if checkbox_four: | |
| image_tool.plot_with_preds_gt(option=option, side_by_side=True) | |
| else: | |
| image_tool.plot_with_preds_gt(option=option, plot_type="all") | |
| else: | |
| image_tool.plot_with_preds_gt(option=option, plot_type="pred") | |
| elif checkbox_three: | |
| if checkbox_two: | |
| if checkbox_four: | |
| image_tool.plot_with_preds_gt(option=option, side_by_side=True) | |
| else: | |
| image_tool.plot_with_preds_gt(option=option, plot_type="all") | |
| else: | |
| image_tool.plot_with_preds_gt(option=option, plot_type="gt") | |
| else: | |
| image_tool.plot_with_preds_gt(option=option) | |
| if __name__ == "__main__": | |
| main() |