Skip to content

Commit

Permalink
docs: fix faulty code for prediction and recognition demos (#1800)
Browse files Browse the repository at this point in the history
  • Loading branch information
khanfarhan10 authored Nov 30, 2024
1 parent 72bed41 commit 2711df4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/using_doctr/using_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ Detection predictors
import numpy as np
from doctr.models import detection_predictor
predictor = detection_predictor('db_resnet50')
model = detection_predictor('db_resnet50')
dummy_img = (255 * np.random.rand(800, 600, 3)).astype(np.uint8)
out = model([dummy_img])
You can pass specific boolean arguments to the predictor:

* `pretrained`: if you want to use a model that has been pretrained on a specific dataset, setting `pretrained=True` this will load the corresponding weights. If `pretrained=False`, which is the default, would otherwise lead to a random initialization and would lead to no/useless results.
* `assume_straight_pages`: if you work with straight documents only, it will fit straight bounding boxes to the text areas.
* `preserve_aspect_ratio`: if you want to preserve the aspect ratio of your documents while resizing before sending them to the model.
* `symmetric_pad`: if you choose to preserve the aspect ratio, it will pad the image symmetrically and not from the bottom-right.
Expand Down Expand Up @@ -198,7 +198,7 @@ Recognition predictors
import numpy as np
from doctr.models import recognition_predictor
predictor = recognition_predictor('crnn_vgg16_bn')
model = recognition_predictor('crnn_vgg16_bn')
dummy_img = (255 * np.random.rand(50, 150, 3)).astype(np.uint8)
out = model([dummy_img])
Expand Down

0 comments on commit 2711df4

Please sign in to comment.