Spaces:
Sleeping
Sleeping
Upload 22 files
Browse files
app.py
CHANGED
|
@@ -2917,13 +2917,6 @@ def _resolve_outfit_grid_sources(
|
|
| 2917 |
bottom_selected: dict[str, Any] | None,
|
| 2918 |
other_selected: dict[str, Any] | None,
|
| 2919 |
) -> tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]], str, dict[str, Any] | None]:
|
| 2920 |
-
if occasion == "wedding":
|
| 2921 |
-
others_only = [
|
| 2922 |
-
i for i in wardrobe_items
|
| 2923 |
-
if i.get("type") == "others" or i.get("type") not in {"topwear", "bottomwear"}
|
| 2924 |
-
]
|
| 2925 |
-
wardrobe_items = _filter_garments_for_wedding(others_only)
|
| 2926 |
-
|
| 2927 |
all_tops = [i for i in wardrobe_items if i.get("type") == "topwear"]
|
| 2928 |
all_bottoms = [i for i in wardrobe_items if i.get("type") == "bottomwear"]
|
| 2929 |
all_others = [
|
|
@@ -3733,6 +3726,14 @@ def ai_recommend_outfits(payload: dict[str, Any] = Body(default_factory=dict)) -
|
|
| 3733 |
"engine_version": "scoring-v2",
|
| 3734 |
}
|
| 3735 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3736 |
top_selected = _normalize_wardrobe_item(top_selected_raw) if isinstance(top_selected_raw, dict) else None
|
| 3737 |
bottom_selected = _normalize_wardrobe_item(bottom_selected_raw) if isinstance(bottom_selected_raw, dict) else None
|
| 3738 |
other_selected = _normalize_wardrobe_item(other_selected_raw) if isinstance(other_selected_raw, dict) else None
|
|
|
|
| 2917 |
bottom_selected: dict[str, Any] | None,
|
| 2918 |
other_selected: dict[str, Any] | None,
|
| 2919 |
) -> tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]], str, dict[str, Any] | None]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2920 |
all_tops = [i for i in wardrobe_items if i.get("type") == "topwear"]
|
| 2921 |
all_bottoms = [i for i in wardrobe_items if i.get("type") == "bottomwear"]
|
| 2922 |
all_others = [
|
|
|
|
| 3726 |
"engine_version": "scoring-v2",
|
| 3727 |
}
|
| 3728 |
|
| 3729 |
+
if occasion == "wedding":
|
| 3730 |
+
others_only = [
|
| 3731 |
+
i for i in wardrobe_items
|
| 3732 |
+
if i.get("type") == "others" or i.get("type") not in {"topwear", "bottomwear"}
|
| 3733 |
+
]
|
| 3734 |
+
if others_only:
|
| 3735 |
+
wardrobe_items = _filter_garments_for_wedding(others_only)
|
| 3736 |
+
|
| 3737 |
top_selected = _normalize_wardrobe_item(top_selected_raw) if isinstance(top_selected_raw, dict) else None
|
| 3738 |
bottom_selected = _normalize_wardrobe_item(bottom_selected_raw) if isinstance(bottom_selected_raw, dict) else None
|
| 3739 |
other_selected = _normalize_wardrobe_item(other_selected_raw) if isinstance(other_selected_raw, dict) else None
|