File size: 1,885 Bytes
26364eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a1027a2
26364eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
61
62
63
64
65
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()