Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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]
|
175 |
-
values_formatted.remove(result[0]
|
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.
|
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 |
|