storesource commited on
Commit
adb4584
·
verified ·
1 Parent(s): 7504853

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -9,17 +9,16 @@ from streamlit_drawable_canvas import st_canvas
9
  from huggingface_hub import hf_hub_download
10
  from tensorflow import keras
11
  from huggingface_hub import from_pretrained_keras
12
- from urllib.request import urlretrieve
13
 
14
 
15
  # Load the model (using a Streamlit caching mechanism for efficiency)
16
  @st.cache(allow_output_mutation=True) # Allow model mutation for prediction
17
  def load_model():
18
- with tempfile.NamedTemporaryFile(suffix=".keras") as temp_file:
19
- url = "https://huggingface.co/tomeheya/IM-417-128x128-classification/raw/main/IM_417_128.keras"
20
- urlretrieve(url, temp_file.name)
21
- return keras.models.load_model(temp_file.name)
22
-
23
 
24
  # Function to preprocess the input image
25
  def preprocess_image(image):
 
9
  from huggingface_hub import hf_hub_download
10
  from tensorflow import keras
11
  from huggingface_hub import from_pretrained_keras
 
12
 
13
 
14
  # Load the model (using a Streamlit caching mechanism for efficiency)
15
  @st.cache(allow_output_mutation=True) # Allow model mutation for prediction
16
  def load_model():
17
+ files = [f for f in os.listdir('.') if os.path.isfile(f)]
18
+ print(f"FILES :: {files}")
19
+ return keras.models.load_model("IM_417_128.keras")
20
+
21
+
22
 
23
  # Function to preprocess the input image
24
  def preprocess_image(image):