Downloads · 30 days
8
4% of all-time downloads
Ekliipce/wearit-garment-mask
wearit-garment-mask is a image segmentation model from Ekliipce. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
WearIT Garment Mask is a specialized image segmentation pipeline for generating precise garment masks suitable for virtual try-on and image inpainting applications. The model combines three state-of-the-art computer v…
Downloads · 30 days
8
4% of all-time downloads
All-time downloads
190
Public
Repo size
791 MB
Likes
0
Public
Click a slice to open those files.
.pth535 MB · 67%
From the Hugging Face model README
WearIT Garment Mask is a specialized image segmentation pipeline for generating precise garment masks suitable for virtual try-on and image inpainting applications. The model combines three state-of-the-art computer vision models to create intelligent, variable-shaped masks around garments while protecting sensitive body areas (face, hands, feet).
The pipeline orchestrates three deep learning models:
The models work in synergy to detect body parts and garment regions, then generate precise masks using morphological operations and geometric transformations.
pip install transformers torch torchvision opencv-python Pillow numpy
from transformers import pipeline
# Load the pipeline
pipe = pipeline(
"image-segmentation",
model="your-username/wearit-garment-mask",
trust_remote_code=True,
device="cuda:0" # or "cpu"
)
# Generate masks for a single image
results = pipe(
"person.jpg",
garment_types="upper" # or ["upper", "lower", "dress"]
)
# Access the results
for result in results:
image_id = result["image_id"]
standardized_image = result["image_standardized"]
# Get mask for upper garment
upper_mask = result["masks"]["upper"]["person_mask"]
upper_mask.save(f"{image_id}_upper_mask.png")
# Process multiple images with different garment types
results = pipe(
["person1.jpg", "person2.jpg"],
garment_types=["upper", "lower"], # Generate both types for each image
image_ids=["img_001", "img_002"], # Custom IDs for deterministic seeds
output_dir="./output" # Save intermediate results
)
# Custom configuration
from pipeline import GarmentMaskPipeline
custom_pipe = GarmentMaskPipeline(
device="cuda:0",
output_height=1024,
process_size=512,
use_convex_hull=True,
allowed_strategies=["ellipse", "box"], # Restrict mask strategies
save_images=True
)
results = custom_pipe("person.jpg", garment_types="dress")
Each result dictionary contains:
{
"image_id": "unique_identifier",
"image_standardized": PIL.Image, # Processed RGB image (1024x768)
"masks": {
"upper": {
"person_mask": PIL.Image # Binary mask (mode 'L')
},
"lower": {
"person_mask": PIL.Image
}
}
}
The pipeline uses three randomized strategies (deterministic per image_id):
The expansion ratio adapts based on garment size relative to person area.
This is an inference-only pipeline combining pre-trained models:
No additional training was performed for this pipeline.
The pipeline has been evaluated on:
Specific metrics for the combined pipeline:
If you use this model in your research, please cite:
@misc{wearit-garment-mask-2025,
title={WearIT Garment Mask Generation Pipeline},
author={Your Name/Organization},
year={2025},
howpublished={\url{https://huggingface.co/your-username/wearit-garment-mask}}
}
Required checkpoints (to be placed in chkpt/ directory):
model_final_162be9.pkl + config filesexp-schp-201908301523-atr.pthexp-schp-201908261155-lip.pthDownload links:
This pipeline is released under the Apache 2.0 License.
Individual model licenses:
For questions, issues, or contributions:
This work builds upon:
Special thanks to the open-source computer vision community.