feat 测试批量上传图片
fix
This commit is contained in:
@@ -28,7 +28,7 @@ class KeypointDetection(object):
|
|||||||
# self.client.close()
|
# self.client.close()
|
||||||
# print(f"client close time : {time.time() - start_time}")
|
# print(f"client close time : {time.time() - start_time}")
|
||||||
|
|
||||||
@ ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
# logging.info("KeypointDetection run ")
|
# logging.info("KeypointDetection run ")
|
||||||
if result['name'] in ['blouse', 'skirt', 'dress', 'outwear', 'trousers', 'tops', 'bottoms']: # 查询是否有数据 且类别相同 相同则直接读 不同则推理后更新
|
if result['name'] in ['blouse', 'skirt', 'dress', 'outwear', 'trousers', 'tops', 'bottoms']: # 查询是否有数据 且类别相同 相同则直接读 不同则推理后更新
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class LoadImageFromFile(object):
|
|||||||
self.print_dict = print_dict
|
self.print_dict = print_dict
|
||||||
# self.minio_client = Minio(f"{MINIO_URL}", access_key=MINIO_ACCESS, secret_key=MINIO_SECRET, secure=MINIO_SECURE)
|
# self.minio_client = Minio(f"{MINIO_URL}", access_key=MINIO_ACCESS, secret_key=MINIO_SECRET, secure=MINIO_SECURE)
|
||||||
|
|
||||||
@ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
result['image'], result['pre_mask'] = self.read_image(self.path)
|
result['image'], result['pre_mask'] = self.read_image(self.path)
|
||||||
result['gray'] = cv2.cvtColor(result['image'], cv2.COLOR_BGR2GRAY)
|
result['gray'] = cv2.cvtColor(result['image'], cv2.COLOR_BGR2GRAY)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Painting(object):
|
|||||||
def __init__(self, painting_flag=True):
|
def __init__(self, painting_flag=True):
|
||||||
self.painting_flag = painting_flag
|
self.painting_flag = painting_flag
|
||||||
|
|
||||||
@ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
if result['name'] not in ['hairstyle', 'earring'] and self.painting_flag and result['color'] != 'none':
|
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]
|
dim_image_h, dim_image_w = result['image'].shape[0:2]
|
||||||
@@ -87,7 +87,7 @@ class PrintPainting(object):
|
|||||||
def __init__(self, print_flag=True):
|
def __init__(self, print_flag=True):
|
||||||
self.print_flag = print_flag
|
self.print_flag = print_flag
|
||||||
|
|
||||||
@ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
single_print = result['print']['single']
|
single_print = result['print']['single']
|
||||||
overall_print = result['print']['overall']
|
overall_print = result['print']['overall']
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Scaling(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
if result['keypoint'] in ['waistband', 'shoulder', 'head_point']:
|
if result['keypoint'] in ['waistband', 'shoulder', 'head_point']:
|
||||||
# milvus_db_keypoint_cache
|
# milvus_db_keypoint_cache
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class Segmentation(object):
|
|||||||
self.device = device
|
self.device = device
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
|
|
||||||
@ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
_, seg_result = self.load_seg_result(result["image_id"])
|
_, seg_result = self.load_seg_result(result["image_id"])
|
||||||
if not _:
|
if not _:
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Split(object):
|
|||||||
Split image into front and back layer according to the segmentation result
|
Split image into front and back layer according to the segmentation result
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ClassCallRunTime
|
# @ClassCallRunTime
|
||||||
# KNet
|
# KNet
|
||||||
def __call__(self, result):
|
def __call__(self, result):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ def process_images(images):
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
@RunTime
|
# @RunTime
|
||||||
def upload_images(image_obj):
|
def upload_images(image_obj):
|
||||||
bucket_name = image_obj['image_url'].split("/", 1)[0]
|
bucket_name = image_obj['image_url'].split("/", 1)[0]
|
||||||
object_name = image_obj['image_url'].split("/", 1)[1]
|
object_name = image_obj['image_url'].split("/", 1)[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user