Spaces:
Build error
Build error
Commit ·
be3cbf2
1
Parent(s): f9ff716
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import zipfile, os, json
|
|
|
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
if 'data' not in st.session_state:
|
|
@@ -65,12 +67,13 @@ with st.form("my_form"):
|
|
| 65 |
with zipfile.ZipFile('images.zip', 'w') as img_zip:
|
| 66 |
for i,image in enumerate(images):
|
| 67 |
img_name = f"{i}_image"
|
| 68 |
-
img_zip.writestr(img_name, image)
|
| 69 |
|
| 70 |
with zipfile.ZipFile("labels.zip", "w") as zip:
|
| 71 |
for i,t in enumerate(text):
|
| 72 |
txt_name = f"{i}_label"
|
| 73 |
zip.writestr(txt_name, t)
|
|
|
|
| 74 |
|
| 75 |
|
| 76 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import zipfile, os, json
|
| 3 |
+
from io import StringIO
|
| 4 |
+
|
| 5 |
|
| 6 |
|
| 7 |
if 'data' not in st.session_state:
|
|
|
|
| 67 |
with zipfile.ZipFile('images.zip', 'w') as img_zip:
|
| 68 |
for i,image in enumerate(images):
|
| 69 |
img_name = f"{i}_image"
|
| 70 |
+
img_zip.writestr(img_name, image.read())
|
| 71 |
|
| 72 |
with zipfile.ZipFile("labels.zip", "w") as zip:
|
| 73 |
for i,t in enumerate(text):
|
| 74 |
txt_name = f"{i}_label"
|
| 75 |
zip.writestr(txt_name, t)
|
| 76 |
+
|
| 77 |
|
| 78 |
|
| 79 |
|