May222 commited on
Commit
eb7c363
1 Parent(s): 58a4554

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -78,15 +78,15 @@ def main():
78
  if st.sidebar.button("Analyze image"):
79
 
80
  if uploaded_file is None:
81
- st.sidebar.write("Please upload a document")
82
 
83
  else:
84
  with st.spinner('Loading model...'):
85
  if det_arch == 'pytesseract':
86
- predictor = pytesseract.image_to_string(Image.open(doc))
87
  else:
88
  reader = easyocr.Reader(['en'])
89
- predictor = reader.readtext("./data/" + filename, detail = 0)
90
  with st.spinner('Analyzing...'):
91
 
92
  # Plot OCR output
 
78
  if st.sidebar.button("Analyze image"):
79
 
80
  if uploaded_file is None:
81
+ st.sidebar.write("Please upload an image")
82
 
83
  else:
84
  with st.spinner('Loading model...'):
85
  if det_arch == 'pytesseract':
86
+ predictor = pytesseract.image_to_string(doc)
87
  else:
88
  reader = easyocr.Reader(['en'])
89
+ predictor = reader.readtext(doc, detail = 0)
90
  with st.spinner('Analyzing...'):
91
 
92
  # Plot OCR output