diff --git a/src/eynollah/image_enhancer.py b/src/eynollah/image_enhancer.py index babbd55..67145a3 100644 --- a/src/eynollah/image_enhancer.py +++ b/src/eynollah/image_enhancer.py @@ -15,11 +15,13 @@ from pathlib import Path import gc import cv2 -from keras.models import Model import numpy as np -import tensorflow as tf # type: ignore from skimage.morphology import skeletonize +os.environ['TF_USE_LEGACY_KERAS'] = '1' # avoid Keras 3 after TF 2.15 +import tensorflow as tf # type: ignore +from tensorflow.keras.models import Model + from .model_zoo import EynollahModelZoo from .utils.resize import resize_image from .utils.pil_cv2 import pil2cv diff --git a/src/eynollah/mb_ro_on_layout.py b/src/eynollah/mb_ro_on_layout.py index eec544c..22fe97b 100644 --- a/src/eynollah/mb_ro_on_layout.py +++ b/src/eynollah/mb_ro_on_layout.py @@ -14,10 +14,12 @@ from pathlib import Path import xml.etree.ElementTree as ET import cv2 -from keras.models import Model import numpy as np import statistics + +os.environ['TF_USE_LEGACY_KERAS'] = '1' # avoid Keras 3 after TF 2.15 import tensorflow as tf +from tensorflow.keras.models import Model from .model_zoo import EynollahModelZoo from .utils.resize import resize_image