Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -4
src/streamlit_app.py
CHANGED
|
@@ -31,7 +31,7 @@ class RepVGGBlock(layers.Layer):
|
|
| 31 |
self.actual_in_channels = None
|
| 32 |
|
| 33 |
self.rbr_dense_conv = layers.Conv2D(
|
| 34 |
-
filters=self.
|
| 35 |
strides=self.config_strides_val, padding='same',
|
| 36 |
groups=self.config_groups, use_bias=False, name=self.name + '_dense_conv'
|
| 37 |
)
|
|
@@ -240,15 +240,16 @@ class NECALayer(layers.Layer):
|
|
| 240 |
# --- End of NECALayer ---
|
| 241 |
|
| 242 |
# --- Streamlit App Configuration ---
|
| 243 |
-
|
| 244 |
-
|
|
|
|
| 245 |
IMG_WIDTH = 299
|
| 246 |
IMG_HEIGHT = 299
|
| 247 |
|
| 248 |
st.set_page_config(page_title="Genera Cloud Classifier", layout="wide")
|
| 249 |
|
| 250 |
# --- Load Model and Label Mapping (Cached for performance) ---
|
| 251 |
-
@st.cache_resource
|
| 252 |
def load_keras_model(model_path):
|
| 253 |
"""Loads the Keras model with custom layer definitions."""
|
| 254 |
if not os.path.exists(model_path):
|
|
|
|
| 31 |
self.actual_in_channels = None
|
| 32 |
|
| 33 |
self.rbr_dense_conv = layers.Conv2D(
|
| 34 |
+
filters=self.config_out_channels, kernel_size=self.config_kernel_size,
|
| 35 |
strides=self.config_strides_val, padding='same',
|
| 36 |
groups=self.config_groups, use_bias=False, name=self.name + '_dense_conv'
|
| 37 |
)
|
|
|
|
| 240 |
# --- End of NECALayer ---
|
| 241 |
|
| 242 |
# --- Streamlit App Configuration ---
|
| 243 |
+
# Updated paths to reflect the file location within the Hugging Face Space 'src' directory
|
| 244 |
+
MODEL_FILENAME = '/app/src/genera_cic_v1.keras'
|
| 245 |
+
LABEL_MAPPING_FILENAME = '/app/src/label_mapping.json'
|
| 246 |
IMG_WIDTH = 299
|
| 247 |
IMG_HEIGHT = 299
|
| 248 |
|
| 249 |
st.set_page_config(page_title="Genera Cloud Classifier", layout="wide")
|
| 250 |
|
| 251 |
# --- Load Model and Label Mapping (Cached for performance) ---
|
| 252 |
+
@st.cache_resource
|
| 253 |
def load_keras_model(model_path):
|
| 254 |
"""Loads the Keras model with custom layer definitions."""
|
| 255 |
if not os.path.exists(model_path):
|