feat design 预处理接口迁移

This commit is contained in:
zhouchengrong
2024-05-30 09:48:13 +08:00
parent 13fec64125
commit 1f47d94431
7 changed files with 361 additions and 2 deletions

View File

@@ -34,8 +34,8 @@ class KeypointDetection(object):
site = 'up' if result['name'] in ['blouse', 'outwear', 'dress', 'tops'] else 'down'
# keypoint_cache = search_keypoint_cache(result["image_id"], site)
# 取消向量查询 直接过模型推理
keypoint_cache = self.keypoint_cache(result, site)
# 取消向量查询 直接过模型推理
# keypoint_cache = False
if keypoint_cache is False:

View File

@@ -37,7 +37,7 @@ def get_keypoint_result(image, site):
keypoint_result = None
try:
image, scale_factor = keypoint_preprocess(image)
client = httpclient.InferenceServerClient(url=KEYPOINT_MODEL_URL)
client = httpclient.InferenceServerClient(url=DESIGN_MODEL_URL)
transformed_img = image.astype(np.float32)
inputs = [httpclient.InferInput(f"input", transformed_img.shape, datatype="FP32")]
inputs[0].set_data_from_numpy(transformed_img, binary_data=True)