Image Segmentation
Transformers
PyTorch
English
garment-mask-generation
image-inpainting
fashion
garment-mask
densepose
human-parsing
Instructions to use Ekliipce/wearit-garment-mask with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ekliipce/wearit-garment-mask with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="Ekliipce/wearit-garment-mask")# Load model directly from transformers import GarmentMaskPipeline model = GarmentMaskPipeline.from_pretrained("Ekliipce/wearit-garment-mask", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| DENSE_INDEX_MAP = { | |
| "background": [0], | |
| "torso": [1, 2], | |
| "right hand": [3], | |
| "left hand": [4], | |
| "right foot": [5], | |
| "left foot": [6], | |
| "right thigh": [7, 9], | |
| "left thigh": [8, 10], | |
| "right leg": [11, 13], | |
| "left leg": [12, 14], | |
| "left big arm": [15, 17], | |
| "right big arm": [16, 18], | |
| "left forearm": [19, 21], | |
| "right forearm": [20, 22], | |
| "face": [23, 24], | |
| "thighs": [7, 8, 9, 10], | |
| "legs": [11, 12, 13, 14], | |
| "hands": [3, 4], | |
| "feet": [5, 6], | |
| "big arms": [15, 16, 17, 18], | |
| "forearms": [19, 20, 21, 22], | |
| } | |
| ATR_MAPPING = { | |
| 'Background': 0, 'Hat': 1, 'Hair': 2, 'Sunglasses': 3, | |
| 'Upper-clothes': 4, 'Skirt': 5, 'Pants': 6, 'Dress': 7, | |
| 'Belt': 8, 'Left-shoe': 9, 'Right-shoe': 10, 'Face': 11, | |
| 'Left-leg': 12, 'Right-leg': 13, 'Left-arm': 14, 'Right-arm': 15, | |
| 'Bag': 16, 'Scarf': 17 | |
| } | |
| LIP_MAPPING = { | |
| 'Background': 0, 'Hat': 1, 'Hair': 2, 'Glove': 3, | |
| 'Sunglasses': 4, 'Upper-clothes': 5, 'Dress': 6, 'Coat': 7, | |
| 'Socks': 8, 'Pants': 9, 'Jumpsuits': 10, 'Scarf': 11, | |
| 'Skirt': 12, 'Face': 13, 'Left-arm': 14, 'Right-arm': 15, | |
| 'Left-leg': 16, 'Right-leg': 17, 'Left-shoe': 18, 'Right-shoe': 19 | |
| } | |
| PROTECT_BODY_PARTS = { | |
| 'upper': ['Left-leg', 'Right-leg'], | |
| 'lower': ['Right-arm', 'Left-arm', 'Face'], | |
| 'overall': [], | |
| 'inner': ['Left-leg', 'Right-leg'], | |
| 'outer': ['Left-leg', 'Right-leg'], | |
| } | |
| PROTECT_CLOTH_PARTS = { | |
| 'upper': { | |
| 'ATR': ['Skirt', 'Pants'], | |
| 'LIP': ['Skirt', 'Pants'] | |
| }, | |
| 'lower': { | |
| 'ATR': ['Upper-clothes'], | |
| 'LIP': ['Upper-clothes', 'Coat'] | |
| }, | |
| 'overall': { | |
| 'ATR': [], | |
| 'LIP': [] | |
| }, | |
| 'inner': { | |
| 'ATR': ['Dress', 'Coat', 'Skirt', 'Pants'], | |
| 'LIP': ['Dress', 'Coat', 'Skirt', 'Pants', 'Jumpsuits'] | |
| }, | |
| 'outer': { | |
| 'ATR': ['Dress', 'Pants', 'Skirt'], | |
| 'LIP': ['Upper-clothes', 'Dress', 'Pants', 'Skirt', 'Jumpsuits'] | |
| } | |
| } | |
| MASK_CLOTH_PARTS = { | |
| 'upper': ['Upper-clothes', 'Coat', 'Dress', 'Jumpsuits'], | |
| 'lower': ['Pants', 'Skirt', 'Dress', 'Jumpsuits'], | |
| 'overall': ['Upper-clothes', 'Dress', 'Pants', 'Skirt', 'Coat', 'Jumpsuits'], | |
| 'inner': ['Upper-clothes'], | |
| 'outer': ['Coat',] | |
| } | |
| MASK_DENSE_PARTS = { | |
| 'upper': ['torso', 'big arms', 'forearms'], | |
| 'lower': ['thighs', 'legs'], | |
| 'overall': ['torso', 'thighs', 'legs', 'big arms', 'forearms'], | |
| 'inner': ['torso'], | |
| 'outer': ['torso', 'big arms', 'forearms'] | |
| } | |
| schp_public_protect_parts = ['Hat', 'Hair', 'Sunglasses', 'Left-shoe', 'Right-shoe', 'Bag', 'Glove', 'Scarf'] | |
| schp_protect_parts = { | |
| 'upper': ['Left-leg', 'Right-leg', 'Skirt', 'Pants', 'Jumpsuits'], | |
| 'lower': ['Left-arm', 'Right-arm', 'Upper-clothes', 'Coat'], | |
| 'overall': [], | |
| 'inner': ['Left-leg', 'Right-leg', 'Skirt', 'Pants', 'Jumpsuits', 'Coat'], | |
| 'outer': ['Left-leg', 'Right-leg', 'Skirt', 'Pants', 'Jumpsuits', 'Upper-clothes'] | |
| } | |
| schp_mask_parts = { | |
| 'upper': ['Upper-clothes', 'Dress', 'Coat', 'Jumpsuits'], | |
| 'lower': ['Pants', 'Skirt', 'Dress', 'Jumpsuits', 'socks'], | |
| 'overall': ['Upper-clothes', 'Dress', 'Pants', 'Skirt', 'Coat', 'Jumpsuits', 'socks'], | |
| 'inner': ['Upper-clothes'], | |
| 'outer': ['Coat',] | |
| } | |
| dense_mask_parts = { | |
| 'upper': ['torso', 'big arms', 'forearms'], | |
| 'lower': ['thighs', 'legs'], | |
| 'overall': ['torso', 'thighs', 'legs', 'big arms', 'forearms'], | |
| 'inner': ['torso'], | |
| 'outer': ['torso', 'big arms', 'forearms'] | |
| } | |
| # Patch compatibilité : 'dress' = 'overall' dans tous les mappings principaux | |
| for _mapping_name in [ | |
| 'MASK_CLOTH_PARTS', | |
| 'MASK_DENSE_PARTS', | |
| 'PROTECT_BODY_PARTS', | |
| 'PROTECT_CLOTH_PARTS', | |
| ]: | |
| _mapping = globals().get(_mapping_name) | |
| if _mapping is not None and 'overall' in _mapping and 'dress' not in _mapping: | |
| _mapping['dress'] = _mapping['overall'] |