From f4e854502312596dae766a2db537683fd08fa074 Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 21 Nov 2024 12:46:32 +0100 Subject: [PATCH] minor doc update --- docs/source/using_doctr/using_model_export.rst | 4 ++-- doctr/models/classification/zoo.py | 1 + doctr/models/detection/zoo.py | 2 +- doctr/models/recognition/zoo.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/source/using_doctr/using_model_export.rst b/docs/source/using_doctr/using_model_export.rst index 810868d3ba..073172efbc 100644 --- a/docs/source/using_doctr/using_model_export.rst +++ b/docs/source/using_doctr/using_model_export.rst @@ -57,7 +57,7 @@ Compiling your models (PyTorch only) **NOTE:** -- This feature is only available for PyTorch models. +- This feature is only available if you use PyTorch as backend. - The recognition architecture `master` is not supported for model compilation yet. - We provide only official support for the default (`inductor`) backend, but you can try other backends, configurations depending on your hardware and requirements as well. @@ -125,7 +125,7 @@ It defines a common format for representing models, including the network struct dummy_input = torch.rand((batch_size, input_shape), dtype=torch.float32) model_path = export_model_to_onnx( model, - model_name="vitstr.onnx, + model_name="vitstr.onnx", dummy_input=dummy_input ) diff --git a/doctr/models/classification/zoo.py b/doctr/models/classification/zoo.py index dccb32158d..0d94d061d2 100644 --- a/doctr/models/classification/zoo.py +++ b/doctr/models/classification/zoo.py @@ -50,6 +50,7 @@ def _orientation_predictor( else: allowed_archs = [classification.MobileNetV3] if is_torch_available(): + # Adding the type for torch compiled models to the allowed architectures from doctr.models.utils import _CompiledModule allowed_archs.append(_CompiledModule) diff --git a/doctr/models/detection/zoo.py b/doctr/models/detection/zoo.py index 419ebac7e8..6986d07e47 100644 --- a/doctr/models/detection/zoo.py +++ b/doctr/models/detection/zoo.py @@ -58,7 +58,7 @@ def _predictor(arch: Any, pretrained: bool, assume_straight_pages: bool = True, else: allowed_archs = [detection.DBNet, detection.LinkNet, detection.FAST] if is_torch_available(): - # The following is required for torch compiled models + # Adding the type for torch compiled models to the allowed architectures from doctr.models.utils import _CompiledModule allowed_archs.append(_CompiledModule) diff --git a/doctr/models/recognition/zoo.py b/doctr/models/recognition/zoo.py index 64522760c7..0909bc975d 100644 --- a/doctr/models/recognition/zoo.py +++ b/doctr/models/recognition/zoo.py @@ -37,7 +37,7 @@ def _predictor(arch: Any, pretrained: bool, **kwargs: Any) -> RecognitionPredict else: allowed_archs = [recognition.CRNN, recognition.SAR, recognition.MASTER, recognition.ViTSTR, recognition.PARSeq] if is_torch_available(): - # The following is required for torch compiled models + # Adding the type for torch compiled models to the allowed architectures from doctr.models.utils import _CompiledModule allowed_archs.append(_CompiledModule)