NEXAS commited on
Commit
0ce4040
1 Parent(s): 9da10b2

Update src/OCR.py

Browse files

Issue of model downloading every time resolved

Files changed (1) hide show
  1. src/OCR.py +2 -2
src/OCR.py CHANGED
@@ -8,6 +8,7 @@ from utils.qa import chain
8
  from langchain.memory import ConversationBufferWindowMemory
9
  from langchain_community.chat_message_histories import StreamlitChatMessageHistory
10
 
 
11
  def I_OCR():
12
  # Function to display the OCR image with bounding boxes and text
13
  def display_ocr_image(img, results):
@@ -45,8 +46,7 @@ def I_OCR():
45
  if file is not None:
46
  image = Image.open(file)
47
  st.image(image)
48
-
49
- reader = easyocr.Reader(['en', 'hi'], gpu=False)
50
  results = reader.readtext(np.array(image))
51
 
52
  img_df = pd.DataFrame(results, columns=['bbox', 'Predicted Text', 'Prediction Confidence'])
 
8
  from langchain.memory import ConversationBufferWindowMemory
9
  from langchain_community.chat_message_histories import StreamlitChatMessageHistory
10
 
11
+ reader = easyocr.Reader(['en', 'hi'], gpu=False)
12
  def I_OCR():
13
  # Function to display the OCR image with bounding boxes and text
14
  def display_ocr_image(img, results):
 
46
  if file is not None:
47
  image = Image.open(file)
48
  st.image(image)
49
+
 
50
  results = reader.readtext(np.array(image))
51
 
52
  img_df = pd.DataFrame(results, columns=['bbox', 'Predicted Text', 'Prediction Confidence'])