Not-Adam commited on
Commit
a22c9a9
1 Parent(s): 31ca29b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -171,12 +171,12 @@ def get_predicted_attributes(image_urls, category):
171
 
172
  # If attribute is details, then remove the obtained label from the values, and get the next most common
173
  if attribute == "details":
174
- print(values_formatted, result[0].strip() + f", clothing: {category}")
175
- values_formatted.remove(result[0].strip() + f", clothing: {category}")
176
  responses = pipe(image_urls, candidate_labels=values_formatted)
177
  i = 0
178
  print("Responses: ", responses)
179
- while len(responses) > 0 and responses[0][0]['score'] > 0.8 and i < 2:
180
  result = [response[0]['label'].split(", clothing:")[0] for response in responses]
181
  common_result.append(Counter(result).most_common(1))
182
 
 
171
 
172
  # If attribute is details, then remove the obtained label from the values, and get the next most common
173
  if attribute == "details":
174
+ print(values_formatted, result[0] + f", clothing: {category}")
175
+ values_formatted.remove(result[0] + f", clothing: {category}")
176
  responses = pipe(image_urls, candidate_labels=values_formatted)
177
  i = 0
178
  print("Responses: ", responses)
179
+ while len(responses) > 0 and responses[0][0]['score'] > 0.6 and i < 2:
180
  result = [response[0]['label'].split(", clothing:")[0] for response in responses]
181
  common_result.append(Counter(result).most_common(1))
182