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
File size: 1,145 Bytes
436df5c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # Copyright (c) Facebook, Inc. and its affiliates.
# pyre-unsafe
from typing import Any
from .base import BaseConverter
class HFlipConverter(BaseConverter):
"""
Converts various DensePose predictor outputs to DensePose results.
Each DensePose predictor output type has to register its convertion strategy.
"""
registry = {}
dst_type = None
@classmethod
# pyre-fixme[14]: `convert` overrides method defined in `BaseConverter`
# inconsistently.
def convert(cls, predictor_outputs: Any, transform_data: Any, *args, **kwargs):
"""
Performs an horizontal flip on DensePose predictor outputs.
Does recursive lookup for base classes, so there's no need
for explicit registration for derived classes.
Args:
predictor_outputs: DensePose predictor output to be converted to BitMasks
transform_data: Anything useful for the flip
Return:
An instance of the same type as predictor_outputs
"""
return super(HFlipConverter, cls).convert(
predictor_outputs, transform_data, *args, **kwargs
)
|