Commit
·
0a1de21
1
Parent(s):
e7f5cd0
update
Browse files
app.py
CHANGED
|
@@ -107,6 +107,8 @@ if uploaded_file is not None:
|
|
| 107 |
image = Image.open(uploaded_file)
|
| 108 |
# image.save(os.path.join(PROJECT_ROOT, input_file_path))
|
| 109 |
image.save(input_file_path)
|
|
|
|
|
|
|
| 110 |
|
| 111 |
if st.button("Run Text Detection"):
|
| 112 |
progress_placeholder = st.empty()
|
|
@@ -118,7 +120,12 @@ if uploaded_file is not None:
|
|
| 118 |
#os.makedirs(osp(output_path, "result"), exist_ok=True)
|
| 119 |
#os.makedirs(osp(output_path, "mask"), exist_ok=True)
|
| 120 |
rc, stderr_output = run_bash_script(input_path, output_path, progress_placeholder, status_text)
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
if rc == 0:
|
| 123 |
status_text.text("Text detection completed successfully!")
|
| 124 |
result_folder = os.path.join(output_path, "result")
|
|
@@ -148,10 +155,10 @@ if uploaded_file is not None:
|
|
| 148 |
progress_placeholder.empty()
|
| 149 |
status_text.empty()
|
| 150 |
|
| 151 |
-
file_namea = " || ".join(os.listdir(f'{temp_dir}/mask'))
|
| 152 |
-
file_nameb = " || ".join(os.listdir(f'{temp_dir}/result'))
|
| 153 |
-
file_namec = " || ".join(os.listdir(f'{temp_dir}/bbox'))
|
| 154 |
-
st.write(file_namea)
|
| 155 |
-
st.write(file_nameb)
|
| 156 |
-
st.write(file_namec)
|
| 157 |
st.write("Note: The download button will appear after running text detection.")
|
|
|
|
| 107 |
image = Image.open(uploaded_file)
|
| 108 |
# image.save(os.path.join(PROJECT_ROOT, input_file_path))
|
| 109 |
image.save(input_file_path)
|
| 110 |
+
file_name = " || ".join(os.listdir(f'{temp_dir}/target_folder'))
|
| 111 |
+
st.write(file_name)
|
| 112 |
|
| 113 |
if st.button("Run Text Detection"):
|
| 114 |
progress_placeholder = st.empty()
|
|
|
|
| 120 |
#os.makedirs(osp(output_path, "result"), exist_ok=True)
|
| 121 |
#os.makedirs(osp(output_path, "mask"), exist_ok=True)
|
| 122 |
rc, stderr_output = run_bash_script(input_path, output_path, progress_placeholder, status_text)
|
| 123 |
+
file_namea = " || ".join(os.listdir(f'{temp_dir}/target_folder/mask'))
|
| 124 |
+
file_nameb = " || ".join(os.listdir(f'{temp_dir}/target_folder/bbox'))
|
| 125 |
+
file_namec = " || ".join(os.listdir(f'{temp_dir}/target_folder/result'))
|
| 126 |
+
st.write(file_namea)
|
| 127 |
+
st.write(file_nameb)
|
| 128 |
+
st.write(file_namec)
|
| 129 |
if rc == 0:
|
| 130 |
status_text.text("Text detection completed successfully!")
|
| 131 |
result_folder = os.path.join(output_path, "result")
|
|
|
|
| 155 |
progress_placeholder.empty()
|
| 156 |
status_text.empty()
|
| 157 |
|
| 158 |
+
file_namea = " || ".join(os.listdir(f'{temp_dir}/mask'))
|
| 159 |
+
file_nameb = " || ".join(os.listdir(f'{temp_dir}/result'))
|
| 160 |
+
file_namec = " || ".join(os.listdir(f'{temp_dir}/bbox'))
|
| 161 |
+
st.write(file_namea)
|
| 162 |
+
st.write(file_nameb)
|
| 163 |
+
st.write(file_namec)
|
| 164 |
st.write("Note: The download button will appear after running text detection.")
|