Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,11 @@ model = models.Sequential([
|
|
| 32 |
])
|
| 33 |
|
| 34 |
# ---- Load trained weights ----
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# ---- Preprocess image ----
|
| 38 |
def preprocess(image: Image.Image):
|
|
|
|
| 32 |
])
|
| 33 |
|
| 34 |
# ---- Load trained weights ----
|
| 35 |
+
if os.path.exists("model_weights.h5"):
|
| 36 |
+
model.load_weights("model_weights.h5")
|
| 37 |
+
print("Weights loaded successfully.")
|
| 38 |
+
else:
|
| 39 |
+
print("model_weights.h5 not found! Current directory:", os.listdir())
|
| 40 |
|
| 41 |
# ---- Preprocess image ----
|
| 42 |
def preprocess(image: Image.Image):
|