Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -67,47 +67,51 @@ except Exception as e:
|
|
| 67 |
|
| 68 |
style_prompts = {
|
| 69 |
'drippy': [
|
| 70 |
-
"
|
| 71 |
-
"
|
| 72 |
-
"
|
| 73 |
-
"
|
| 74 |
-
"
|
| 75 |
-
"
|
| 76 |
-
"
|
| 77 |
-
"
|
| 78 |
-
"runway-ready monochrome look",
|
| 79 |
-
"statement outerwear with luxury detailing",
|
| 80 |
-
"elevated business casual with premium materials",
|
| 81 |
-
"fashion-forward layering with color coordination",
|
| 82 |
-
"comfortable yet stylish look"
|
| 83 |
],
|
| 84 |
'mid': [
|
| 85 |
-
"
|
| 86 |
-
"
|
| 87 |
-
"
|
| 88 |
-
"
|
| 89 |
-
"
|
| 90 |
-
"
|
| 91 |
-
"
|
| 92 |
-
"
|
| 93 |
-
"mid-range branded streetwear",
|
| 94 |
-
"plain bomber jacket and fitted pants"
|
| 95 |
],
|
| 96 |
'not_drippy': [
|
| 97 |
-
"
|
| 98 |
-
"
|
| 99 |
-
"
|
| 100 |
-
"
|
| 101 |
-
"
|
| 102 |
-
"
|
| 103 |
-
"
|
| 104 |
-
"
|
| 105 |
-
"stained or ill-fitting garments",
|
| 106 |
-
"childish graphic tee with athletic shorts",
|
| 107 |
-
"pajama bottoms worn outside",
|
| 108 |
-
"shoes completely unrelated to outfit"
|
| 109 |
]
|
| 110 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
|
| 113 |
clothing_prompts = [
|
|
@@ -297,7 +301,7 @@ def analyze_outfit(input_img):
|
|
| 297 |
|
| 298 |
# Determine overall style category AND DEFINE score_label
|
| 299 |
score_label = "Style Score" # Initialize with a default/fallback
|
| 300 |
-
if drip_score > 0.
|
| 301 |
category_key = 'drippy'
|
| 302 |
final_score = drip_score
|
| 303 |
score_label = "Drip Score"
|
|
@@ -313,7 +317,23 @@ def analyze_outfit(input_img):
|
|
| 313 |
category_label = CATEGORY_LABEL_MAP[category_key]
|
| 314 |
|
| 315 |
percentage_score = max(0, final_score * 100)
|
| 316 |
-
percentage_score_str = f"{percentage_score:.0f}%"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
|
| 318 |
|
| 319 |
print(f"Style analysis: Category={category_label}, Score = {score_label}={percentage_score_str} (Raw Score: {final_score:.4f})")
|
|
|
|
| 67 |
|
| 68 |
style_prompts = {
|
| 69 |
'drippy': [
|
| 70 |
+
"High-fashion runway look with designer labels",
|
| 71 |
+
"Coordinated color palette with premium fabrics",
|
| 72 |
+
"Trend-forward streetwear with luxury accessories",
|
| 73 |
+
"Tailored silhouettes with intentional layering",
|
| 74 |
+
"Seasonal trend elements executed flawlessly",
|
| 75 |
+
"Cohesive outfit with statement pieces",
|
| 76 |
+
"Celebrity red carpet-level styling",
|
| 77 |
+
"Bold pattern mixing that works harmoniously"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
],
|
| 79 |
'mid': [
|
| 80 |
+
"Basic wardrobe staples without flair",
|
| 81 |
+
"Safe color combinations with minimal accessories",
|
| 82 |
+
"Mass-market fast fashion pieces",
|
| 83 |
+
"Functional over fashionable aesthetic",
|
| 84 |
+
"Trend-adjacent but poorly executed",
|
| 85 |
+
"Mismatched proportions in clothing",
|
| 86 |
+
"Overly casual for the occasion",
|
| 87 |
+
"Decade-outdated trend revival"
|
|
|
|
|
|
|
| 88 |
],
|
| 89 |
'not_drippy': [
|
| 90 |
+
"Severely mismatched color schemes",
|
| 91 |
+
"Pilled/stained/faded clothing items",
|
| 92 |
+
"Ill-fitting garments in multiple pieces",
|
| 93 |
+
"Clashing patterns without cohesion",
|
| 94 |
+
"Inappropriate footwear for outfit context",
|
| 95 |
+
"Overly literal costume-like styling",
|
| 96 |
+
"Multiple competing trends in one outfit",
|
| 97 |
+
"Wrinkled/unkempt fabric presentation"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
]
|
| 99 |
}
|
| 100 |
+
style_prompts['drippy'] += [
|
| 101 |
+
"coordinated color scheme",
|
| 102 |
+
"perfect garment proportions",
|
| 103 |
+
"current fashion trends",
|
| 104 |
+
"high-quality materials",
|
| 105 |
+
"complementary accessories"
|
| 106 |
+
]
|
| 107 |
+
|
| 108 |
+
style_prompts['not_drippy'] += [
|
| 109 |
+
"clashing colors",
|
| 110 |
+
"poor fit proportions",
|
| 111 |
+
"outdated trends",
|
| 112 |
+
"cheap-looking fabrics",
|
| 113 |
+
"missing accessories"
|
| 114 |
+
]
|
| 115 |
|
| 116 |
|
| 117 |
clothing_prompts = [
|
|
|
|
| 301 |
|
| 302 |
# Determine overall style category AND DEFINE score_label
|
| 303 |
score_label = "Style Score" # Initialize with a default/fallback
|
| 304 |
+
"""if drip_score > 0.35 and drip_score > mid_score and drip_score > not_score:
|
| 305 |
category_key = 'drippy'
|
| 306 |
final_score = drip_score
|
| 307 |
score_label = "Drip Score"
|
|
|
|
| 317 |
category_label = CATEGORY_LABEL_MAP[category_key]
|
| 318 |
|
| 319 |
percentage_score = max(0, final_score * 100)
|
| 320 |
+
percentage_score_str = f"{percentage_score:.0f}%""""
|
| 321 |
+
|
| 322 |
+
final_score = max(drip_score, mid_score, not_score)
|
| 323 |
+
percentage_score = final_score * 100
|
| 324 |
+
|
| 325 |
+
if percentage_score >= 75:
|
| 326 |
+
category_key = 'drippy'
|
| 327 |
+
score_label = "Drip Score"
|
| 328 |
+
elif percentage_score >= 40:
|
| 329 |
+
category_key = 'mid'
|
| 330 |
+
score_label = "Mid Score"
|
| 331 |
+
else:
|
| 332 |
+
category_key = 'not_drippy'
|
| 333 |
+
score_label = "Trash Score"
|
| 334 |
+
|
| 335 |
+
category_label = CATEGORY_LABEL_MAP[category_key]
|
| 336 |
+
percentage_score_str = f"{percentage_score:.0f}%"
|
| 337 |
|
| 338 |
|
| 339 |
print(f"Style analysis: Category={category_label}, Score = {score_label}={percentage_score_str} (Raw Score: {final_score:.4f})")
|