Practical overview
When it fits
Use it when you need model code and a documented training path for hair masks, especially when the target integration is an iOS app using Core ML.
Who it is for
- Mobile developers adding hair-region segmentation to face-image applications.
- Machine-learning practitioners training segmentation models with labeled face images and masks.
Documented uses
- Train a hair-segmentation model using LFW face images and masks.
- Convert a trained PyTorch model into Core ML for use in an iOS app.
- Use a predicted hair mask as a basis for a hair-color preview.
Requirements & limits
The repository is public and specifies the MIT license.
- The example model uses a MobileNetV2-inspired U-Net architecture.
- Training instructions specify Python 3.8, LFW images and masks, and a provided training configuration.
- The repository reports 0.89 IoU for its 224-pixel pretrained model.
- The Core ML conversion path is documented; TensorFlow Lite conversion for Android is listed as unfinished.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train a hair-segmentation model
Train the provided model using LFW face images and corresponding masks.
Before you start
- Python 3.8
- Dependencies installed with the documented pip command and PyTorch wheel index
- LFW face images and their masks arranged in the documented folder structure
Steps
Place face images under data/lfw/raw/images and matching masks under data/lfw/raw/masks.
From the src directory, run python run_train.py params/002.yaml.
Expected outcome
The project training script is configured to train the model; for 224-pixel input, pretrained MobileNetV2 weights are automatically downloaded.
Guide limitations
- The README refers users to issue #11 for obtaining mask images.
- The reported 0.89 IoU applies to the listed pretrained 224-pixel model and is not a result guarantee for a newly trained model.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 7 November 2026
- Original website title
- akirasosa/mobile-semantic-segmentation · Official homepage title · retained in its source language

