Spaces:
Runtime error
Runtime error
fix: Image open bytes filetype
Browse files
app.py
CHANGED
@@ -60,14 +60,14 @@ with st.sidebar:
|
|
60 |
information = st.radio(
|
61 |
"What information inside the are you interested in?",
|
62 |
('Receipt Summary', 'Receipt Menu Details', 'Extract all!'))
|
63 |
-
receipt = st.selectbox('Pick one 🧾', ['1', '2', '3', '4', '5', '6'], index=
|
64 |
|
65 |
# file upload
|
66 |
uploaded_file = st.file_uploader("Upload a 🧾")
|
67 |
if uploaded_file is not None:
|
68 |
# To read file as bytes:
|
69 |
image_bytes_data = uploaded_file.getvalue()
|
70 |
-
image_upload = Image.frombytes('RGBA', (128,128), image_bytes_data, 'raw')
|
71 |
# st.write(bytes_data)
|
72 |
|
73 |
st.text(f'{information} mode is ON!\nTarget 🧾: {receipt}') # \n(opening image @:./img/receipt-{receipt}.png)')
|
|
|
60 |
information = st.radio(
|
61 |
"What information inside the are you interested in?",
|
62 |
('Receipt Summary', 'Receipt Menu Details', 'Extract all!'))
|
63 |
+
receipt = st.selectbox('Pick one 🧾', ['1', '2', '3', '4', '5', '6'], index=1)
|
64 |
|
65 |
# file upload
|
66 |
uploaded_file = st.file_uploader("Upload a 🧾")
|
67 |
if uploaded_file is not None:
|
68 |
# To read file as bytes:
|
69 |
image_bytes_data = uploaded_file.getvalue()
|
70 |
+
image_upload = Image.open(image_bytes_data) #.frombytes('RGBA', (128,128), image_bytes_data, 'raw')
|
71 |
# st.write(bytes_data)
|
72 |
|
73 |
st.text(f'{information} mode is ON!\nTarget 🧾: {receipt}') # \n(opening image @:./img/receipt-{receipt}.png)')
|