Spaces:
Running
Running
Update src/ai_processor.py
Browse files- 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(
|
| 214 |
-
|
| 215 |
-
# Use the lazy loader to ensure TF is imported correctly
|
| 216 |
load_model = _import_tf_loader()
|
| 217 |
-
|
| 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():
|