Image_classification / model_loader.py
Tantawi's picture
Update model_loader.py
495340f verified
raw
history blame
414 Bytes
# model_loader.py
import os
import tensorflow as tf
# Use the existing local model file
MODEL_PATH = "efficientnetv2s.h5"
def load_model():
if not os.path.exists(MODEL_PATH):
raise FileNotFoundError(f"Model file not found at {MODEL_PATH}")
print(f"Loading model from: {MODEL_PATH}")
model = tf.keras.models.load_model(MODEL_PATH)
print("Model loaded successfully!")
return model