Spaces:
Running
Running
Commit History
-
Revert this session's changes back to the last known-good version Running
Restores the tree to 4b38f72 exactly. The reported result was worse than the version that was already working, across the swap output, the head swap and the app generally, so the right move is to put the working version back rather than keep patching on top of it. Reverts, newest first: f008eb7 head-swap pose gate + warnings in the UI 0ab4ea6 seam blend against base instead of target b1cd367 workflow PDF + binary .gitattributes rules f25d3bf glasses transfer made opt-in 74dd70d hair matte fix + removal of the crude hair fallback b60d8aa background jobs + Head Swap toggle ddb0022 head-only super-resolution 27e2136 composite onto the full-resolution original 9e549b6 grain confined to the parsed head bb3e953 Control Panel sign-in inside the Hugging Face iframe e522792 Flask debug off by default + threaded pre-warm 27bac33 scene-harmonisation regressions Nothing is lost: each of the above is still in history and can be cherry-picked back individually o…f4e824d -
Add a workflow PDF, and stop git rewriting line endings inside binaries
docs/WORKFLOW.pdf documents how the project actually works: architecture, the submit-and-poll request flow, every pipeline stage with its measured CPU cost, the deploy path from a push to a running Space, and the behaviour that is easy to misread from the code (why hair and glasses are opt-in, why quality is scored before the harmonise stage, CPU vs GPU differences). It is generated by scripts/make_workflow_pdf.py rather than drawn by hand, so it can be regenerated when the pipeline changes instead of quietly going stale. Boxes size themselves from their content — a hand-tuned height had already let one section overflow its border. .gitattributes gained binary rules for pdf/png/jpg/onnx/pth. Adding the PDF made git announce "LF will be replaced by CRLF" for it, which would have corrupted the file; the existing image assets were unprotected in the same way. Verified the committed blob is byte-identical to the generated file.b1cd367
-
Add batch QA test harness (scripts/batch_test.py)
Swaps N source faces x gender x location on GPU, saves results + a contact-sheet grid per location + a metrics CSV (blend/delta_e/naturalness). Face-only by default (~7-9s/swap, full 3800 matrix ~7-8h overnight); --hair adds HairFastGAN (slow, for small samples). Drop diverse faces in tests/faces/<gender>/. Verified: 1 swap in 8.9s on the RTX 4060.8a16253
-
Only migrate locations that have a photo; resequence 1..N + remove stale rows
- supabase_schema.sql: drop the static seed (Male/Female photo sets differ); rows now come from the migration based on actual uploaded photos - seed_supabase_locations.py: upload only folders containing a photo, resequence sort_order 1..N per gender (no gaps), and delete leftover/empty rows so the app shows only real locationsef20961 -
Add Supabase migration script + explicit sort_order; gitignore Location images
- scripts/seed_supabase_locations.py: one-time upload of local Location photos to Supabase (Storage + table), preserving folder number as sort_order and using the clean label (no number) as the display name - supabase_store.upsert_location: optional sort_order param to preserve order - .gitignore: Location target images live in Supabase, kept out of git (folder structure preserved via .gitkeep)8668f1e
-
feat: local GPU HairFastGAN hair transfer (auto-selects local, else HF Space)
Validated end-to-end on an RTX 4060 (8GB): full app pipeline swap -> GFPGAN -> skin/neck tone -> HairFastGAN hair -> paste-back -> 4K, no OOM, ~18s warm. - hair_transfer.py: prefer the local GPU HairFastGAN (vendored under external/, run via its MSVC-env launcher subprocess); fall back to the hosted Space when unavailable. Self-heals by copying the committed runner scripts into the repo. HAIRFAST_LOCAL=0 forces the Space. - scripts/hairfast/run_hairfast.{py,bat}: GPU runner (faulthandler + batch_size=1 to co-exist with the Flask models) and a portable MSVC-env launcher that finds Visual Studio via vswhere. - scripts/setup_hairfast.py: reproducible installer — clones the repo + ~7GB weights (git-lfs), patches the StyleGAN2/inplace_abn CUDA ops for torch 2.x (AT_CHECK->TORCH_CHECK, .data<>-> .data_ptr<>), links weights into place, and installs the runners. external/ stays gitignored. - README: local HairFast setup + HF Space fallback (HF_TOKEN / HAIRFAST_SPACE). The hea…500d3c3
-
fix: GFPGAN face restoration removes swap blur; simplify pipeline; GPU 4K
The blur and hair mismatch came from two things: (1) gfpgan/realesrgan never actually ran — basicsr imports torchvision.transforms.functional_tensor, removed in torchvision 0.17+, so super-res silently fell back to Lanczos (which enlarges but cannot recreate lost facial detail); (2) the heavy post-swap stack (seamless_hair_to_neck_blend + laplacian + poisson + bilateral) smeared the hairline and softened the face. - super_res.py: shim torchvision.transforms.functional_tensor so basicsr/gfpgan/ realesrgan import on modern torchvision. Split into restore_faces() (GFPGAN, same-res detail restoration) and upscale_image() (RealESRGAN x4, Lanczos fallback). GPU-aware (cuda/fp16 when available). Fix UnicodeEncodeError — the arrow char crashed on Windows cp1252 stdout. - web_app.py: new swap path is InsightFace -> GFPGAN restore -> RealESRGAN 4K. GFPGAN runs BEFORE the preview is encoded so the on-screen image is sharp, not just the download. Dropped hair-neck blend / laplacian / …ce89434 -
fix: sharp output, source skin tone preservation, 4K upscaling pipeline
- swapper.py: sharpen ORIGINAL crop (not bilateral-blurred) — unsharp mask strength 2.3x on raw crop; mild bilateral d=5/30 only removes compression artefacts without killing texture detail - skin_tone.py: match_skin_tone now accepts face_mask; LAB transfer confined to face region via feathered alpha — hair/neck/background no longer shifted - core/super_res.py (NEW): GFPGAN face restoration + RealESRGAN x4 upscale; Lanczos fallback when models absent — always delivers 4K download - web_app.py: complete pipeline — add match_skin_tone (source tone, face mask), laplacian_blend + poisson_blend, 4K hi-res PNG saved for download, preview JPEG at 92 quality; input cap raised 1024→2048 for more InsightFace detail - quality_checker.py: _alignment_score handles None/empty arrays — returns 50.0 instead of propagating nan (was showing 0.0/100 in UI) - full_pipeline.py: enable_super_res=True by default; pass face_mask to match_skin_tone; Lanczos fallback on super_res failure; remove…f1b722f
-
Initial commit: DeepFace Studio - AI face swap web application
Features: - React + Vite frontend with Firebase Google authentication - 10-day session persistence - Flask backend with face swap pipeline - InsightFace inswapper deep swap model - Hair-to-neck seamless blending - Skin tone matching (CIE LAB) - Laplacian + Poisson blending - Live camera capture + image upload - Quality metrics dashboard - Responsive UI with olive/green color palette - GPU + CPU support (auto-detected)e7a5a81