Added keys arguemnt to file uploader
Browse files- app.py +2 -2
- components/upload_section.py +1 -1
app.py
CHANGED
|
@@ -46,7 +46,7 @@ tab1, tab2, tab3 = st.tabs(["Upload Pokemon Card", "Card Database", "OCR Card Vi
|
|
| 46 |
|
| 47 |
|
| 48 |
with tab1:
|
| 49 |
-
uploaded_file = render_upload_section()
|
| 50 |
|
| 51 |
# Check if file was uploaded
|
| 52 |
if uploaded_file:
|
|
@@ -115,7 +115,7 @@ with tab3:
|
|
| 115 |
st.caption("Upload a card to see exactly which regions the OCR is scanning.")
|
| 116 |
|
| 117 |
# Reuse the shared upload component to accept a card image
|
| 118 |
-
vis_file = render_upload_section()
|
| 119 |
|
| 120 |
if vis_file:
|
| 121 |
# Read the uploaded file bytes and decode into a Pillow Image for local display
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
with tab1:
|
| 49 |
+
uploaded_file = render_upload_section(key="upload_tab1")
|
| 50 |
|
| 51 |
# Check if file was uploaded
|
| 52 |
if uploaded_file:
|
|
|
|
| 115 |
st.caption("Upload a card to see exactly which regions the OCR is scanning.")
|
| 116 |
|
| 117 |
# Reuse the shared upload component to accept a card image
|
| 118 |
+
vis_file = render_upload_section(key="upload_tab3")
|
| 119 |
|
| 120 |
if vis_file:
|
| 121 |
# Read the uploaded file bytes and decode into a Pillow Image for local display
|
components/upload_section.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
def render_upload_section():
|
| 4 |
uploaded_file = st.file_uploader(
|
| 5 |
"",
|
| 6 |
type=["png", "jpg", "jpeg"],
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
def render_upload_section(key="file_uploader"):
|
| 4 |
uploaded_file = st.file_uploader(
|
| 5 |
"",
|
| 6 |
type=["png", "jpg", "jpeg"],
|