feat 新增接口描述 docs页面 ,新增S3 图片get upload 操作,整理代码
fix
This commit is contained in:
@@ -1,101 +0,0 @@
|
||||
{
|
||||
"objects": [
|
||||
{
|
||||
"basic": {
|
||||
"body_point": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 67315,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/0628000325.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92912,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0825001943.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 91430,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/outwear/0825000856.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"process_id": "7296013643475027"
|
||||
}
|
||||
@@ -1,684 +0,0 @@
|
||||
{
|
||||
"objects": [
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 67315,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/0628000325.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92912,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0825001943.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 91430,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/outwear/0825000856.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92913,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/dress/826000033.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Dress"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92914,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/skirt/0902001788.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Skirt"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92915,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0902003817.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92916,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/skirt/skirt_p4_838.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Skirt"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 84210,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0916000703.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 62041,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/outwear/0902000232.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 67039,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0902002591.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 78016,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/trousers_p4_302.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92917,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/0902001403.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92306,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0902001766.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 86564,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0916000038.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92918,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/0628001561.jpeg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 92919,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/outwear/outwear_p3186.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 67009,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0902002051.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"icon": "none",
|
||||
"image_id": 85028,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/skirt/903000142.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Skirt"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"process_id": "7296013643475027"
|
||||
}
|
||||
@@ -1,69 +1,771 @@
|
||||
{
|
||||
"basic": {
|
||||
"body_point": {
|
||||
"waistband_right": [
|
||||
1081,
|
||||
1318
|
||||
],
|
||||
"hand_point_right": [
|
||||
1200,
|
||||
1857
|
||||
],
|
||||
"waistband_left": [
|
||||
639,
|
||||
1315
|
||||
],
|
||||
"hand_point_left": [
|
||||
493,
|
||||
1808
|
||||
],
|
||||
"shoulder_left": [
|
||||
556,
|
||||
582
|
||||
],
|
||||
"shoulder_right": [
|
||||
1130,
|
||||
576
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "single",
|
||||
"switch_category": "Trousers",
|
||||
"body_path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png"
|
||||
},
|
||||
"item": [
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"image_id": "67315",
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/0628000325.jpg",
|
||||
"print": {
|
||||
"if_single": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"color": "151 78 78",
|
||||
"path": "aida-users/89/models/female/5d39394e-9809-43c2-80b8-4e96497b1974.png",
|
||||
"image_id": 69331,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"print": {
|
||||
"if_single": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": 1.0,
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
"objects": [
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"businessId": 493827,
|
||||
"color": "127 61 21",
|
||||
"elementId": 493827,
|
||||
"icon": "none",
|
||||
"image_id": 110201,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketch/62302527-2910-4740-808d-2cb8221daa34-3-31.png",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Dress"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "27 25 23",
|
||||
"icon": "none",
|
||||
"image_id": 110202,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/skirt/0916000602.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Skirt"
|
||||
},
|
||||
{
|
||||
"businessId": 493825,
|
||||
"color": "229 214 200",
|
||||
"elementId": 493825,
|
||||
"icon": "none",
|
||||
"image_id": 107101,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketchboard/female/Blouse/de8f5656-d7ae-4642-bc90-f7f9d85da09b.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"businessId": 493824,
|
||||
"color": "76 124 124",
|
||||
"elementId": 493824,
|
||||
"icon": "none",
|
||||
"image_id": 104522,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketch/3e82214a-0191-11ef-96d2-b48351119060_1.png",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "229 214 200",
|
||||
"icon": "none",
|
||||
"image_id": 110203,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0825001576.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "76 124 124",
|
||||
"icon": "none",
|
||||
"image_id": 96071,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/skirt/903000097.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Skirt"
|
||||
},
|
||||
{
|
||||
"color": "209 125 29",
|
||||
"icon": "none",
|
||||
"image_id": 93798,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/outwear/outwear_p4_561.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"businessId": 493824,
|
||||
"color": "209 125 29",
|
||||
"elementId": 493824,
|
||||
"icon": "none",
|
||||
"image_id": 104522,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketch/3e82214a-0191-11ef-96d2-b48351119060_1.png",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"color": "118 123 115",
|
||||
"icon": "none",
|
||||
"image_id": 110204,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/0902000457.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "118 123 115",
|
||||
"icon": "none",
|
||||
"image_id": 79259,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/826000094.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "127 61 21",
|
||||
"icon": "none",
|
||||
"image_id": 96038,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/dress/0902003549.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Dress"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"businessId": 493822,
|
||||
"color": "127 61 21",
|
||||
"elementId": 493822,
|
||||
"icon": "none",
|
||||
"image_id": 62309,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketchboard/female/trousers/c37c2ea6-8955-4b40-8339-c737e672ca3d.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"businessId": 493825,
|
||||
"color": "118 123 115",
|
||||
"elementId": 493825,
|
||||
"icon": "none",
|
||||
"image_id": 107101,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketchboard/female/Blouse/de8f5656-d7ae-4642-bc90-f7f9d85da09b.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"businessId": 493826,
|
||||
"color": "127 61 21",
|
||||
"elementId": 493826,
|
||||
"icon": "none",
|
||||
"image_id": 107105,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketchboard/female/Skirt/58710352-6301-450d-b69a-fb2922b5429a.png",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Skirt"
|
||||
},
|
||||
{
|
||||
"color": "118 123 115",
|
||||
"icon": "none",
|
||||
"image_id": 79114,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/blouse/903000169.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"color": "229 214 200",
|
||||
"icon": "none",
|
||||
"image_id": 90573,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/outwear/0628000541.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Outwear"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"basic": {
|
||||
"body_point_test": {
|
||||
"waistband_right": [
|
||||
336,
|
||||
264
|
||||
],
|
||||
"hand_point_right": [
|
||||
350,
|
||||
303
|
||||
],
|
||||
"waistband_left": [
|
||||
245,
|
||||
274
|
||||
],
|
||||
"hand_point_left": [
|
||||
219,
|
||||
315
|
||||
],
|
||||
"shoulder_left": [
|
||||
227,
|
||||
155
|
||||
],
|
||||
"shoulder_right": [
|
||||
338,
|
||||
149
|
||||
]
|
||||
},
|
||||
"layer_order": false,
|
||||
"scale_bag": 0.7,
|
||||
"scale_earrings": 0.16,
|
||||
"self_template": true,
|
||||
"single_overall": "overall",
|
||||
"switch_category": ""
|
||||
},
|
||||
"items": [
|
||||
{
|
||||
"color": "229 214 200",
|
||||
"icon": "none",
|
||||
"image_id": 110205,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-sys-image/images/female/trousers/0916000217.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Trousers"
|
||||
},
|
||||
{
|
||||
"businessId": 493825,
|
||||
"color": "209 125 29",
|
||||
"elementId": 493825,
|
||||
"icon": "none",
|
||||
"image_id": 107101,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"path": "aida-users/31/sketchboard/female/Blouse/de8f5656-d7ae-4642-bc90-f7f9d85da09b.jpg",
|
||||
"print": {
|
||||
"IfSingle": false,
|
||||
"print_path_list": []
|
||||
},
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Blouse"
|
||||
},
|
||||
{
|
||||
"body_path": "aida-users/31/models/female/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png",
|
||||
"image_id": 82966,
|
||||
"offset": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"resize_scale": [
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"type": "Body"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"process_id": "6878547032381675"
|
||||
}
|
||||
@@ -48,7 +48,6 @@ class Split(object):
|
||||
result_front_image_pil = Image.fromarray(cvtColor(result_front_image, COLOR_BGR2RGBA))
|
||||
front_new_size = (int(result_front_image_pil.width * result["scale"] * result["resize_scale"][0]), int(result_front_image_pil.height * result["scale"] * result["resize_scale"][1]))
|
||||
result_front_image_pil = result_front_image_pil.resize(front_new_size, Image.LANCZOS)
|
||||
# TODO 多线程外部上传图片到minio
|
||||
# result['front_mask_image'] = cv2.resize(front_mask, front_new_size)
|
||||
# result['front_image'] = result_front_image_pil
|
||||
front_mask = cv2.resize(front_mask, front_new_size)
|
||||
@@ -61,7 +60,6 @@ class Split(object):
|
||||
result_back_image_pil = Image.fromarray(cvtColor(result_back_image, COLOR_BGR2RGBA))
|
||||
back_new_size = (int(result_back_image_pil.width * result["scale"] * result["resize_scale"][0]), int(result_back_image_pil.height * result["scale"] * result["resize_scale"][1]))
|
||||
result_back_image_pil = result_back_image_pil.resize(back_new_size, Image.LANCZOS)
|
||||
# TODO 多线程外部上传图片到minio
|
||||
# result['back_mask_image'] = cv2.resize(back_mask, back_new_size)
|
||||
# result['back_image'] = result_back_image_pil
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
"""
|
||||
import io
|
||||
import logging
|
||||
import time
|
||||
|
||||
# import boto3
|
||||
import cv2
|
||||
@@ -18,8 +17,8 @@ from PIL import Image
|
||||
from minio import Minio
|
||||
|
||||
from app.core.config import *
|
||||
from app.service.utils.decorator import RunTime
|
||||
from app.service.utils.generate_uuid import generate_uuid
|
||||
from app.service.utils.oss_client import oss_upload_image
|
||||
|
||||
minio_client = Minio(
|
||||
MINIO_URL,
|
||||
@@ -27,6 +26,7 @@ minio_client = Minio(
|
||||
secret_key=MINIO_SECRET,
|
||||
secure=MINIO_SECURE)
|
||||
|
||||
|
||||
# s3 = boto3.client(
|
||||
# 's3',
|
||||
# aws_access_key_id=S3_ACCESS_KEY,
|
||||
@@ -134,8 +134,14 @@ def synthesis(data, size):
|
||||
image_data = io.BytesIO()
|
||||
result_image.save(image_data, format='PNG')
|
||||
image_data.seek(0)
|
||||
|
||||
# oss upload
|
||||
image_bytes = image_data.read()
|
||||
return f"aida-results/{minio_client.put_object('aida-results', f'result_{generate_uuid()}.png', io.BytesIO(image_bytes), len(image_bytes), content_type='image/png').object_name}"
|
||||
bucket_name = 'aida-results'
|
||||
object_name = f'result_{generate_uuid()}.png'
|
||||
req = oss_upload_image(bucket=bucket_name, object_name=object_name, image_bytes=image_bytes)
|
||||
return f"{bucket_name}/{object_name}"
|
||||
# return f"aida-results/{minio_client.put_object('aida-results', f'result_{generate_uuid()}.png', io.BytesIO(image_bytes), len(image_bytes), content_type='image/png').object_name}"
|
||||
|
||||
# object_name = f'result_{generate_uuid()}.png'
|
||||
# response = s3.put_object(Bucket="aida-results", Key=object_name, Body=data, ContentType='image/png')
|
||||
|
||||
@@ -9,99 +9,15 @@
|
||||
"""
|
||||
import io
|
||||
import logging
|
||||
import time
|
||||
|
||||
# import boto3
|
||||
import cv2
|
||||
from minio import Minio
|
||||
|
||||
from app.core.config import *
|
||||
from app.service.utils.decorator import RunTime
|
||||
|
||||
minio_client = Minio(
|
||||
f"{MINIO_URL}",
|
||||
access_key=MINIO_ACCESS,
|
||||
secret_key=MINIO_SECRET,
|
||||
secure=MINIO_SECURE)
|
||||
|
||||
"""S3 上传"""
|
||||
# s3 = boto3.client('s3', aws_access_key_id=S3_ACCESS_KEY, aws_secret_access_key=S3_AWS_SECRET_ACCESS_KEY, region_name=S3_REGION_NAME)
|
||||
|
||||
|
||||
#
|
||||
# @RunTime
|
||||
# def upload_png_mask(front_image, object_name, mask=None):
|
||||
# mask_url = None
|
||||
# if mask is not None:
|
||||
# # 反转掩模
|
||||
# mask_inverted = cv2.bitwise_not(mask)
|
||||
# # 将掩模转换为 RGBA 格式
|
||||
# rgba_image = cv2.cvtColor(mask_inverted, cv2.COLOR_BGR2BGRA)
|
||||
# rgba_image[rgba_image[:, :, 0] == 0] = [0, 0, 0, 0]
|
||||
# # 将图像数据保存到内存中的 BytesIO 对象中
|
||||
# image_bytes = io.BytesIO()
|
||||
# image_bytes.write(cv2.imencode('.png', rgba_image)[1].tobytes())
|
||||
# image_bytes.seek(0)
|
||||
# try:
|
||||
# key = f"mask/mask_{object_name}.png"
|
||||
# mask_url = f"{AIDA_CLOTHING}/{key}"
|
||||
# s3.put_object(Bucket=AIDA_CLOTHING, Key=key, Body=image_bytes, ContentType='image/png')
|
||||
# except Exception as e:
|
||||
# print(f'上传到 S3 失败: {e}')
|
||||
# with io.BytesIO() as output:
|
||||
# front_image.save(output, format='PNG')
|
||||
# data = output.getvalue()
|
||||
# # 创建一个 S3 客户端
|
||||
# try:
|
||||
# key = f"image/image_{object_name}.png"
|
||||
# image_url = f"{AIDA_CLOTHING}/{key}"
|
||||
# s3.put_object(Bucket=AIDA_CLOTHING, Key=key, Body=data, ContentType='image/png')
|
||||
# return front_image, image_url, mask_url
|
||||
# except Exception as e:
|
||||
# print(f'上传到 S3 失败: {e}')
|
||||
#
|
||||
#
|
||||
# @RunTime
|
||||
# def upload_layer_image(image, object_name):
|
||||
# with io.BytesIO() as output:
|
||||
# image.save(output, format='PNG')
|
||||
# data = output.getvalue()
|
||||
# # 创建一个 S3 客户端
|
||||
# try:
|
||||
# key = f"image/image_{object_name}.png"
|
||||
# image_url = f"{AIDA_CLOTHING}/{key}"
|
||||
# s3.put_object(Bucket=AIDA_CLOTHING, Key=key, Body=data, ContentType='image/png')
|
||||
# return image_url
|
||||
# except Exception as e:
|
||||
# print(f'上传到 S3 失败: {e}')
|
||||
#
|
||||
#
|
||||
# @RunTime
|
||||
# def upload_mask_image(mask, object_name):
|
||||
# # 反转掩模
|
||||
# mask_inverted = cv2.bitwise_not(mask)
|
||||
# # 将掩模转换为 RGBA 格式
|
||||
# rgba_image = cv2.cvtColor(mask_inverted, cv2.COLOR_BGR2BGRA)
|
||||
# rgba_image[rgba_image[:, :, 0] == 0] = [0, 0, 0, 0]
|
||||
# # 将图像数据保存到内存中的 BytesIO 对象中
|
||||
# image_bytes = io.BytesIO()
|
||||
# image_bytes.write(cv2.imencode('.png', rgba_image)[1].tobytes())
|
||||
# image_bytes.seek(0)
|
||||
# try:
|
||||
# key = f"mask/mask_{object_name}.png"
|
||||
# mask_url = f"{AIDA_CLOTHING}/{key}"
|
||||
# s3.put_object(Bucket=AIDA_CLOTHING, Key=key, Body=image_bytes, ContentType='image/png')
|
||||
# return mask_url
|
||||
# except Exception as e:
|
||||
# print(f'上传到 S3 失败: {e}')
|
||||
|
||||
|
||||
"""minio 上传"""
|
||||
from app.service.utils.oss_client import oss_upload_image
|
||||
|
||||
|
||||
# @RunTime
|
||||
def upload_png_mask(front_image, object_name, mask=None):
|
||||
start_time = time.time()
|
||||
try:
|
||||
mask_url = None
|
||||
if mask is not None:
|
||||
@@ -109,48 +25,21 @@ def upload_png_mask(front_image, object_name, mask=None):
|
||||
# 将掩模的3通道转换为4通道,白色部分不透明,黑色部分透明
|
||||
rgba_image = cv2.cvtColor(mask_inverted, cv2.COLOR_BGR2BGRA)
|
||||
rgba_image[rgba_image[:, :, 0] == 0] = [0, 0, 0, 0]
|
||||
image_bytes = io.BytesIO()
|
||||
image_bytes.write(cv2.imencode('.png', rgba_image)[1].tobytes())
|
||||
|
||||
image_bytes.seek(0)
|
||||
mask_url = f"{AIDA_CLOTHING}/{minio_client.put_object('aida-clothing', f'mask/mask_{object_name}.png', image_bytes, len(image_bytes.getvalue()), content_type='image/png').object_name}"
|
||||
# image_bytes = io.BytesIO()
|
||||
# image_bytes.write(cv2.imencode('.png', rgba_image)[1].tobytes())
|
||||
# image_bytes.seek(0)
|
||||
# mask_url = f"{AIDA_CLOTHING}/{minio_client.put_object('aida-clothing', f'mask/mask_{object_name}.png', image_bytes, len(image_bytes.getvalue()), content_type='image/png').object_name}"
|
||||
# oss upload ####################
|
||||
req = oss_upload_image(bucket=AIDA_CLOTHING, object_name=f"mask/mask_{object_name}.png", image_bytes=cv2.imencode('.png', rgba_image)[1])
|
||||
mask_url = f"{AIDA_CLOTHING}/mask/mask_{object_name}.png"
|
||||
|
||||
image_data = io.BytesIO()
|
||||
front_image.save(image_data, format='PNG')
|
||||
image_data.seek(0)
|
||||
image_bytes = image_data.read()
|
||||
image_url = f"{AIDA_CLOTHING}/{minio_client.put_object('aida-clothing', f'image/image_{object_name}.png', io.BytesIO(image_bytes), len(image_bytes), content_type='image/png').object_name}"
|
||||
# print(f"upload_png_mask {object_name} = {time.time() - start_time}")
|
||||
# image_url = f"{AIDA_CLOTHING}/{minio_client.put_object('aida-clothing', f'image/image_{object_name}.png', io.BytesIO(image_bytes), len(image_bytes), content_type='image/png').object_name}"
|
||||
req = oss_upload_image(bucket=AIDA_CLOTHING, object_name=f"image/image_{object_name}.png", image_bytes=image_bytes)
|
||||
image_url = f"{AIDA_CLOTHING}/image/image_{object_name}.png"
|
||||
return front_image, image_url, mask_url
|
||||
except Exception as e:
|
||||
logging.warning(f"upload_png_mask runtime exception : {e}")
|
||||
|
||||
|
||||
@RunTime
|
||||
def upload_layer_image(image, object_name):
|
||||
try:
|
||||
image_data = io.BytesIO()
|
||||
image.save(image_data, format='PNG')
|
||||
image_data.seek(0)
|
||||
image_bytes = image_data.read()
|
||||
image_url = f"{AIDA_CLOTHING}/{minio_client.put_object('aida-clothing', f'image/image_{object_name}.png', io.BytesIO(image_bytes), len(image_bytes), content_type='image/png').object_name}"
|
||||
return image_url
|
||||
except Exception as e:
|
||||
logging.warning(f"upload_png_mask runtime exception : {e}")
|
||||
|
||||
|
||||
@RunTime
|
||||
def upload_mask_image(mask, object_name):
|
||||
try:
|
||||
mask_inverted = cv2.bitwise_not(mask)
|
||||
# 将掩模的3通道转换为4通道,白色部分不透明,黑色部分透明
|
||||
rgba_image = cv2.cvtColor(mask_inverted, cv2.COLOR_BGR2BGRA)
|
||||
rgba_image[rgba_image[:, :, 0] == 0] = [0, 0, 0, 0]
|
||||
image_bytes = io.BytesIO()
|
||||
image_bytes.write(cv2.imencode('.png', rgba_image)[1].tobytes())
|
||||
|
||||
image_bytes.seek(0)
|
||||
mask_url = f"{AIDA_CLOTHING}/{minio_client.put_object('aida-clothing', f'mask/mask_{object_name}.png', image_bytes, len(image_bytes.getvalue()), content_type='image/png').object_name}"
|
||||
return mask_url
|
||||
except Exception as e:
|
||||
logging.warning(f"upload_png_mask runtime exception : {e}")
|
||||
|
||||
@@ -8,6 +8,7 @@ import tritonclient.grpc as grpcclient
|
||||
from urllib3.exceptions import ResponseError
|
||||
|
||||
from app.core.config import *
|
||||
from app.schemas.pre_processing import DesignPreProcessingModel
|
||||
from app.service.design.utils.design_ensemble import get_keypoint_result
|
||||
from app.service.utils.oss_client import oss_get_image, oss_upload_image
|
||||
|
||||
@@ -355,3 +356,19 @@ class DesignPreprocessing:
|
||||
except Exception as e:
|
||||
logging.info(f"save keypoint cache milvus error : {e}")
|
||||
return dict(zip(KEYPOINT_RESULT_TABLE_FIELD_SET, result.reshape(12, 2).astype(int).tolist()))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
data = {
|
||||
"sketches": [
|
||||
{
|
||||
"image_category": "dress",
|
||||
"image_id": "107903",
|
||||
"image_url": "aida-sys-image/images/female/dress/0628000000.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
request_data = DesignPreProcessingModel(sketches=data["sketches"])
|
||||
server = DesignPreprocessing()
|
||||
data = server.pipeline(image_list=request_data.sketches)
|
||||
print(data)
|
||||
|
||||
@@ -10,15 +10,17 @@
|
||||
import json
|
||||
import logging
|
||||
import time
|
||||
|
||||
import cv2
|
||||
import minio
|
||||
import numpy as np
|
||||
import redis
|
||||
import tritonclient.grpc as grpcclient
|
||||
import numpy as np
|
||||
from tritonclient.utils import np_to_triton_dtype
|
||||
|
||||
from app.core.config import *
|
||||
from app.schemas.generate_image import GenerateImageModel
|
||||
from app.service.generate_image.utils.image_processing import remove_background, stain_detection, generate_category_recognition, autoLevels, luminance_adjust, face_detect_pic
|
||||
from app.service.generate_image.utils.image_processing import remove_background, stain_detection, generate_category_recognition, autoLevels, luminance_adjust
|
||||
from app.service.generate_image.utils.upload_sd_image import upload_png_sd
|
||||
from app.service.utils.oss_client import oss_get_image
|
||||
|
||||
@@ -120,13 +122,6 @@ class GenerateImage:
|
||||
status_data = self.redis_client.get(self.tasks_id)
|
||||
return json.loads(status_data), status_data
|
||||
|
||||
def infer(self, inputs):
|
||||
return self.grpc_client.async_infer(
|
||||
model_name=GI_MODEL_NAME,
|
||||
inputs=inputs,
|
||||
callback=self.callback
|
||||
)
|
||||
|
||||
def get_result(self):
|
||||
try:
|
||||
prompts = [self.prompt] * self.batch_size
|
||||
@@ -146,7 +141,7 @@ class GenerateImage:
|
||||
input_mode.set_data_from_numpy(mode_obj)
|
||||
|
||||
inputs = [input_text, input_image, input_mode]
|
||||
ctx = self.infer(inputs)
|
||||
ctx = self.grpc_client.async_infer(model_name=GI_MODEL_NAME, inputs=inputs, callback=self.callback)
|
||||
time_out = 600
|
||||
generate_data = None
|
||||
while time_out > 0:
|
||||
@@ -186,10 +181,10 @@ if __name__ == '__main__':
|
||||
rd = GenerateImageModel(
|
||||
tasks_id="123-89",
|
||||
prompt='skeleton sitting by the side of a river looking soulful, concert poster, 4k, artistic',
|
||||
image_url="",
|
||||
image_url="aida-collection-element/87/Printboard/842c09cf-7297-42d9-9e6e-9c17d4a13cb5.jpg",
|
||||
mode='txt2img',
|
||||
category="test",
|
||||
gender="male"
|
||||
)
|
||||
server = GenerateImage(rd)
|
||||
print(server.get_result())
|
||||
print(server.get_result())
|
||||
|
||||
@@ -64,7 +64,6 @@ class SuperResolution:
|
||||
if self.sr_xn == 2:
|
||||
new_shape = (sample.shape[0] // self.sr_xn, sample.shape[1] // self.sr_xn)
|
||||
sample = cv2.resize(sample, new_shape)
|
||||
print(new_shape)
|
||||
sample = np.transpose(sample if sample.shape[2] == 1 else sample[:, :, [2, 1, 0]], (2, 0, 1))
|
||||
sample = torch.from_numpy(sample).float().unsqueeze(0).numpy()
|
||||
inputs = [
|
||||
|
||||
@@ -44,7 +44,7 @@ def oss_upload_image(bucket, object_name, image_bytes):
|
||||
req = oss_client.put_object(bucket_name=bucket, object_name=object_name, data=io.BytesIO(image_bytes), length=len(image_bytes), content_type='image/png')
|
||||
else:
|
||||
oss_client = boto3.client('s3', aws_access_key_id=S3_ACCESS_KEY, aws_secret_access_key=S3_AWS_SECRET_ACCESS_KEY, region_name=S3_REGION_NAME)
|
||||
req = oss_client.put_object(Bucket=AIDA_CLOTHING, Key=object_name, Body=image_bytes, ContentType='image/png')
|
||||
req = oss_client.put_object(Bucket=bucket, Key=object_name, Body=io.BytesIO(image_bytes), ContentType='image/png')
|
||||
except Exception as e:
|
||||
logger.warning(f"{OSS} | 上传图片出现异常 ######: {e}")
|
||||
return req
|
||||
@@ -55,12 +55,16 @@ if __name__ == '__main__':
|
||||
# url = "aida-collection-element/11523/Moodboard/f60af0d2-94c2-48f9-90ff-74b8e8a481b5.jpg"
|
||||
# url = "aida-sys-image/images/female/outwear/0628000054.jpg"
|
||||
# url = "aida-users/89/product_image/string-89.png"
|
||||
url = "test/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png"
|
||||
# url = "test/845046c7-4f62-4f54-a4a9-c26d49c6969335b5b3a9-d335-4871-a46c-3cc3caf07da259629dfd1f1f555a2e2a9def7e719366.png"
|
||||
# url = 'aida-users/89/relight_image/123-89.png'
|
||||
# url = 'aida-users/89/relight_image/123-89.png'
|
||||
# url = 'aida-users/89/relight_image/123-89.png'
|
||||
# url = "aida-users/89/sketchboard/female/Dress/e6724ab7-8d3f-4677-abe0-c3e42ab7af85.jpeg"
|
||||
read_type = "PIL "
|
||||
# url = "aida-users/87/print/956614a2-7e75-4fbe-9ed0-c1831e37a2c9-4-87.png"
|
||||
# url = "aida-users/89/single_logo/123-89.png"
|
||||
# url = "aida-users/89/product_image/string-89.png"
|
||||
url = "aida-users/10/models/female/9c788f5b-b8c7-424c-b149-025aeb0bda51model.png"
|
||||
read_type = "PIL"
|
||||
if read_type == "cv2":
|
||||
img = oss_get_image(bucket=url.split('/')[0], object_name=url[url.find('/') + 1:], data_type=read_type)
|
||||
cv2.imshow("", img)
|
||||
|
||||
Reference in New Issue
Block a user