@@ -24,7 +24,7 @@ As such, you can select the architecture used for [text detection](https://minde
2424``` python
2525from doctr.models import ocr_predictor
2626
27- model = ocr_predictor(det_arch = ' db_resnet50' , reco_arch = ' crnn_vgg16_bn' , pretrained = True )
27+ model = ocr_predictor(det_arch = " db_resnet50" , reco_arch = " crnn_vgg16_bn" , pretrained = True )
2828```
2929
3030### Reading files
@@ -33,6 +33,7 @@ Documents can be interpreted from PDF or images:
3333
3434``` python
3535from doctr.io import DocumentFile
36+
3637# PDF
3738pdf_doc = DocumentFile.from_pdf(" path/to/your/doc.pdf" )
3839# Image
@@ -87,7 +88,9 @@ Or even rebuild the original document from its predictions:
8788import matplotlib.pyplot as plt
8889
8990synthetic_pages = result.synthesize()
90- plt.imshow(synthetic_pages[0 ]); plt.axis(' off' ); plt.show()
91+ plt.imshow(synthetic_pages[0 ])
92+ plt.axis(" off" )
93+ plt.show()
9194```
9295
9396![ Synthesis sample] ( https://github.com/mindee/doctr/raw/main/docs/images/synthesized_sample.png )
@@ -112,7 +115,7 @@ from doctr.io import DocumentFile
112115from doctr.models import kie_predictor
113116
114117# Model
115- model = kie_predictor(det_arch = ' db_resnet50' , reco_arch = ' crnn_vgg16_bn' , pretrained = True )
118+ model = kie_predictor(det_arch = " db_resnet50" , reco_arch = " crnn_vgg16_bn" , pretrained = True )
116119# PDF
117120doc = DocumentFile.from_pdf(" path/to/your/doc.pdf" )
118121# Analyze
@@ -313,7 +316,7 @@ import requests
313316
314317params = {" det_arch" : " db_resnet50" , " reco_arch" : " crnn_vgg16_bn" }
315318
316- with open (' /path/to/your/doc.jpg' , ' rb ' ) as f:
319+ with open (" /path/to/your/doc.jpg" , " rb " ) as f:
317320 files = [ # application/pdf, image/jpeg, image/png supported
318321 (" files" , (" doc.jpg" , f.read(), " image/jpeg" )),
319322 ]
0 commit comments