Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
import numpy as np
|
|
@@ -32,7 +36,8 @@ candidates = [
|
|
| 32 |
]
|
| 33 |
|
| 34 |
# Initialize PaddleOCR for text detection only
|
| 35 |
-
ocr_detector = PaddleOCR(use_textline_orientation=False, lang='en'
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
# Cache OCR recognizers by language
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = ""
|
| 3 |
+
|
| 4 |
+
|
| 5 |
import gradio as gr
|
| 6 |
import torch
|
| 7 |
import numpy as np
|
|
|
|
| 36 |
]
|
| 37 |
|
| 38 |
# Initialize PaddleOCR for text detection only
|
| 39 |
+
ocr_detector = PaddleOCR(use_textline_orientation=False, lang='en')
|
| 40 |
+
|
| 41 |
|
| 42 |
|
| 43 |
# Cache OCR recognizers by language
|