Not-Adam commited on
Commit
6642b6b
1 Parent(s): 6f8ccb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -171,7 +171,7 @@ def get_predicted_attributes(image_urls, category):
171
  values = [f"{attribute}: {value.strip()}, clothing: {category}" for value in values]
172
 
173
  # Get the predicted values for the attribute
174
- responses = pipe(image_urls, candidate_labels=values, device=device)
175
  most_common, score = get_most_common_label(responses)
176
  common_result.append(most_common)
177
 
@@ -179,7 +179,7 @@ def get_predicted_attributes(image_urls, category):
179
  # Process additional details labels if the score is higher than 0.8
180
  for _ in range(2):
181
  values = [value for value in values if value != f"{most_common}, clothing: {category}"]
182
- responses = pipe(product['Images'].values[0], candidate_labels=values, device=device)
183
  most_common, score = get_most_common_label(responses)
184
  if score > 0.8:
185
  common_result.append(most_common)
 
171
  values = [f"{attribute}: {value.strip()}, clothing: {category}" for value in values]
172
 
173
  # Get the predicted values for the attribute
174
+ responses = pipe(image_urls, candidate_labels=values)
175
  most_common, score = get_most_common_label(responses)
176
  common_result.append(most_common)
177
 
 
179
  # Process additional details labels if the score is higher than 0.8
180
  for _ in range(2):
181
  values = [value for value in values if value != f"{most_common}, clothing: {category}"]
182
+ responses = pipe(image_urls, candidate_labels=values)
183
  most_common, score = get_most_common_label(responses)
184
  if score > 0.8:
185
  common_result.append(most_common)