Spaces:
Sleeping
Sleeping
hafizh zaki prasetyo adi
commited on
Commit
•
91416d9
1
Parent(s):
37e4b8d
add upload_file folder
Browse files
app.py
CHANGED
@@ -4,7 +4,10 @@ from tablecv import extract_table
|
|
4 |
img_name = st.file_uploader("Upload an image with table(s)")
|
5 |
if img_name is not None:
|
6 |
st.image(img_name)
|
7 |
-
|
|
|
|
|
|
|
8 |
f.write(img_name.getbuffer())
|
9 |
extracted_tables = extract_table(image_path=img_name.name)
|
10 |
|
|
|
4 |
img_name = st.file_uploader("Upload an image with table(s)")
|
5 |
if img_name is not None:
|
6 |
st.image(img_name)
|
7 |
+
isExist = os.path.exists("upload_file")
|
8 |
+
if not isExist:
|
9 |
+
os.makedirs("upload_file")
|
10 |
+
with open("upload_file/"+img_name.name, "wb") as f:
|
11 |
f.write(img_name.getbuffer())
|
12 |
extracted_tables = extract_table(image_path=img_name.name)
|
13 |
|