Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,5 @@
|
|
| 1 |
-
|
| 2 |
import importlib
|
| 3 |
-
|
| 4 |
-
if importlib.util.find_spec("bidi") is None:
|
| 5 |
-
print("Error: python-bidi is not installed. Please add it to requirements.txt")
|
| 6 |
-
sys.exit(1)
|
| 7 |
-
|
| 8 |
import streamlit as st
|
| 9 |
from PIL import Image
|
| 10 |
import boto3
|
|
@@ -16,6 +11,11 @@ import numpy as np
|
|
| 16 |
from shapely.geometry import Polygon
|
| 17 |
from paddleocr import PaddleOCR
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
# Initialize OCR models outside the main app flow
|
| 20 |
@st.cache_resource
|
| 21 |
def load_models():
|
|
@@ -138,5 +138,5 @@ def main():
|
|
| 138 |
|
| 139 |
st.write("Note: This application combines text extracted from the CV using multiple OCR methods to improve accuracy.")
|
| 140 |
|
| 141 |
-
if
|
| 142 |
main()
|
|
|
|
| 1 |
+
import sys
|
| 2 |
import importlib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
import streamlit as st
|
| 4 |
from PIL import Image
|
| 5 |
import boto3
|
|
|
|
| 11 |
from shapely.geometry import Polygon
|
| 12 |
from paddleocr import PaddleOCR
|
| 13 |
|
| 14 |
+
# Check if python-bidi is installed
|
| 15 |
+
if importlib.util.find_spec("bidi") is None:
|
| 16 |
+
print("Error: python-bidi is not installed. Please add it to requirements.txt")
|
| 17 |
+
sys.exit(1)
|
| 18 |
+
|
| 19 |
# Initialize OCR models outside the main app flow
|
| 20 |
@st.cache_resource
|
| 21 |
def load_models():
|
|
|
|
| 138 |
|
| 139 |
st.write("Note: This application combines text extracted from the CV using multiple OCR methods to improve accuracy.")
|
| 140 |
|
| 141 |
+
if __name__ == "__main__":
|
| 142 |
main()
|