feat design 功能迁移
This commit is contained in:
46
app/service/design/items/top.py
Normal file
46
app/service/design/items/top.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from .builder import ITEMS
|
||||
from .clothing import Clothing
|
||||
|
||||
|
||||
@ITEMS.register_module()
|
||||
class Top(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', device='cpu', show=False, debug=kwargs['debug']),
|
||||
dict(type='Painting', painting_flag=True),
|
||||
dict(type='PrintPainting', print_flag=True),
|
||||
# dict(type='ImageShow', key=['image', 'mask', 'seg_visualize', 'pattern_image']),
|
||||
dict(type='Scaling'),
|
||||
dict(type='Split'),
|
||||
]
|
||||
kwargs.update(pipeline=pipeline)
|
||||
super(Top, self).__init__(**kwargs)
|
||||
|
||||
|
||||
@ITEMS.register_module()
|
||||
class Blouse(Top):
|
||||
def __init__(self, pipeline=None, **kwargs):
|
||||
super(Blouse, self).__init__(pipeline, **kwargs)
|
||||
|
||||
|
||||
@ITEMS.register_module()
|
||||
class Outwear(Top):
|
||||
def __init__(self, pipeline=None, **kwargs):
|
||||
super(Outwear, self).__init__(pipeline, **kwargs)
|
||||
|
||||
|
||||
@ITEMS.register_module()
|
||||
class Dress(Top):
|
||||
def __init__(self, pipeline=None, **kwargs):
|
||||
super(Dress, self).__init__(pipeline, **kwargs)
|
||||
|
||||
|
||||
# Men's clothing
|
||||
@ITEMS.register_module()
|
||||
class Tops(Top):
|
||||
def __init__(self, pipeline=None, **kwargs):
|
||||
super(Tops, self).__init__(pipeline, **kwargs)
|
||||
Reference in New Issue
Block a user