Update app.py
Browse files
app.py
CHANGED
|
@@ -9,10 +9,10 @@ import os
|
|
| 9 |
|
| 10 |
app = FastAPI()
|
| 11 |
|
| 12 |
-
# Load the doctr OCR model
|
| 13 |
-
os.environ['USE_TORCH'] = 'YES'
|
| 14 |
-
os.environ['USE_TF'] = 'NO'
|
| 15 |
-
|
| 16 |
|
| 17 |
def ocr_with_doctr(file):
|
| 18 |
text_output = ''
|
|
|
|
| 9 |
|
| 10 |
app = FastAPI()
|
| 11 |
|
| 12 |
+
# # Load the doctr OCR model
|
| 13 |
+
# os.environ['USE_TORCH'] = 'YES'
|
| 14 |
+
# os.environ['USE_TF'] = 'NO'
|
| 15 |
+
model = ocr_predictor(det_arch='db_resnet50', reco_arch='crnn_vgg16_bn', pretrained=True)
|
| 16 |
|
| 17 |
def ocr_with_doctr(file):
|
| 18 |
text_output = ''
|