dejanseo commited on
Commit
e2c8383
·
verified ·
1 Parent(s): 5b5988d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -65,6 +65,13 @@ def main():
65
  input_shape = input_details[0]['shape']
66
  input_size = input_shape[1] # assuming square input
67
 
 
 
 
 
 
 
 
68
  for img_url in img_urls:
69
  try:
70
  response = requests.get(img_url)
@@ -81,10 +88,9 @@ def main():
81
  st.image(image.resize((224, 224)), width=224)
82
  with col2:
83
  st.write(f"[URL]({img_url})")
84
- st.write(f"Intent 1: {formatted_percentages[0]}")
85
- st.write(f"Intent 2: {formatted_percentages[1]}")
86
- st.write(f"Intent 3: {formatted_percentages[2]}")
87
- st.write(f"Intent 4: {formatted_percentages[3]}")
88
  st.write("---")
89
  except Exception as e:
90
  st.write(f"Could not process image {img_url}: {e}")
 
65
  input_shape = input_details[0]['shape']
66
  input_size = input_shape[1] # assuming square input
67
 
68
+ categories = [
69
+ "No Shopping Intent",
70
+ "Fashion & Style",
71
+ "Home & Garden",
72
+ "Tools, Vehicles, Electronics & Appliances"
73
+ ]
74
+
75
  for img_url in img_urls:
76
  try:
77
  response = requests.get(img_url)
 
88
  st.image(image.resize((224, 224)), width=224)
89
  with col2:
90
  st.write(f"[URL]({img_url})")
91
+ for category, percentage in zip(categories, shopping_intent_percentages):
92
+ st.write(f"{category}: {percentage:.2f} %")
93
+ st.progress(int(percentage))
 
94
  st.write("---")
95
  except Exception as e:
96
  st.write(f"Could not process image {img_url}: {e}")