diff --git a/app/api/api_design.py b/app/api/api_design.py index 5122b13..2ba8076 100644 --- a/app/api/api_design.py +++ b/app/api/api_design.py @@ -15,177 +15,184 @@ logger = logging.getLogger() @router.post("/design") def design(request_data: DesignModel): """ - objects.items.transparent: - "transparent":{ - "mask_url":"test/transparent_test/transparent_mask.png", - "scale":0.1 - }, - mask_url 为空"" -> 单件衣服透明 - mask_url 非空"mask_url" -> 区域透明 - - 创建一个具有以下参数的请求体: - 示例参数: - { - "objects": [ - { - "basic": { - "body_point_test": { - "waistband_right": [ - 203, - 249 - ], - "hand_point_right": [ - 229, - 343 - ], - "waistband_left": [ - 119, - 248 - ], - "hand_point_left": [ - 97, - 343 - ], - "shoulder_left": [ - 108, - 107 - ], - "shoulder_right": [ - 212, - 107 - ] - }, - "layer_order": true, - "preview_submit": "submit", - "scale_bag": 0.7, - "scale_earrings": 0.16, - "self_template": true, - "single_overall": "overall", - "switch_category": "" + - **objects.items.transparent**: + ```json + "transparent":{ + "mask_url":"test/transparent_test/transparent_mask.png", + "scale":0.1 + }, + ``` + - **mask_url** 为空"" -> 单件衣服透明 + - **mask_url** 非空"mask_url" -> 区域透明 + - **transpose** 镜像模式 ,:"top_bottom"或"left_right" + - **rotate** 45, + - 创建一个具有以下参数的请求体: + 示例参数: + ```json + { + "objects": [ + { + "basic": { + "body_point_test": { + "waistband_right": [ + 203, + 249 + ], + "hand_point_right": [ + 229, + 343 + ], + "waistband_left": [ + 119, + 248 + ], + "hand_point_left": [ + 97, + 343 + ], + "shoulder_left": [ + 108, + 107 + ], + "shoulder_right": [ + 212, + 107 + ] }, - "items": [ - { - "businessId": 2377945, - "color": "209 196 171", - "image_id": 189410, - "offset": [ - 0, - 0 - ], - "path": "aida-collection-element/89/Sketchboard/53d38bd5-f77b-4034-ada2-45f1e2ebe00c.png", - "print": { - "element": { - "element_angle_list": [], - "element_path_list": [], - "element_scale_list": [], - "location": [] - }, - "overall": { - "location": [], - "print_angle_list": [], - "print_path_list": [], - "print_scale_list": [] - }, - "single": { - "location": [], - "print_angle_list": [], - "print_path_list": [], - "print_scale_list": [] - } + "layer_order": true, + "preview_submit": "submit", + "scale_bag": 0.7, + "scale_earrings": 0.16, + "self_template": true, + "single_overall": "overall", + "switch_category": "" + }, + "items": [ + { + "businessId": 2377945, + "color": "209 196 171", + "image_id": 189410, + "offset": [ + 0, + 0 + ], + "path": "aida-collection-element/89/Sketchboard/53d38bd5-f77b-4034-ada2-45f1e2ebe00c.png", + "transpose": "top_bottom", + "rotate": 45, + "print": { + "element": { + "element_angle_list": [], + "element_path_list": [], + "element_scale_list": [], + "location": [] }, - "priority": 12, - "resize_scale": [ - 1.0, - 1.0 - ], - "seg_mask_url": "aida-clothing/mask/mask_8e96ddb0-e466-11f0-8de2-0242ac130002.png", - "type": "Outwear" - }, - { - "businessId": 2377946, - "color": "122 152 139", - "image_id": 81868, - "offset": [ - 0, - 0 - ], - "path": "aida-sys-image/images/female/blouse/0825001443.jpg", - "print": { - "element": { - "element_angle_list": [], - "element_path_list": [], - "element_scale_list": [], - "location": [] - }, - "overall": { - "location": [], - "print_angle_list": [], - "print_path_list": [], - "print_scale_list": [] - }, - "single": { - "location": [], - "print_angle_list": [], - "print_path_list": [], - "print_scale_list": [] - } + "overall": { + "location": [], + "print_angle_list": [], + "print_path_list": [], + "print_scale_list": [] }, - "priority": 11, - "resize_scale": [ - 1.0, - 1.0 - ], - "seg_mask_url": "aida-clothing/mask/mask_8f0fab78-e466-11f0-8de2-0242ac130002.png", - "type": "Blouse" + "single": { + "location": [], + "print_angle_list": [], + "print_path_list": [], + "print_scale_list": [] + } }, - { - "businessId": 2377947, - "color": "111 78 63", - "gradient": "aida-gradient/517c3a4d-aed7-4423-aa99-7b60d3577df1.png", - "image_id": 116494, - "offset": [ - 0, - 0 - ], - "path": "aida-sys-image/images/female/skirt/0825000219.jpg", - "print": { - "element": { - "element_angle_list": [], - "element_path_list": [], - "element_scale_list": [], - "location": [] - }, - "overall": { - "location": [], - "print_angle_list": [], - "print_path_list": [], - "print_scale_list": [] - }, - "single": { - "location": [], - "print_angle_list": [], - "print_path_list": [], - "print_scale_list": [] - } + "priority": 12, + "resize_scale": [ + 1.0, + 1.0 + ], + "seg_mask_url": "aida-clothing/mask/mask_8e96ddb0-e466-11f0-8de2-0242ac130002.png", + "type": "Outwear" + }, + { + "businessId": 2377946, + "color": "122 152 139", + "image_id": 81868, + "offset": [ + 0, + 0 + ], + "path": "aida-sys-image/images/female/blouse/0825001443.jpg", + "print": { + "element": { + "element_angle_list": [], + "element_path_list": [], + "element_scale_list": [], + "location": [] }, - "priority": 10, - "resize_scale": [ - 1.0, - 1.0 - ], - "seg_mask_url": "aida-clothing/mask/mask_8f6191fe-e466-11f0-8de2-0242ac130002.png", - "type": "Skirt" + "overall": { + "location": [], + "print_angle_list": [], + "print_path_list": [], + "print_scale_list": [] + }, + "single": { + "location": [], + "print_angle_list": [], + "print_path_list": [], + "print_scale_list": [] + } }, - { - "body_path": "aida-sys-image/models/female/2e4815b9-1191-419d-94ed-5771239ca4a5.png", - "image_id": 67277, - "type": "Body" - } - ] - } - ], - "process_id": "89" - } + "priority": 11, + "resize_scale": [ + 1.0, + 1.0 + ], + "seg_mask_url": "aida-clothing/mask/mask_8f0fab78-e466-11f0-8de2-0242ac130002.png", + "type": "Blouse" + }, + { + "businessId": 2377947, + "color": "111 78 63", + "gradient": "aida-gradient/517c3a4d-aed7-4423-aa99-7b60d3577df1.png", + "image_id": 116494, + "offset": [ + 0, + 0 + ], + "path": "aida-sys-image/images/female/skirt/0825000219.jpg", + "print": { + "element": { + "element_angle_list": [], + "element_path_list": [], + "element_scale_list": [], + "location": [] + }, + "overall": { + "location": [], + "print_angle_list": [], + "print_path_list": [], + "print_scale_list": [] + }, + "single": { + "location": [], + "print_angle_list": [], + "print_path_list": [], + "print_scale_list": [] + } + }, + "priority": 10, + "resize_scale": [ + 1.0, + 1.0 + ], + "seg_mask_url": "aida-clothing/mask/mask_8f6191fe-e466-11f0-8de2-0242ac130002.png", + "type": "Skirt" + }, + { + "body_path": "aida-sys-image/models/female/2e4815b9-1191-419d-94ed-5771239ca4a5.png", + "image_id": 67277, + "type": "Body" + } + ] + } + ], + "process_id": "89" + } + ``` """ # logger.info(f"design request item is : @@@@@@:{json.dumps(request_data.dict(),indent=4)}") # data = generate(request_data=request_data)