DSCmatter commited on
Commit
621eb99
·
1 Parent(s): 0364f0e

correction

Browse files
Files changed (1) hide show
  1. app.py +9 -11
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
- # Make sure this file name matches your model file
14
- model = load_model('resnet50_dryfruits.keras')
15
  return model
16
 
17
- # --- This is the updated dictionary based on your list ---
18
  class_names = {
19
  0: 'AlmondGrade_A',
20
- 1: 'CashewGrade_B',
21
- 2: 'RaisinGrade_A',
22
- 3: 'CashewGrade_A',
23
- 4: 'AlmondGrade_B',
24
  5: 'PistachioGrade_A',
25
- 6: 'RaisinGrade_B',
26
- 7: 'WalnutGrade_A',
27
- 8: 'CashewGrade_C'
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