From b061bcf891e2dcac76b1ac923c48688df75fd470 Mon Sep 17 00:00:00 2001 From: Jan <116908874+jk4e@users.noreply.github.com> Date: Thu, 26 Jun 2025 09:56:49 +0200 Subject: [PATCH] Fix typos --- doctr/models/_utils.py | 2 +- doctr/models/recognition/crnn/pytorch.py | 2 +- doctr/models/recognition/crnn/tensorflow.py | 2 +- doctr/models/recognition/master/pytorch.py | 2 +- doctr/models/recognition/master/tensorflow.py | 2 +- doctr/models/recognition/viptr/pytorch.py | 2 +- references/detection/README.md | 2 +- references/recognition/README.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doctr/models/_utils.py b/doctr/models/_utils.py index 9a83fb37e3..2443ab0eca 100644 --- a/doctr/models/_utils.py +++ b/doctr/models/_utils.py @@ -184,7 +184,7 @@ def invert_data_structure( dictionary of list when x is a list of dictionaries or a list of dictionaries when x is dictionary of lists """ if isinstance(x, dict): - assert len({len(v) for v in x.values()}) == 1, "All the lists in the dictionnary should have the same length." + assert len({len(v) for v in x.values()}) == 1, "All the lists in the dictionary should have the same length." return [dict(zip(x, t)) for t in zip(*x.values())] elif isinstance(x, list): return {k: [dic[k] for dic in x] for k in x[0]} diff --git a/doctr/models/recognition/crnn/pytorch.py b/doctr/models/recognition/crnn/pytorch.py index 279689fc3f..c8a50f5a74 100644 --- a/doctr/models/recognition/crnn/pytorch.py +++ b/doctr/models/recognition/crnn/pytorch.py @@ -82,7 +82,7 @@ def ctc_best_path( def __call__(self, logits: torch.Tensor) -> list[tuple[str, float]]: """Performs decoding of raw output with CTC and decoding of CTC predictions - with label_to_idx mapping dictionnary + with label_to_idx mapping dictionary Args: logits: raw output of the model, shape (N, C + 1, seq_len) diff --git a/doctr/models/recognition/crnn/tensorflow.py b/doctr/models/recognition/crnn/tensorflow.py index fa486331ef..5628ecd241 100644 --- a/doctr/models/recognition/crnn/tensorflow.py +++ b/doctr/models/recognition/crnn/tensorflow.py @@ -59,7 +59,7 @@ def __call__( top_paths: int = 1, ) -> list[tuple[str, float]] | list[tuple[list[str] | list[float]]]: """Performs decoding of raw output with CTC and decoding of CTC predictions - with label_to_idx mapping dictionnary + with label_to_idx mapping dictionary Args: logits: raw output of the model, shape BATCH_SIZE X SEQ_LEN X NUM_CLASSES + 1 diff --git a/doctr/models/recognition/master/pytorch.py b/doctr/models/recognition/master/pytorch.py index 46f87ec72e..f958b2289f 100644 --- a/doctr/models/recognition/master/pytorch.py +++ b/doctr/models/recognition/master/pytorch.py @@ -176,7 +176,7 @@ def forward( return_preds: if True, decode logits Returns: - A dictionnary containing eventually loss, logits and predictions. + A dictionary containing eventually loss, logits and predictions. """ # Encode features = self.feat_extractor(x)["features"] diff --git a/doctr/models/recognition/master/tensorflow.py b/doctr/models/recognition/master/tensorflow.py index e445dd0791..549d5a9654 100644 --- a/doctr/models/recognition/master/tensorflow.py +++ b/doctr/models/recognition/master/tensorflow.py @@ -165,7 +165,7 @@ def call( **kwargs: keyword arguments passed to the decoder Returns: - A dictionnary containing eventually loss, logits and predictions. + A dictionary containing eventually loss, logits and predictions. """ # Encode feature = self.feat_extractor(x, **kwargs) diff --git a/doctr/models/recognition/viptr/pytorch.py b/doctr/models/recognition/viptr/pytorch.py index 47d3d6d0e1..b1cd6935b1 100644 --- a/doctr/models/recognition/viptr/pytorch.py +++ b/doctr/models/recognition/viptr/pytorch.py @@ -70,7 +70,7 @@ def ctc_best_path( def __call__(self, logits: torch.Tensor) -> list[tuple[str, float]]: """Performs decoding of raw output with CTC and decoding of CTC predictions - with label_to_idx mapping dictionnary + with label_to_idx mapping dictionary Args: logits: raw output of the model, shape (N, C + 1, seq_len) diff --git a/references/detection/README.md b/references/detection/README.md index c62d793be8..5d3481f705 100644 --- a/references/detection/README.md +++ b/references/detection/README.md @@ -29,7 +29,7 @@ python references/detection/train_pytorch.py db_resnet50 --train_path path/to/yo We now use the built-in [`torchrun`](https://pytorch.org/docs/stable/elastic/run.html) launcher to spawn your DDP workers. `torchrun` will set all the necessary environment variables (`LOCAL_RANK`, `RANK`, etc.) for you. Arguments are the same than the ones from single GPU, except: -- `--backend`: you can specify another `backend` for `DistribuedDataParallel` if the default one is not available on +- `--backend`: you can specify another `backend` for `DistributedDataParallel` if the default one is not available on your operating system. Fastest one is `nccl` according to [PyTorch Documentation](https://pytorch.org/docs/stable/generated/torch.nn.parallel.DistributedDataParallel.html). #### Key `torchrun` parameters: diff --git a/references/recognition/README.md b/references/recognition/README.md index 96628e5978..397f2ab07b 100644 --- a/references/recognition/README.md +++ b/references/recognition/README.md @@ -29,7 +29,7 @@ python references/recognition/train_pytorch.py crnn_vgg16_bn --train_path path/t We now use the built-in [`torchrun`](https://pytorch.org/docs/stable/elastic/run.html) launcher to spawn your DDP workers. `torchrun` will set all the necessary environment variables (`LOCAL_RANK`, `RANK`, etc.) for you. Arguments are the same than the ones from single GPU, except: -- `--backend`: you can specify another `backend` for `DistribuedDataParallel` if the default one is not available on +- `--backend`: you can specify another `backend` for `DistributedDataParallel` if the default one is not available on your operating system. Fastest one is `nccl` according to [PyTorch Documentation](https://pytorch.org/docs/stable/generated/torch.nn.parallel.DistributedDataParallel.html). #### Key `torchrun` parameters: