File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 12
12
import streamlit as st
13
13
14
14
from msfocr .data import dhis2
15
- from msfocr .data import ocr_functions
15
+ from msfocr .doctr import ocr_functions
16
16
17
17
def configure_secrets ():
18
18
"""Checks that necessary environment variables are set for fast failing.
@@ -156,7 +156,12 @@ def get_uploaded_images(tally_sheet):
156
156
:param Files uploaded by user
157
157
:return List of images uploaded by user as docTR DocumentFiles
158
158
"""
159
- return [DocumentFile .from_images (sheet .read ()) for sheet in tally_sheet ]
159
+ res = []
160
+ for sheet in tally_sheet :
161
+ sheet .seek (0 , 0 )
162
+ image = sheet .read ()
163
+ res .append (DocumentFile .from_images (image ))
164
+ return res
160
165
161
166
@st .cache_data
162
167
def get_results (uploaded_images ):
@@ -292,14 +297,15 @@ def get_period():
292
297
if 'table_dfs' in st .session_state :
293
298
del st .session_state ['table_dfs' ]
294
299
st .rerun ()
295
-
300
+
296
301
uploaded_images = get_uploaded_images (tally_sheet )
297
302
results = get_results (uploaded_images )
298
303
299
304
### CORRECT THIS TO ALLOW PROCESSING OF ALL IMAGES
300
305
# ***************************************
301
306
image = uploaded_images [0 ]
302
307
result = results [0 ]
308
+ print (result )
303
309
# ***************************************
304
310
305
311
# form_type looks like [dataSet, orgUnit, period=[startDate, endDate]]
You can’t perform that action at this time.
0 commit comments