from .builder import ITEMS
from .clothing import Clothing


@ITEMS.register_module()
class Bottom(Clothing):
    def __init__(self, pipeline, **kwargs):
        if pipeline is None:
            pipeline = [
                dict(type='LoadImageFromFile', path=kwargs['path'], color=kwargs['color'], print_dict=kwargs['print']),
                dict(type='KeypointDetection'),
                dict(type='ContourDetection'),
                # dict(type='Segmentation'),
                dict(type='Painting', painting_flag=True),
                dict(type='PrintPainting', print_flag=True),
                dict(type='Scaling'),
                dict(type='Split'),
                # dict(type='ImageShow', key=['image', 'mask', 'pattern_image', 'print_image']),
            ]
        kwargs.update(pipeline=pipeline)
        super(Bottom, self).__init__(**kwargs)


@ITEMS.register_module()
class Trousers(Bottom):
    def __init__(self, pipeline=None, **kwargs):
        super(Trousers, self).__init__(pipeline, **kwargs)


@ITEMS.register_module()
class Skirt(Bottom):
    def __init__(self, pipeline=None, **kwargs):
        super(Skirt, self).__init__(pipeline, **kwargs)


@ITEMS.register_module()
class Bottoms(Bottom):
    def __init__(self, pipeline=None, **kwargs):
        super(Bottoms, self).__init__(pipeline, **kwargs)
