a *»´f.ã@sLddlmZmZddlmZmZddlmZeeefZ Gdd„deƒZ dS)é)ÚAnyÚTuple)ÚBitMasksÚBoxesé)Ú BaseConvertercs8eZdZdZiZeZeee e edœ‡fdd„ ƒZ ‡Z S)ÚToMaskConverterzº Converts various DensePose predictor outputs to masks in bit mask format (see `BitMasks`). Each DensePose predictor output type has to register its convertion strategy. )Údensepose_predictor_outputsÚboxesÚ image_size_hwÚreturncs"tt|ƒj|||g|¢Ri|¤ŽS)ax Convert DensePose predictor outputs to BitMasks using some registered converter. Does recursive lookup for base classes, so there's no need for explicit registration for derived classes. Args: densepose_predictor_outputs: DensePose predictor output to be converted to BitMasks boxes (Boxes): bounding boxes that correspond to the DensePose predictor outputs image_size_hw (tuple [int, int]): image height and width Return: An instance of `BitMasks`. If no suitable converter was found, raises KeyError )ÚsuperrÚconvert)Úclsr r r ÚargsÚkwargs©Ú __class__©úI/data1/chongzheng_p23/Projects/CatVTON-hf/densepose/converters/to_mask.pyrs ÿÿÿzToMaskConverter.convert) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚregistryrÚdst_typeÚ classmethodrrÚ ImageSizeTyperÚ __classcell__rrrrrsùrN) ÚtypingrrÚdetectron2.structuresrrÚbaserÚintrrrrrrÚs