From 2b5dce50bbf7bd36e1bf195e86f944cca36a8a7a Mon Sep 17 00:00:00 2001 From: pangkaicheng <924366729@qq.com> Date: Mon, 25 Mar 2024 10:06:12 +0800 Subject: [PATCH] output both scores and image features --- app/service/outfit_matcher/outfit_evaluator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/service/outfit_matcher/outfit_evaluator.py b/app/service/outfit_matcher/outfit_evaluator.py index ff8f9af..311d597 100644 --- a/app/service/outfit_matcher/outfit_evaluator.py +++ b/app/service/outfit_matcher/outfit_evaluator.py @@ -327,9 +327,11 @@ class OutfitMaterTypeAware(OutfitMatcher): # 输出集 outputs = [ httpclient.InferRequestedOutput("output__0", binary_data=True), + httpclient.InferRequestedOutput("output__1", binary_data=True), ] results = client.infer(model_name="outfit_matcher_type_aware", inputs=inputs, outputs=outputs) # 推理 # 取结果 - scores = torch.from_numpy(results.as_numpy("output__0")) - return scores # Shape (N, 1) + scores = torch.from_numpy(results.as_numpy("output__0")) # Shape (N, 1) + features = torch.from_numpy(results.as_numpy("output__1")) # Shape (N, -1, 64) + return scores, features