diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle
index ab09d33220..2fac877fd9 100644
Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ
diff --git a/latest/_modules/doctr/io/image/tensorflow.html b/latest/_modules/doctr/io/image/tensorflow.html
index d13b1c8932..f9faeeab1c 100644
--- a/latest/_modules/doctr/io/image/tensorflow.html
+++ b/latest/_modules/doctr/io/image/tensorflow.html
@@ -302,8 +302,8 @@
import numpy as np
import tensorflow as tf
-from keras.utils import img_to_array
from PIL import Image
+from tensorflow.keras.utils import img_to_array
from doctr.utils.common_types import AbstractPath
diff --git a/latest/_modules/doctr/models/classification/magc_resnet/tensorflow.html b/latest/_modules/doctr/models/classification/magc_resnet/tensorflow.html
index f850c994bc..e181ef6a1f 100644
--- a/latest/_modules/doctr/models/classification/magc_resnet/tensorflow.html
+++ b/latest/_modules/doctr/models/classification/magc_resnet/tensorflow.html
@@ -304,8 +304,8 @@ Source code for doctr.models.classification.magc_resnet.tensorflow
from
typing import Any, Dict, List, Optional, Tuple
import tensorflow as tf
-
from keras import activations, layers
-
from keras.models import Sequential
+
from tensorflow.keras import activations, layers
+
from tensorflow.keras.models import Sequential
from doctr.datasets import VOCABS
diff --git a/latest/_modules/doctr/models/classification/mobilenet/tensorflow.html b/latest/_modules/doctr/models/classification/mobilenet/tensorflow.html
index 02fc8802d6..c9545166e7 100644
--- a/latest/_modules/doctr/models/classification/mobilenet/tensorflow.html
+++ b/latest/_modules/doctr/models/classification/mobilenet/tensorflow.html
@@ -304,8 +304,8 @@
Source code for doctr.models.classification.mobilenet.tensorflow
from
typing import Any, Dict, List, Optional, Tuple, Union
import tensorflow as tf
-
from keras import layers
-
from keras.models import Sequential
+
from tensorflow.keras import layers
+
from tensorflow.keras.models import Sequential
from ....datasets import VOCABS
from ...utils import conv_sequence, load_pretrained_params
diff --git a/latest/_modules/doctr/models/classification/resnet/tensorflow.html b/latest/_modules/doctr/models/classification/resnet/tensorflow.html
index f4bcd65452..620d4f0635 100644
--- a/latest/_modules/doctr/models/classification/resnet/tensorflow.html
+++ b/latest/_modules/doctr/models/classification/resnet/tensorflow.html
@@ -302,9 +302,9 @@
Source code for doctr.models.classification.resnet.tensorflow
from
typing import Any, Callable, Dict, List, Optional, Tuple
import tensorflow as tf
-
from keras import layers
-
from keras.applications import ResNet50
-
from keras.models import Sequential
+
from tensorflow.keras import layers
+
from tensorflow.keras.applications import ResNet50
+
from tensorflow.keras.models import Sequential
from doctr.datasets import VOCABS
diff --git a/latest/_modules/doctr/models/classification/textnet/tensorflow.html b/latest/_modules/doctr/models/classification/textnet/tensorflow.html
index 8f38b3470e..407e480818 100644
--- a/latest/_modules/doctr/models/classification/textnet/tensorflow.html
+++ b/latest/_modules/doctr/models/classification/textnet/tensorflow.html
@@ -302,7 +302,7 @@
Source code for doctr.models.classification.textnet.tensorflow
from
copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple
-
from keras import Sequential, layers
+
from tensorflow.keras import Sequential, layers
from doctr.datasets import VOCABS
diff --git a/latest/_modules/doctr/models/classification/vgg/tensorflow.html b/latest/_modules/doctr/models/classification/vgg/tensorflow.html
index d6142a8376..66ee6dcdd8 100644
--- a/latest/_modules/doctr/models/classification/vgg/tensorflow.html
+++ b/latest/_modules/doctr/models/classification/vgg/tensorflow.html
@@ -301,8 +301,8 @@
Source code for doctr.models.classification.vgg.tensorflow
from
copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple
-
from keras import layers
-
from keras.models import Sequential
+
from tensorflow.keras import layers
+
from tensorflow.keras.models import Sequential
from doctr.datasets import VOCABS
diff --git a/latest/_modules/doctr/models/classification/vit/tensorflow.html b/latest/_modules/doctr/models/classification/vit/tensorflow.html
index 81ef3d9dcf..7059d1f1d8 100644
--- a/latest/_modules/doctr/models/classification/vit/tensorflow.html
+++ b/latest/_modules/doctr/models/classification/vit/tensorflow.html
@@ -302,7 +302,7 @@
Source code for doctr.models.classification.vit.tensorflow
from
typing import Any, Dict, Optional, Tuple
import tensorflow as tf
-
from keras import Sequential, layers
+
from tensorflow.keras import Sequential, layers
from doctr.datasets import VOCABS
from doctr.models.modules.transformer import EncoderBlock
diff --git a/latest/_modules/doctr/models/detection/differentiable_binarization/tensorflow.html b/latest/_modules/doctr/models/detection/differentiable_binarization/tensorflow.html
index ba12ebbdf0..1a9eef2bfd 100644
--- a/latest/_modules/doctr/models/detection/differentiable_binarization/tensorflow.html
+++ b/latest/_modules/doctr/models/detection/differentiable_binarization/tensorflow.html
@@ -305,8 +305,8 @@
Source code for doctr.models.detection.differentiable_binarization.tensorflo
import numpy as np
import tensorflow as tf
-from keras import Model, Sequential, layers, losses
-from keras.applications import ResNet50
+from tensorflow.keras import Model, Sequential, layers, losses
+from tensorflow.keras.applications import ResNet50
from doctr.file_utils import CLASS_NAME
from doctr.models.utils import IntermediateLayerGetter, _bf16_to_float32, conv_sequence, load_pretrained_params
diff --git a/latest/_modules/doctr/models/detection/fast/tensorflow.html b/latest/_modules/doctr/models/detection/fast/tensorflow.html
index dc7d8f50f2..af51a9abeb 100644
--- a/latest/_modules/doctr/models/detection/fast/tensorflow.html
+++ b/latest/_modules/doctr/models/detection/fast/tensorflow.html
@@ -305,7 +305,7 @@ Source code for doctr.models.detection.fast.tensorflow
import
numpy as np
import tensorflow as tf
-
from keras import Model, Sequential, layers
+
from tensorflow.keras import Model, Sequential, layers
from doctr.file_utils import CLASS_NAME
from doctr.models.utils import IntermediateLayerGetter, _bf16_to_float32, load_pretrained_params
diff --git a/latest/_modules/doctr/models/detection/linknet/tensorflow.html b/latest/_modules/doctr/models/detection/linknet/tensorflow.html
index 14f36e18ed..b0133aee6b 100644
--- a/latest/_modules/doctr/models/detection/linknet/tensorflow.html
+++ b/latest/_modules/doctr/models/detection/linknet/tensorflow.html
@@ -305,7 +305,7 @@
Source code for doctr.models.detection.linknet.tensorflow
import
numpy as np
import tensorflow as tf
-
from keras import Model, Sequential, layers, losses
+
from tensorflow.keras import Model, Sequential, layers, losses
from doctr.file_utils import CLASS_NAME
from doctr.models.classification import resnet18, resnet34, resnet50
diff --git a/latest/_modules/doctr/models/recognition/crnn/tensorflow.html b/latest/_modules/doctr/models/recognition/crnn/tensorflow.html
index b38a069159..efee5f0f8e 100644
--- a/latest/_modules/doctr/models/recognition/crnn/tensorflow.html
+++ b/latest/_modules/doctr/models/recognition/crnn/tensorflow.html
@@ -302,8 +302,8 @@
Source code for doctr.models.recognition.crnn.tensorflow
from
typing import Any, Dict, List, Optional, Tuple, Union
import tensorflow as tf
-
from keras import layers
-
from keras.models import Model, Sequential
+
from tensorflow.keras import layers
+
from tensorflow.keras.models import Model, Sequential
from doctr.datasets import VOCABS
diff --git a/latest/_modules/doctr/models/recognition/master/tensorflow.html b/latest/_modules/doctr/models/recognition/master/tensorflow.html
index 1b11a994ef..4895fffe08 100644
--- a/latest/_modules/doctr/models/recognition/master/tensorflow.html
+++ b/latest/_modules/doctr/models/recognition/master/tensorflow.html
@@ -302,7 +302,7 @@
Source code for doctr.models.recognition.master.tensorflow
from
typing import Any, Dict, List, Optional, Tuple
import tensorflow as tf
-
from keras import Model, layers
+
from tensorflow.keras import Model, layers
from doctr.datasets import VOCABS
from doctr.models.classification import magc_resnet31
diff --git a/latest/_modules/doctr/models/recognition/parseq/tensorflow.html b/latest/_modules/doctr/models/recognition/parseq/tensorflow.html
index 1bbbf829b1..93a3b2ea81 100644
--- a/latest/_modules/doctr/models/recognition/parseq/tensorflow.html
+++ b/latest/_modules/doctr/models/recognition/parseq/tensorflow.html
@@ -305,7 +305,7 @@
Source code for doctr.models.recognition.parseq.tensorflow
import
numpy as np
import tensorflow as tf
-
from keras import Model, layers
+
from tensorflow.keras import Model, layers
from doctr.datasets import VOCABS
from doctr.models.modules.transformer import MultiHeadAttention, PositionwiseFeedForward
@@ -462,7 +462,6 @@
Source code for doctr.models.recognition.parseq.tensorflow
self
.postprocessor = PARSeqPostProcessor(vocab=self.vocab)
-
@tf.function
def generate_permutations(self, seqlen: tf.Tensor) -> tf.Tensor:
# Generates permutations of the target sequence.
# Translated from https://github.com/baudm/parseq/blob/main/strhub/models/parseq/system.py
@@ -509,7 +508,6 @@
Source code for doctr.models.recognition.parseq.tensorflow
)
return combined
-
@tf.function
def generate_permutations_attention_masks(self, permutation: tf.Tensor) -> Tuple[tf.Tensor, tf.Tensor]:
# Generate source and target mask for the decoder attention.
sz = permutation.shape[0]
@@ -529,7 +527,6 @@
Source code for doctr.models.recognition.parseq.tensorflow
target_mask
= mask[1:, :-1]
return tf.cast(source_mask, dtype=tf.bool), tf.cast(target_mask, dtype=tf.bool)
-
@tf.function
def decode(
self,
target: tf.Tensor,
diff --git a/latest/_modules/doctr/models/recognition/sar/tensorflow.html b/latest/_modules/doctr/models/recognition/sar/tensorflow.html
index 3f7318d360..b5531f0910 100644
--- a/latest/_modules/doctr/models/recognition/sar/tensorflow.html
+++ b/latest/_modules/doctr/models/recognition/sar/tensorflow.html
@@ -302,7 +302,7 @@
Source code for doctr.models.recognition.sar.tensorflow
from
typing import Any, Dict, List, Optional, Tuple
import tensorflow as tf
-
from keras import Model, Sequential, layers
+
from tensorflow.keras import Model, Sequential, layers
from doctr.datasets import VOCABS
from doctr.utils.repr import NestedObject
diff --git a/latest/_modules/doctr/models/recognition/vitstr/tensorflow.html b/latest/_modules/doctr/models/recognition/vitstr/tensorflow.html
index 23730f6227..aecde3662a 100644
--- a/latest/_modules/doctr/models/recognition/vitstr/tensorflow.html
+++ b/latest/_modules/doctr/models/recognition/vitstr/tensorflow.html
@@ -302,7 +302,7 @@
Source code for doctr.models.recognition.vitstr.tensorflow
from
typing import Any, Dict, List, Optional, Tuple
import tensorflow as tf
-
from keras import Model, layers
+
from tensorflow.keras import Model, layers
from doctr.datasets import VOCABS
diff --git a/latest/_modules/doctr/transforms/modules/tensorflow.html b/latest/_modules/doctr/transforms/modules/tensorflow.html
index ae4f26eb78..6e825f2776 100644
--- a/latest/_modules/doctr/transforms/modules/tensorflow.html
+++ b/latest/_modules/doctr/transforms/modules/tensorflow.html
@@ -729,7 +729,6 @@
Source code for doctr.transforms.modules.tensorflow
def extra_repr(self) -> str:
return f"kernel_shape={self.kernel_shape}, std={self.std}"
- @tf.function
def __call__(self, img: tf.Tensor) -> tf.Tensor:
return tf.squeeze(
_gaussian_filter(
diff --git a/latest/_sources/using_doctr/using_model_export.rst.txt b/latest/_sources/using_doctr/using_model_export.rst.txt
index 48f570f699..c62c36169b 100644
--- a/latest/_sources/using_doctr/using_model_export.rst.txt
+++ b/latest/_sources/using_doctr/using_model_export.rst.txt
@@ -31,7 +31,7 @@ Advantages:
.. code:: python3
import tensorflow as tf
- from keras import mixed_precision
+ from tensorflow.keras import mixed_precision
mixed_precision.set_global_policy('mixed_float16')
predictor = ocr_predictor(reco_arch="crnn_mobilenet_v3_small", det_arch="linknet_resnet34", pretrained=True)
diff --git a/latest/using_doctr/using_model_export.html b/latest/using_doctr/using_model_export.html
index d467663403..75c81caa7c 100644
--- a/latest/using_doctr/using_model_export.html
+++ b/latest/using_doctr/using_model_export.html
@@ -316,7 +316,7 @@
Half-precision