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