Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -121,7 +121,7 @@ st.title("Accessary Search App")
|
|
121 |
# 단계별 처리
|
122 |
if st.session_state.step == 'input':
|
123 |
st.session_state.query_image_url = st.text_input("Enter image URL:", st.session_state.query_image_url)
|
124 |
-
if st.button("Detect
|
125 |
if st.session_state.query_image_url:
|
126 |
query_image = load_image_from_url(st.session_state.query_image_url)
|
127 |
if query_image is not None:
|
@@ -172,7 +172,9 @@ elif st.session_state.step == 'show_results':
|
|
172 |
with col2:
|
173 |
st.write(f"Name: {img['info']['name']}")
|
174 |
st.write(f"Brand: {img['info']['brand']}")
|
175 |
-
|
|
|
|
|
176 |
st.write(f"Price: {img['info']['price']}")
|
177 |
st.write(f"Discount: {img['info']['discount']}%")
|
178 |
st.write(f"Similarity: {img['similarity']:.2f}")
|
@@ -198,7 +200,9 @@ else: # Text search
|
|
198 |
with col2:
|
199 |
st.write(f"Name: {img['info']['name']}")
|
200 |
st.write(f"Brand: {img['info']['brand']}")
|
201 |
-
|
|
|
|
|
202 |
st.write(f"Price: {img['info']['price']}")
|
203 |
st.write(f"Discount: {img['info']['discount']}%")
|
204 |
st.write(f"Similarity: {img['similarity']:.2f}")
|
|
|
121 |
# 단계별 처리
|
122 |
if st.session_state.step == 'input':
|
123 |
st.session_state.query_image_url = st.text_input("Enter image URL:", st.session_state.query_image_url)
|
124 |
+
if st.button("Detect accesseary"):
|
125 |
if st.session_state.query_image_url:
|
126 |
query_image = load_image_from_url(st.session_state.query_image_url)
|
127 |
if query_image is not None:
|
|
|
172 |
with col2:
|
173 |
st.write(f"Name: {img['info']['name']}")
|
174 |
st.write(f"Brand: {img['info']['brand']}")
|
175 |
+
category = img['info'].get('category')
|
176 |
+
if category:
|
177 |
+
st.write(f"Category: {category}")
|
178 |
st.write(f"Price: {img['info']['price']}")
|
179 |
st.write(f"Discount: {img['info']['discount']}%")
|
180 |
st.write(f"Similarity: {img['similarity']:.2f}")
|
|
|
200 |
with col2:
|
201 |
st.write(f"Name: {img['info']['name']}")
|
202 |
st.write(f"Brand: {img['info']['brand']}")
|
203 |
+
category = img['info'].get('category')
|
204 |
+
if category:
|
205 |
+
st.write(f"Category: {category}")
|
206 |
st.write(f"Price: {img['info']['price']}")
|
207 |
st.write(f"Discount: {img['info']['discount']}%")
|
208 |
st.write(f"Similarity: {img['similarity']:.2f}")
|