Spaces:
Sleeping
Sleeping
Commit History
-
Fix core swap: auto-download InsightFace buffalo_l + glasses in both pathsβ
Root cause of "model not working / no head swap / no glasses / alignment 50": InsightFace buffalo_l was never downloaded β detector only CHECKED for it and returned None when missing, silently falling back to a crude Haar-cascade paste (no real swap, no head transplant, no parser-based hair/glasses/skin matching). core/detector.py - _get_insightface now lets FaceAnalysis auto-download buffalo_l on first use instead of short-circuiting to None. This makes the real inswapper, head swap, BiSeNet hair/glasses transfer, and skin-tone matching actually run. web_app.py - Transfer the source's glasses in BOTH paths (head-swap parser sometimes misses thin frames); wrapped in try/except, no-op if no glasses. frontend/src/pages/AppPage.jsx - Results show only the final output (removed Your Photo + Location preview panels and the technical metrics); nicer heading + "Your Campus Look" framing - Location step no longer previews the backend image β just a clean confirmation frontend/src/pβ¦6ce5ccf -
Add 2 missing Male locations (Library G Floor, Ground) β both genders now 19
dbe6ce9 -
New flow: user picks gender + location instead of uploading targetβ
The user now only provides: name, gender, source photo, and a location. The target photo is supplied by us from Location/<gender>/<location>/. Backend (web_app.py) - Add /api/locations?gender=Male|Female β lists location folders (label + has_image flag), sorted by numeric prefix - Add /api/location-image?gender=&location= β serves the curated target image for the picker preview and result panel - /api/swap now resolves the target from gender+location (direct target upload kept as an admin override); also accepts and echoes back the user's name - Path-traversal guard on location names; gender restricted to Male/Female Frontend (AppPage.jsx) - Step 1: Name + Gender. Step 2: your photo (upload/camera). Step 3: location dropdown (fetched per gender) with live preview - Removed the target upload/camera panel entirely - Locations with no image yet show "(coming soon)" and are disabled - Result panel shows name, your photo, chosen location, and the swap Location/ - Add .gitkeep to β¦e2d08c4