Spaces:
Running
Running
Commit
·
41c3e66
1
Parent(s):
80406a3
Corregir rutas de modelos para cargarlos desde el directorio raíz
Browse files- streamlit_app.py +14 -8
streamlit_app.py
CHANGED
|
@@ -50,13 +50,13 @@ def main():
|
|
| 50 |
# Function to load DNN models with caching and auto-download
|
| 51 |
@st.cache_resource
|
| 52 |
def load_face_model():
|
| 53 |
-
#
|
| 54 |
-
|
| 55 |
-
|
| 56 |
|
| 57 |
# Correct model file names
|
| 58 |
-
modelFile = "
|
| 59 |
-
configFile = "
|
| 60 |
|
| 61 |
# Check if files exist
|
| 62 |
missing_files = []
|
|
@@ -71,11 +71,11 @@ def main():
|
|
| 71 |
st.code("""
|
| 72 |
1. Download the model file:
|
| 73 |
URL: https://raw.githubusercontent.com/sr6033/face-detection-with-OpenCV-and-DNN/master/res10_300x300_ssd_iter_140000.caffemodel
|
| 74 |
-
Save as:
|
| 75 |
|
| 76 |
2. Download the configuration file:
|
| 77 |
URL: https://raw.githubusercontent.com/sr6033/face-detection-with-OpenCV-and-DNN/master/deploy.prototxt.txt
|
| 78 |
-
Save as:
|
| 79 |
""")
|
| 80 |
st.stop()
|
| 81 |
|
|
@@ -2190,4 +2190,10 @@ def main():
|
|
| 2190 |
|
| 2191 |
# Si se ejecuta este archivo directamente, llamar a la función main
|
| 2192 |
if __name__ == "__main__":
|
| 2193 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
# Function to load DNN models with caching and auto-download
|
| 51 |
@st.cache_resource
|
| 52 |
def load_face_model():
|
| 53 |
+
# No need to create directory as we're using the root directory
|
| 54 |
+
#
|
| 55 |
+
#
|
| 56 |
|
| 57 |
# Correct model file names
|
| 58 |
+
modelFile = "res10_300x300_ssd_iter_140000.caffemodel"
|
| 59 |
+
configFile = "deploy.prototxt.txt"
|
| 60 |
|
| 61 |
# Check if files exist
|
| 62 |
missing_files = []
|
|
|
|
| 71 |
st.code("""
|
| 72 |
1. Download the model file:
|
| 73 |
URL: https://raw.githubusercontent.com/sr6033/face-detection-with-OpenCV-and-DNN/master/res10_300x300_ssd_iter_140000.caffemodel
|
| 74 |
+
Save as: res10_300x300_ssd_iter_140000.caffemodel
|
| 75 |
|
| 76 |
2. Download the configuration file:
|
| 77 |
URL: https://raw.githubusercontent.com/sr6033/face-detection-with-OpenCV-and-DNN/master/deploy.prototxt.txt
|
| 78 |
+
Save as: deploy.prototxt.txt
|
| 79 |
""")
|
| 80 |
st.stop()
|
| 81 |
|
|
|
|
| 2190 |
|
| 2191 |
# Si se ejecuta este archivo directamente, llamar a la función main
|
| 2192 |
if __name__ == "__main__":
|
| 2193 |
+
main()
|
| 2194 |
+
|
| 2195 |
+
|
| 2196 |
+
|
| 2197 |
+
|
| 2198 |
+
|
| 2199 |
+
|