Spaces:
Sleeping
Sleeping
feat: arranging states and updating requirements
Browse files- .env.dist +0 -0
- requirements.txt +4 -1
- src/home.py +7 -13
- src/pages/3_π₯_classifiers.py +8 -0
.env.dist
ADDED
|
File without changes
|
requirements.txt
CHANGED
|
@@ -29,7 +29,10 @@ opencv-python-headless==4.5.5.64
|
|
| 29 |
albumentations==1.1.0
|
| 30 |
|
| 31 |
# for states
|
| 32 |
-
transitions
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# documentation: mkdocs
|
| 35 |
mkdocs~=1.6.0
|
|
|
|
| 29 |
albumentations==1.1.0
|
| 30 |
|
| 31 |
# for states
|
| 32 |
+
transitions==0.9.2
|
| 33 |
+
|
| 34 |
+
# for env variables
|
| 35 |
+
python-dotenv==1.1.0
|
| 36 |
|
| 37 |
# documentation: mkdocs
|
| 38 |
mkdocs~=1.6.0
|
src/home.py
CHANGED
|
@@ -8,26 +8,18 @@ st.set_page_config(
|
|
| 8 |
page_icon="π³",
|
| 9 |
)
|
| 10 |
|
| 11 |
-
# one toggle for all the extra debug text
|
| 12 |
-
if "MODE_DEV_STATEFUL" not in st.session_state:
|
| 13 |
-
st.session_state.MODE_DEV_STATEFUL = False
|
| 14 |
-
|
| 15 |
# get a global var for logger accessor in this module
|
| 16 |
LOG_LEVEL = logging.DEBUG
|
| 17 |
g_logger = logging.getLogger(__name__)
|
| 18 |
g_logger.setLevel(LOG_LEVEL)
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
from utils.st_logs import init_logging_session_states
|
| 21 |
-
from utils.workflow_ui import init_workflow_session_states, init_workflow_viz
|
| 22 |
-
from input.input_handling import init_input_container_states, init_input_data_session_states
|
| 23 |
-
from classifier.classifier_image import init_classifier_session_states
|
| 24 |
-
# initialise various session state variables
|
| 25 |
init_logging_session_states() # logging init should be early
|
| 26 |
-
|
| 27 |
-
init_input_data_session_states()
|
| 28 |
-
init_input_container_states()
|
| 29 |
-
init_workflow_viz()
|
| 30 |
-
init_classifier_session_states()
|
| 31 |
|
| 32 |
st.write("# Welcome to Cetacean Research Data Infrastructure! π¬ΛΛπ’Φ΄ΰ» πβ§Λ.β")
|
| 33 |
|
|
@@ -39,6 +31,8 @@ st.markdown(
|
|
| 39 |
"""
|
| 40 |
)
|
| 41 |
|
|
|
|
|
|
|
| 42 |
g_logger.info("App started.")
|
| 43 |
g_logger.warning(f"[D] Streamlit version: {st.__version__}. Python version: {os.sys.version}")
|
| 44 |
|
|
|
|
| 8 |
page_icon="π³",
|
| 9 |
)
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# get a global var for logger accessor in this module
|
| 12 |
LOG_LEVEL = logging.DEBUG
|
| 13 |
g_logger = logging.getLogger(__name__)
|
| 14 |
g_logger.setLevel(LOG_LEVEL)
|
| 15 |
|
| 16 |
+
# one toggle for all the extra debug text
|
| 17 |
+
if "MODE_DEV_STATEFUL" not in st.session_state:
|
| 18 |
+
st.session_state.MODE_DEV_STATEFUL = False
|
| 19 |
+
|
| 20 |
from utils.st_logs import init_logging_session_states
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
init_logging_session_states() # logging init should be early
|
| 22 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
st.write("# Welcome to Cetacean Research Data Infrastructure! π¬ΛΛπ’Φ΄ΰ» πβ§Λ.β")
|
| 25 |
|
|
|
|
| 31 |
"""
|
| 32 |
)
|
| 33 |
|
| 34 |
+
|
| 35 |
+
|
| 36 |
g_logger.info("App started.")
|
| 37 |
g_logger.warning(f"[D] Streamlit version: {st.__version__}. Python version: {os.sys.version}")
|
| 38 |
|
src/pages/3_π₯_classifiers.py
CHANGED
|
@@ -39,6 +39,14 @@ data_files = "data/train-00000-of-00001.parquet"
|
|
| 39 |
tab_inference, tab_hotdogs= \
|
| 40 |
st.tabs(["Cetecean classifier", "Hotdog classifier"])
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# put this early so the progress indicator is at the top (also refreshed at end)
|
| 43 |
refresh_progress_display()
|
| 44 |
|
|
|
|
| 39 |
tab_inference, tab_hotdogs= \
|
| 40 |
st.tabs(["Cetecean classifier", "Hotdog classifier"])
|
| 41 |
|
| 42 |
+
# initialise various session state variables
|
| 43 |
+
init_logging_session_states() # logging init should be early
|
| 44 |
+
init_workflow_session_states()
|
| 45 |
+
init_input_data_session_states()
|
| 46 |
+
init_input_container_states()
|
| 47 |
+
init_workflow_viz()
|
| 48 |
+
init_classifier_session_states()
|
| 49 |
+
|
| 50 |
# put this early so the progress indicator is at the top (also refreshed at end)
|
| 51 |
refresh_progress_display()
|
| 52 |
|