Spaces:
Sleeping
Sleeping
pnicewiczoig commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ if image is not None:
|
|
| 25 |
input_image = Image.open(image) #read image
|
| 26 |
st.image(input_image) #display image
|
| 27 |
|
| 28 |
-
with st.spinner("
|
| 29 |
|
| 30 |
|
| 31 |
result = reader.readtext(np.array(input_image))
|
|
@@ -34,7 +34,9 @@ if image is not None:
|
|
| 34 |
|
| 35 |
|
| 36 |
for text in result:
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
|
| 39 |
st.write(result_text)
|
| 40 |
st.balloons()
|
|
|
|
| 25 |
input_image = Image.open(image) #read image
|
| 26 |
st.image(input_image) #display image
|
| 27 |
|
| 28 |
+
with st.spinner("Please wait ... processing"):
|
| 29 |
|
| 30 |
|
| 31 |
result = reader.readtext(np.array(input_image))
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
for text in result:
|
| 37 |
+
# only output if numbers and spaces
|
| 38 |
+
if re.match("^[0-9 ]+$", text[1]):
|
| 39 |
+
result_text.append(text[1])
|
| 40 |
|
| 41 |
st.write(result_text)
|
| 42 |
st.balloons()
|