Skip to content
ModelListedExternal
Download

Segface Hair Khairstyle

Personal Hugging Face model repository for a custom PyTorch hair-only segmentation checkpoint trained on a K-Hairstyle based AIHub subset.

KindOtherVersionRevision 782c268

Model source

Kind
Other
File size
398 MB
Version
vRevision 782c268
Updated
Sep 15, 2026
Downloads
13
Tasks
Image segmentation
Source
Hugging Face

Source description

segface_hair_khairstyle

Personal Hugging Face model repository for a custom PyTorch hair-only segmentation checkpoint trained on a K-Hairstyle based AIHub subset.

Model Summary

  • Backbone: swin_base
  • Input size: 512x512
  • Freeze backbone: True
  • LoRA: rank=8, alpha=16.0, dropout=0.05
  • Threshold used during validation: 0.5
  • Train / Val split used for this run: 50,000 / 5,000

Validation Metrics

Validation metrics are recorded during training. Additional hold-out test metrics are listed below when available.

MetricValue
Best epoch7
Val IoU0.9487
Val Dice0.9736
Val Precision0.9723
Val Recall0.9751
Epochs completed10
Avg epoch time (sec)3546.45

Hold-out Test Metrics

SplitIoUDicePrecisionRecall
Fine-tuned test0.93680.96740.96510.9697
Fine-tuned test_hard0.93930.96870.96630.9711
Baseline SegFace test0.13600.23940.13601.0000
Baseline SegFace test_hard0.18030.30550.18031.0000

Comparison Notes

  • Test IoU improved from 0.1360 to 0.9368 (+0.8008).
  • Test Dice improved from 0.2394 to 0.9674 (+0.7280).
  • Hard test IoU improved from 0.1803 to 0.9393 (+0.7590).
  • Hard test Dice improved from 0.3055 to 0.9687 (+0.6632).
  • The pretrained baseline tended to over-predict hair regions, showing high recall but very low precision.

Test Split Summary

  • train / val / test / test_hard: 50,000 / 5,000 / 921 / 150
  • source overlap train-test: 0
  • source overlap val-test: 0

Qualitative Comparison

Test

  • Selection: top-improved, previews: 12
  • Representative sample ad5c2098-485e-48d7-979b-6190bb01e7a2: baseline IoU 0.0481 -> fine-tuned IoU 0.9751 (+0.9270).

Test Qualitative Comparison

Test Hard

  • Selection: top-improved, previews: 4
  • Representative sample ccfa01f0-1b0a-4a39-a1c9-9d5c883f3fb2: baseline IoU 0.0707 -> fine-tuned IoU 0.9546 (+0.8839).

Test Hard Qualitative Comparison

Bundle Contents

  • best.pt: inference checkpoint
  • config.json: training-time model config
  • training_run_summary.json: run summary and validation metrics
  • reports/*.json: hold-out test and baseline comparison reports when available
  • reports/mask_comparison/**: baseline vs fine-tuned qualitative comparison sheets and sample previews when available
  • docs/test_split_summary.json: hold-out split summary when available
  • inference.py: local / Hub inference example
  • requirements.txt: minimal runtime dependencies
  • hair_mask_dataset/, models/: custom model code required to load the checkpoint

Inference

Run locally from the root of this model bundle:

python -m pip install -r requirements.txt
python inference.py --checkpoint best.pt --input path/to/input.jpg --output-mask output_mask.png --output-overlay output_overlay.png

You can also load directly from the Hugging Face Hub after uploading:

python -m pip install -r requirements.txt
python inference.py --repo-id siik/segface_hair_khairstyle --input path/to/input.jpg --output-mask output_mask.png --output-overlay output_overlay.png

Inputs and Outputs

  • Input: RGB portrait image file such as .jpg or .png
  • Output mask: single-channel binary hair mask PNG
  • Output overlay: optional RGB overlay image for quick visual inspection

Notes

  • This repo contains custom code and a raw PyTorch checkpoint, not a Transformers-format model.
  • Preprocessing expects RGB input, resize to 512, ImageNet normalization, and sigmoid threshold 0.5.
  • Before making the repository public, verify whether your AIHub / K-Hairstyle data usage terms allow public redistribution of derived model weights.

Training Artifacts

Training Curve

Preview

Sources

1 source
Hugging FacePrimaryVersion 782c268ba141f4427a85576b993395e64fc263b1
huggingface.co/siik/segface_hair_khairstyle/tree/782c268ba141f4427a85576b993395e64fc263b1

Verified Sep 15

Model artifacts

1 artifact

best.pt

pt · 398 MB · SHA-256 d6cb2cfb6fad…8fdb · Hugging Face

Download

Source excerpts

2 excerpts

--- library_name: pytorch pipeline_tag: image-segmentation tags: - pytorch - image-segmentation - hair-segmentation - segface - korean-hairstyle - custom-code language: - ko --- # segface_hair_khairstyle Personal Hugging Face model repository for a custom PyTorch hair-only segmentation checkpoint trained on a K-Hairstyle based AIHub subset. ## Model Summary - Backbone: `swin_base` - Input size: `512x512` - Freeze backbone: `True` - LoRA: `rank=8`, `alpha=16.0`, `dropout=0.05` - Threshold used during validation: `0.5` - Train / Val split used for this run: `50,000` / `5,000` ## Validation Metrics Validation metrics are recorded during training. Additional hold-out test metrics are listed below when available. | Metric | Value | | --- | ---: | | Best epoch | 7 | | Val IoU | 0.9487 | | Val Dice | 0.9736 | | Val Precision | 0.9723 | | Val Recall | 0.9751 | | Epochs completed | 10 | | Avg epoch time (sec) | 3546.45 | ## Hold-out Test Metrics | Split | IoU | Dice | Precision | Recall | | --- | ---: | ---: | ---: | ---: | | Fine-tuned test | 0.9368 | 0.9674 | 0.9651 | 0.9697 | | Fine-tuned test_hard | 0.9393 | 0.9687 | 0.9663 | 0.9711 | | Baseline SegFace test | 0.1360 | 0.2394 | 0.1360 | 1.0000 | | Baseline SegFace test_hard | 0.1803 | 0.3055 | 0.1803 | 1.0000 | ## Comparison Notes - Test IoU improved from `0.1360` to `0.9368` (`+0.8008`). - Test Dice improved from `0.2394` to `0.9674` (`+0.7280`). - Hard test IoU improved from `0.1803` to `0.9393` (`+0.7590`). - Hard test Dice improved from `0.3055` to `0.9687` (`+0.6632`). - The pretrained baseline tended to over-predict hair regions, showing high recall but very low precision. ## Test Split Summary - train / val / test / test_hard: `50,000` / `5,000` / `921` / `150` - source overlap train-test: `0` - source overlap val-test: `0` ## Qualitative Comparison ### Test - Selection: `top-improved`, previews: `12` - Representative sample `ad5c2098-485e-48d7-979b-6190bb01e7a2`: baseline IoU `0.0481` -> fine-tuned IoU `0.9751` (`+0.9270`). ![Test Qualitative Comparison](reports/mask_comparison/test/contact_sheet.png) ### Test Hard - Selection: `top-improved`, previews: `4` - Representative sample `ccfa01f0-1b0a-4a39-a1c9-9d5c883f3fb2`: baseline IoU `0.0707` -> fine-tuned IoU `0.9546` (`+0.8839`). ![Test Hard Qualitative Comparison](reports/mask_comparison/test_hard/contact_sheet.png) ## Bundle Con...

Source context: 13 downloads · 0 likes · Pipeline image-segmentation · Library pytorch · Repo siik/segface_hair_khairstyle