Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -332,7 +332,7 @@ def analyze_outfit(input_img):
|
|
| 332 |
# - Mid is worth 2/3 points (~66%)
|
| 333 |
# - Trash is worth 1/3 points (~33%)
|
| 334 |
|
| 335 |
-
final_score = (drip_score * 1.0) + (mid_score * 0.
|
| 336 |
|
| 337 |
# Now map it to a 0–100 scale
|
| 338 |
final_score = final_score * 100
|
|
@@ -341,10 +341,10 @@ def analyze_outfit(input_img):
|
|
| 341 |
final_score = min(max(final_score, 0), 100)
|
| 342 |
|
| 343 |
# Now classify the category based on the final_score
|
| 344 |
-
if final_score >=
|
| 345 |
category_key = 'drippy'
|
| 346 |
score_label = "Drip Score"
|
| 347 |
-
elif final_score >=
|
| 348 |
category_key = 'mid'
|
| 349 |
score_label = "Mid Score"
|
| 350 |
else:
|
|
@@ -422,7 +422,7 @@ def analyze_outfit(input_img):
|
|
| 422 |
category_html = f"""
|
| 423 |
<div class='results-container'>
|
| 424 |
<h2 class='result-category'>RATING: {category_label.upper()}</h2>
|
| 425 |
-
<p class='result-score'>Overall Fit Rating: {percentage_score_str}/100</p>
|
| 426 |
<p class='result-confidence'>Detected Item: {final_clothing_item.title()}</p>
|
| 427 |
</div>
|
| 428 |
"""
|
|
|
|
| 332 |
# - Mid is worth 2/3 points (~66%)
|
| 333 |
# - Trash is worth 1/3 points (~33%)
|
| 334 |
|
| 335 |
+
final_score = (drip_score * 1.0) + (mid_score * 0.90) + (not_score * 0.5)
|
| 336 |
|
| 337 |
# Now map it to a 0–100 scale
|
| 338 |
final_score = final_score * 100
|
|
|
|
| 341 |
final_score = min(max(final_score, 0), 100)
|
| 342 |
|
| 343 |
# Now classify the category based on the final_score
|
| 344 |
+
if final_score >= 70:
|
| 345 |
category_key = 'drippy'
|
| 346 |
score_label = "Drip Score"
|
| 347 |
+
elif final_score >= 35:
|
| 348 |
category_key = 'mid'
|
| 349 |
score_label = "Mid Score"
|
| 350 |
else:
|
|
|
|
| 422 |
category_html = f"""
|
| 423 |
<div class='results-container'>
|
| 424 |
<h2 class='result-category'>RATING: {category_label.upper()}</h2>
|
| 425 |
+
<p class='result-score'>Overall Fit Rating: {percentage_score_str}/100%</p>
|
| 426 |
<p class='result-confidence'>Detected Item: {final_clothing_item.title()}</p>
|
| 427 |
</div>
|
| 428 |
"""
|