Vanhwbt commited on
Commit
5884cfa
·
1 Parent(s): 6cad2b1
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,7 +14,7 @@ CORS(app)
14
 
15
  # ================== 🔧 LOAD MODEL ==================
16
  # Lưu ý: Đảm bảo tên file model đúng với file ông đã up lên
17
- MODEL_PATH = "saurieng_mobilenetv2_model.keras"
18
  try:
19
  model = tf.keras.models.load_model(MODEL_PATH)
20
  print("✅ Model loaded successfully!")
@@ -32,7 +32,7 @@ CLASS_NAMES = [
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
 
14
 
15
  # ================== 🔧 LOAD MODEL ==================
16
  # Lưu ý: Đảm bảo tên file model đúng với file ông đã up lên
17
+ MODEL_PATH = "model_tra_phu_hoi.keras"
18
  try:
19
  model = tf.keras.models.load_model(MODEL_PATH)
20
  print("✅ Model loaded successfully!")
 
32
  # ================== 🖼️ PREPROCESS ==================
33
  def preprocess_image(image_file):
34
  img = Image.open(image_file).convert("RGB")
35
+ img = img.resize((224, 224))
36
  img_array = np.array(img) / 255.0
37
  img_array = np.expand_dims(img_array, axis=0)
38
  return img_array