feat 测试批量上传图片

fix
This commit is contained in:
zhouchengrong
2024-07-19 15:10:28 +08:00
parent b92b1f7d6e
commit ed908d0472
13 changed files with 160 additions and 48 deletions

View File

@@ -4,6 +4,7 @@ import cv2
import numpy as np
from PIL import Image
from app.service.utils.decorator import RunTime, ClassCallRunTime
from app.service.utils.oss_client import oss_get_image
from ..builder import PIPELINES
@@ -13,7 +14,7 @@ class Painting(object):
def __init__(self, painting_flag=True):
self.painting_flag = painting_flag
# @ RunTime
@ClassCallRunTime
def __call__(self, result):
if result['name'] not in ['hairstyle', 'earring'] and self.painting_flag and result['color'] != 'none':
dim_image_h, dim_image_w = result['image'].shape[0:2]
@@ -86,7 +87,7 @@ class PrintPainting(object):
def __init__(self, print_flag=True):
self.print_flag = print_flag
# @ RunTime
@ClassCallRunTime
def __call__(self, result):
single_print = result['print']['single']
overall_print = result['print']['overall']
@@ -236,7 +237,6 @@ class PrintPainting(object):
print_background = cv2.cvtColor(np.array(source_image_pil), cv2.COLOR_RGBA2BGR)
mask_background = cv2.cvtColor(np.array(source_image_pil_mask), cv2.COLOR_RGBA2BGR)
print(1)
else:
mask = self.get_mask_inv(image)
mask = np.expand_dims(mask, axis=2)