移除keypoint 缓存
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
This commit is contained in:
@@ -7,7 +7,7 @@ import numpy as np
|
|||||||
import torch
|
import torch
|
||||||
import tritonclient.grpc as grpcclient
|
import tritonclient.grpc as grpcclient
|
||||||
from minio import Minio
|
from minio import Minio
|
||||||
from pymilvus import MilvusClient
|
# from pymilvus import MilvusClient
|
||||||
from urllib3.exceptions import ResponseError
|
from urllib3.exceptions import ResponseError
|
||||||
|
|
||||||
from app.core.config import settings, SR_MODEL_NAME, SR_TRITON_URL, MILVUS_TABLE_KEYPOINT, KEYPOINT_RESULT_TABLE_FIELD_SET
|
from app.core.config import settings, SR_MODEL_NAME, SR_TRITON_URL, MILVUS_TABLE_KEYPOINT, KEYPOINT_RESULT_TABLE_FIELD_SET
|
||||||
@@ -276,14 +276,15 @@ class DesignPreprocessing:
|
|||||||
|
|
||||||
def keypoint_cache(self, sketch):
|
def keypoint_cache(self, sketch):
|
||||||
try:
|
try:
|
||||||
client = MilvusClient(uri=settings.MILVUS_URL, token=settings.MILVUS_TOKEN, db_name=settings.MILVUS_ALIAS)
|
# client = MilvusClient(uri=settings.MILVUS_URL, token=settings.MILVUS_TOKEN, db_name=settings.MILVUS_ALIAS)
|
||||||
keypoint_id = sketch['image_id']
|
keypoint_id = sketch['image_id']
|
||||||
res = client.query(
|
# res = client.query(
|
||||||
collection_name=MILVUS_TABLE_KEYPOINT,
|
# collection_name=MILVUS_TABLE_KEYPOINT,
|
||||||
# ids=[keypoint_id],
|
# # ids=[keypoint_id],
|
||||||
filter=f"keypoint_id == {keypoint_id}",
|
# filter=f"keypoint_id == {keypoint_id}",
|
||||||
output_fields=['keypoint_vector', 'keypoint_site']
|
# output_fields=['keypoint_vector', 'keypoint_site']
|
||||||
)
|
# )
|
||||||
|
res = []
|
||||||
if len(res) == 0:
|
if len(res) == 0:
|
||||||
# 没有结果 直接推理拿结果 并保存
|
# 没有结果 直接推理拿结果 并保存
|
||||||
keypoint_infer_result = self.infer_keypoint_result(sketch)
|
keypoint_infer_result = self.infer_keypoint_result(sketch)
|
||||||
|
|||||||
Reference in New Issue
Block a user