Commit
•
6859cfc
1
Parent(s):
19d8849
Fixed cache
Browse files- src/utils.py +4 -4
src/utils.py
CHANGED
@@ -7,7 +7,7 @@ import argparse
|
|
7 |
import streamlit as st
|
8 |
|
9 |
|
10 |
-
@st.
|
11 |
def get_arguments():
|
12 |
"""Return the values of CLI params"""
|
13 |
parser = argparse.ArgumentParser()
|
@@ -17,7 +17,7 @@ def get_arguments():
|
|
17 |
return getattr(args, "image_folder"), getattr(args, "image_width")
|
18 |
|
19 |
|
20 |
-
@st.
|
21 |
def get_images_list(path_to_folder: str) -> list:
|
22 |
"""Return the list of images from folder
|
23 |
Args:
|
@@ -29,7 +29,7 @@ def get_images_list(path_to_folder: str) -> list:
|
|
29 |
return image_names_list
|
30 |
|
31 |
|
32 |
-
@st.
|
33 |
def load_image(image_name: str, path_to_folder: str, bgr2rgb: bool = True):
|
34 |
"""Load the image
|
35 |
Args:
|
@@ -58,7 +58,7 @@ def upload_image(bgr2rgb: bool = True):
|
|
58 |
return image
|
59 |
|
60 |
|
61 |
-
@st.
|
62 |
def load_augmentations_config(
|
63 |
placeholder_params: dict, path_to_config: str = "configs/augmentations.json"
|
64 |
) -> dict:
|
|
|
7 |
import streamlit as st
|
8 |
|
9 |
|
10 |
+
@st.cache_data
|
11 |
def get_arguments():
|
12 |
"""Return the values of CLI params"""
|
13 |
parser = argparse.ArgumentParser()
|
|
|
17 |
return getattr(args, "image_folder"), getattr(args, "image_width")
|
18 |
|
19 |
|
20 |
+
@st.cache_data
|
21 |
def get_images_list(path_to_folder: str) -> list:
|
22 |
"""Return the list of images from folder
|
23 |
Args:
|
|
|
29 |
return image_names_list
|
30 |
|
31 |
|
32 |
+
@st.cache_data
|
33 |
def load_image(image_name: str, path_to_folder: str, bgr2rgb: bool = True):
|
34 |
"""Load the image
|
35 |
Args:
|
|
|
58 |
return image
|
59 |
|
60 |
|
61 |
+
@st.cache_data
|
62 |
def load_augmentations_config(
|
63 |
placeholder_params: dict, path_to_config: str = "configs/augmentations.json"
|
64 |
) -> dict:
|