Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
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(
|
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)
|