Spaces:
Sleeping
Sleeping
DSCmatter commited on
Commit ·
621eb99
1
Parent(s): 0364f0e
correction
Browse files
app.py
CHANGED
|
@@ -7,24 +7,22 @@ import numpy as np
|
|
| 7 |
from PIL import Image
|
| 8 |
|
| 9 |
# --- Load Your Model and Class Names ---
|
| 10 |
-
# Use st.cache_resource to load the model only once
|
| 11 |
@st.cache_resource
|
| 12 |
def load_my_model():
|
| 13 |
-
#
|
| 14 |
-
model = load_model('
|
| 15 |
return model
|
| 16 |
|
| 17 |
-
# --- This is the updated dictionary based on your list ---
|
| 18 |
class_names = {
|
| 19 |
0: 'AlmondGrade_A',
|
| 20 |
-
1: '
|
| 21 |
-
2: '
|
| 22 |
-
3: '
|
| 23 |
-
4: '
|
| 24 |
5: 'PistachioGrade_A',
|
| 25 |
-
6: '
|
| 26 |
-
7: '
|
| 27 |
-
8: '
|
| 28 |
}
|
| 29 |
# --------------------------------------------------------
|
| 30 |
|
|
|
|
| 7 |
from PIL import Image
|
| 8 |
|
| 9 |
# --- Load Your Model and Class Names ---
|
|
|
|
| 10 |
@st.cache_resource
|
| 11 |
def load_my_model():
|
| 12 |
+
# Load the new, modern .keras file
|
| 13 |
+
model = load_model('resnet50_dryfruits_best.keras')
|
| 14 |
return model
|
| 15 |
|
|
|
|
| 16 |
class_names = {
|
| 17 |
0: 'AlmondGrade_A',
|
| 18 |
+
1: 'AlmondGrade_B',
|
| 19 |
+
2: 'CashewGrade_A',
|
| 20 |
+
3: 'CashewGrade_B',
|
| 21 |
+
4: 'CashewGrade_C',
|
| 22 |
5: 'PistachioGrade_A',
|
| 23 |
+
6: 'RaisinGrade_A',
|
| 24 |
+
7: 'RaisinGrade_B',
|
| 25 |
+
8: 'WalnutGrade_A'
|
| 26 |
}
|
| 27 |
# --------------------------------------------------------
|
| 28 |
|