How switchablenorms/celebamask-hq works
Project type and purpose
• This repository is an open-source, research-oriented ML toolkit built around the CelebAMask-HQ dataset. It contains two sub-projects:
a. MaskGAN_demo – an interactive facial image manipulation demo using a GAN (pix2pixHD-based).
b. face_parsing – a U-Net-based face segmentation pipeline with data preprocessing, training, and testing scripts.
• The root README describes the CelebAMask-HQ dataset (30k high-res face images + 19-class masks), and points to demo capabilities and downstream tasks (face parsing, generation, editing).
File structure
• Top-level directories:
• MaskGAN_demo/
– data/ (dataset abstractions, loaders)
– models/ (base_model, network definitions, pix2pixHD_model)
– options/ (CLI config for train/test)
– ui/ & ui_util/ (interactive GUI event handling, config)
– demo.py (entrypoint for interactive demo)
• face_parsing/
– Data_preprocessing/ (mask generation, partitioning scripts)
– model_utils.py, unet.py (model code)
– trainer.py, tester.py, main.py (training & test orchestration)
– data_loader.py (custom loader)
– run.sh, run_test.sh (bash wrappers)
– README.md (dataset and demo overview)
– images/ (sample visuals)
• Patterns:
• Modular separation by concern (data, models, options, UI).
• Inheritance and factory patterns in data loaders (base_data_loader → custom_dataset_data_loader) and models (base_model → pix2pixHD_model).
• CLI option classes (base_options, train_options, test_options).
README for additional insights
• The focus is on non-commercial research use.
• The demo showcases an interactive face editing UI.
• It invites use of the dataset in face parsing, recognition, and GAN-based editing.