Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,6 @@ import numpy as np
|
|
| 13 |
from tensorflow.keras.models import load_model
|
| 14 |
from tensorflow.keras.preprocessing import image
|
| 15 |
import matplotlib.pyplot as plt
|
| 16 |
-
from huggingface_hub import hf_hub_download
|
| 17 |
|
| 18 |
|
| 19 |
# ------------------------- PAGE CONFIG -------------------------
|
|
@@ -50,12 +49,8 @@ elif app_mode == "π©» X-ray Classifier":
|
|
| 50 |
if uploaded_image:
|
| 51 |
with st.spinner("π Predicting..."):
|
| 52 |
try:
|
| 53 |
-
# β
|
| 54 |
-
|
| 55 |
-
repo_id="nehda10/covid-xray-model", # π Your HF model repo
|
| 56 |
-
filename="covid_xray_model.keras"
|
| 57 |
-
)
|
| 58 |
-
model = load_model(model_path)
|
| 59 |
st.success("β
Model loaded successfully!")
|
| 60 |
|
| 61 |
# β
Process image and predict
|
|
|
|
| 13 |
from tensorflow.keras.models import load_model
|
| 14 |
from tensorflow.keras.preprocessing import image
|
| 15 |
import matplotlib.pyplot as plt
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
# ------------------------- PAGE CONFIG -------------------------
|
|
|
|
| 49 |
if uploaded_image:
|
| 50 |
with st.spinner("π Predicting..."):
|
| 51 |
try:
|
| 52 |
+
# β
Load model from local models/ folder (no download, no 403 error)
|
| 53 |
+
model = load_model("models/covid_xray_model.keras")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
st.success("β
Model loaded successfully!")
|
| 55 |
|
| 56 |
# β
Process image and predict
|