JoJosmin commited on
Commit
bc1a95b
1 Parent(s): ae97abf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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 acsseary"):
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
- st.write(f"Category: {img['info']['category']}")
 
 
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
- st.write(f"Category: {img['info']['category']}")
 
 
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}")