Spaces:
Sleeping
Sleeping
Commit
·
d840e96
1
Parent(s):
9bc57af
Corrected download button
Browse files- .gitignore +2 -0
- app.py +5 -3
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
venv/
|
| 2 |
+
venv
|
app.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
import numpy as np
|
| 4 |
import streamlit as st
|
| 5 |
import torch
|
|
|
|
| 6 |
|
| 7 |
from doctr.io import DocumentFile
|
| 8 |
from doctr.utils.visualization import visualize_page
|
|
@@ -115,12 +116,13 @@ def main(det_archs, reco_archs):
|
|
| 115 |
print('\n')
|
| 116 |
|
| 117 |
# Display Text
|
| 118 |
-
st.markdown("\n
|
| 119 |
st.write(all_text)
|
| 120 |
|
| 121 |
# Display JSON
|
| 122 |
-
|
| 123 |
-
st.
|
|
|
|
| 124 |
st.json(page_export, expanded=False)
|
| 125 |
|
| 126 |
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import streamlit as st
|
| 5 |
import torch
|
| 6 |
+
import json
|
| 7 |
|
| 8 |
from doctr.io import DocumentFile
|
| 9 |
from doctr.utils.visualization import visualize_page
|
|
|
|
| 116 |
print('\n')
|
| 117 |
|
| 118 |
# Display Text
|
| 119 |
+
st.markdown("\n## **Here is your text:**")
|
| 120 |
st.write(all_text)
|
| 121 |
|
| 122 |
# Display JSON
|
| 123 |
+
json_string = json.dumps(page_export)
|
| 124 |
+
st.markdown("\n## **Here are your analysis results in JSON format:**")
|
| 125 |
+
st.download_button(label="Download JSON", data=json_string, file_name='data.json', mime='application/json')
|
| 126 |
st.json(page_export, expanded=False)
|
| 127 |
|
| 128 |
|