feat
fix 宽度自适应会默认模特高度为700 导致结果图高度锁定在700 修复bug 现高度由模特高度来定
This commit is contained in:
@@ -25,7 +25,7 @@ def image2sketch(request_item: Image2SketchModel):
|
|||||||
"image_url": "test/image2sketch/real_Dress_3200fecdc83d0c556c2bd96aedbd7fbf.jpg_Img.jpg",
|
"image_url": "test/image2sketch/real_Dress_3200fecdc83d0c556c2bd96aedbd7fbf.jpg_Img.jpg",
|
||||||
"default_style": 0,
|
"default_style": 0,
|
||||||
"sketch_bucket": "test",
|
"sketch_bucket": "test",
|
||||||
"sketch_name": "image2sketch/test.png"
|
"sketch_name": "image2sketch/area_fill_img.png"
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -185,12 +185,14 @@ def update_base_size_priority(layers, size):
|
|||||||
# 计算透明背景图片的宽度
|
# 计算透明背景图片的宽度
|
||||||
min_x = min(info['position'][1] for info in layers)
|
min_x = min(info['position'][1] for info in layers)
|
||||||
x_list = []
|
x_list = []
|
||||||
|
new_height = 700
|
||||||
for info in layers:
|
for info in layers:
|
||||||
if info['image'] is not None:
|
if info['image'] is not None:
|
||||||
x_list.append(info['position'][1] + info['image'].width)
|
x_list.append(info['position'][1] + info['image'].width)
|
||||||
|
if info['name'] == 'mannequin':
|
||||||
|
new_height = info['image'].height
|
||||||
max_x = max(x_list)
|
max_x = max(x_list)
|
||||||
new_width = max_x - min_x
|
new_width = max_x - min_x
|
||||||
new_height = 700
|
|
||||||
# 更新坐标
|
# 更新坐标
|
||||||
for info in layers:
|
for info in layers:
|
||||||
info['adaptive_position'] = (info['position'][0], info['position'][1] - min_x)
|
info['adaptive_position'] = (info['position'][0], info['position'][1] - min_x)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ if __name__ == '__main__':
|
|||||||
# url = "aida-users/89/sketchboard/female/Dress/e6724ab7-8d3f-4677-abe0-c3e42ab7af85.jpeg"
|
# url = "aida-users/89/sketchboard/female/Dress/e6724ab7-8d3f-4677-abe0-c3e42ab7af85.jpeg"
|
||||||
# url = "aida-users/87/print/956614a2-7e75-4fbe-9ed0-c1831e37a2c9-4-87.png"
|
# 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/single_logo/123-89.png"
|
||||||
url = "aida-clothing/mask/mask_f354afb5-6423-11ef-8b08-0826ae3ad6b3.png"
|
url = "aida-results/result_e2673d92-8d25-11ef-be24-0826ae3ad6b3.png"
|
||||||
# url = "aida-collection-element/12148/Sketchboard/95ea577b-305b-4a62-b30a-39c0dd3ddb3f.png"
|
# url = "aida-collection-element/12148/Sketchboard/95ea577b-305b-4a62-b30a-39c0dd3ddb3f.png"
|
||||||
read_type = "cv2"
|
read_type = "cv2"
|
||||||
if read_type == "cv2":
|
if read_type == "cv2":
|
||||||
|
|||||||
Reference in New Issue
Block a user