Update app.py
Browse files
app.py
CHANGED
|
@@ -197,7 +197,7 @@ def faiss_filtered_search(query_emb, top_k=3, exclude_idx=None, gender=None, age
|
|
| 197 |
if idx == -1 or (exclude_idx is not None and idx == exclude_idx):
|
| 198 |
continue
|
| 199 |
row = df.iloc[idx]
|
| 200 |
-
#
|
| 201 |
if require_gender and gender and str(row["gender"]).lower() != str(gender).lower():
|
| 202 |
continue
|
| 203 |
if require_age and age_group and str(row["age_group"]).lower() != str(age_group).lower():
|
|
@@ -260,7 +260,7 @@ def generate_new_outfit_image(pil_image, row, target_gender=None):
|
|
| 260 |
resized_face_crop = base.resize((head_w, head_h))
|
| 261 |
resized_protect_img = Image.fromarray(protect.astype(np.uint8) * 255).resize((head_w, head_h), resample=Image.NEAREST)
|
| 262 |
|
| 263 |
-
#
|
| 264 |
paste_x = (canvas_w - head_w) // 2
|
| 265 |
paste_y = int(canvas_h * 0.03)
|
| 266 |
|
|
@@ -398,7 +398,7 @@ def build_features_recap_html(skin_tone, undertone, style):
|
|
| 398 |
return f'<div style="background:#fff;border-radius:16px;padding:24px;margin-bottom:20px;border:1px solid #ECE4D6;"><div style="font-size:12px;font-weight:700;color:#D2527F;text-transform:uppercase;letter-spacing:.1em;margin-bottom:16px;">Your Selected Specifications</div>{build_feature_pills_html(SKIN_TONES, skin_tone, "Skin tone")}{build_feature_pills_html(UNDERTONES, undertone, "Undertone")}{build_feature_pills_html(STYLES, style, "Style")}</div>'
|
| 399 |
|
| 400 |
# ---------------------------------------------------------------------------
|
| 401 |
-
#
|
| 402 |
# ---------------------------------------------------------------------------
|
| 403 |
CUSTOM_CSS = """
|
| 404 |
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght=600;700&family=Inter:wght=400;500;600;700&display=swap');
|
|
|
|
| 197 |
if idx == -1 or (exclude_idx is not None and idx == exclude_idx):
|
| 198 |
continue
|
| 199 |
row = df.iloc[idx]
|
| 200 |
+
# תיקון השגיאה: החלפת ה-&& ב-and פייתון תקני לחלוטין
|
| 201 |
if require_gender and gender and str(row["gender"]).lower() != str(gender).lower():
|
| 202 |
continue
|
| 203 |
if require_age and age_group and str(row["age_group"]).lower() != str(age_group).lower():
|
|
|
|
| 260 |
resized_face_crop = base.resize((head_w, head_h))
|
| 261 |
resized_protect_img = Image.fromarray(protect.astype(np.uint8) * 255).resize((head_w, head_h), resample=Image.NEAREST)
|
| 262 |
|
| 263 |
+
# תיקון סדר שורות: המיקומים paste_x ו-paste_y מוגדרים כאן לפני השימוש בהם
|
| 264 |
paste_x = (canvas_w - head_w) // 2
|
| 265 |
paste_y = int(canvas_h * 0.03)
|
| 266 |
|
|
|
|
| 398 |
return f'<div style="background:#fff;border-radius:16px;padding:24px;margin-bottom:20px;border:1px solid #ECE4D6;"><div style="font-size:12px;font-weight:700;color:#D2527F;text-transform:uppercase;letter-spacing:.1em;margin-bottom:16px;">Your Selected Specifications</div>{build_feature_pills_html(SKIN_TONES, skin_tone, "Skin tone")}{build_feature_pills_html(UNDERTONES, undertone, "Undertone")}{build_feature_pills_html(STYLES, style, "Style")}</div>'
|
| 399 |
|
| 400 |
# ---------------------------------------------------------------------------
|
| 401 |
+
# FIXED GRADIO 6 COMPLIANT LUXURY THEME
|
| 402 |
# ---------------------------------------------------------------------------
|
| 403 |
CUSTOM_CSS = """
|
| 404 |
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght=600;700&family=Inter:wght=400;500;600;700&display=swap');
|