SmartHeal commited on
Commit
f4b6120
·
verified ·
1 Parent(s): 1e7d078

Update src/ai_processor.py

Browse files
Files changed (1) hide show
  1. src/ai_processor.py +3 -6
src/ai_processor.py CHANGED
@@ -210,13 +210,10 @@ def load_yolo_model():
210
  model = YOLO(YOLO_MODEL_PATH)
211
  return model
212
 
213
- def load_segmentation_model(SEG_MODEL_PATH):
214
- """Lazy import and load segmentation model."""
215
- # Use the lazy loader to ensure TF is imported correctly
216
  load_model = _import_tf_loader()
217
- # The compile=False argument is crucial for avoiding optimizer/loss issues
218
- # and can sometimes help with layer deserialization.
219
- return load_model(SEG_MODEL_PATH, compile=False)
220
 
221
 
222
  def load_classification_pipeline():
 
210
  model = YOLO(YOLO_MODEL_PATH)
211
  return model
212
 
213
+ def load_segmentation_model():
214
+ import tensorflow as tf
 
215
  load_model = _import_tf_loader()
216
+ return load_model(SEG_MODEL_PATH, compile=False, custom_objects={'InputLayer': tf.keras.layers.InputLayer})
 
 
217
 
218
 
219
  def load_classification_pipeline():