Vanhwbt commited on
Commit
d6f98c0
·
1 Parent(s): 13e8057
app.py CHANGED
@@ -22,19 +22,17 @@ except Exception as e:
22
  print(f"❌ Error loading model: {e}")
23
  model = None
24
 
25
- # ================== 🔍 CLASS LABELS ==================
26
  CLASS_NAMES = [
27
- "Rầy Nhảy (Allocara)", # ALLOCARIDARA_ATTACK
28
- "Đốm Rong (Algal Spot)", # Leaf_Algal
29
- "Cháy (Leaf Blight)", # Leaf_Blight
30
- "Lá Khỏe Mạnh (Healthy)", # Leaf_Healthy
31
- "Đốm Mắt Cua (Phomopsis)", # Leaf_Phomopsis
32
  ]
33
 
34
  # ================== 🖼️ PREPROCESS ==================
35
  def preprocess_image(image_file):
36
  img = Image.open(image_file).convert("RGB")
37
- img = img.resize((224, 224))
38
  img_array = np.array(img) / 255.0
39
  img_array = np.expand_dims(img_array, axis=0)
40
  return img_array
 
22
  print(f"❌ Error loading model: {e}")
23
  model = None
24
 
25
+ # ================== 🔍 CLASS LABELS (CẬP NHẬT THEO MODEL MỚI) ==================
26
  CLASS_NAMES = [
27
+ "Bệnh Nấm (Fungal Disease)", # Index 0
28
+ "Bệnh do Rệp (Aphids)", # Index 1
29
+ "Lá Khỏe Mạnh (Healthy)" # Index 2
 
 
30
  ]
31
 
32
  # ================== 🖼️ PREPROCESS ==================
33
  def preprocess_image(image_file):
34
  img = Image.open(image_file).convert("RGB")
35
+ img = img.resize((260, 260))
36
  img_array = np.array(img) / 255.0
37
  img_array = np.expand_dims(img_array, axis=0)
38
  return img_array
saurieng_mobilenetv2_model.keras → model_tra_phu_hoi.keras RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:280a3ec81db645ba2f500d5c37d7f9f7f6a3812dac67c32c6e351cdceec0f269
3
- size 32463418
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6160d5c7c73ba3b46c51b7442249453b729be17e4a8af50d34195578d0a4cb5f
3
+ size 79568367