feat design 提速测试

fix
This commit is contained in:
zhouchengrong
2024-09-20 16:27:26 +08:00
parent ac6a21d8c0
commit 1385fde9ce
2 changed files with 2 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import cv2
import numpy as np
from app.core.config import SEG_CACHE_PATH
from app.service.utils.decorator import ClassCallRunTime
from app.service.utils.oss_client import oss_get_image
from ..builder import PIPELINES
from ...utils.design_ensemble import get_seg_result
@@ -15,7 +16,7 @@ logger = logging.getLogger()
@PIPELINES.register_module()
class Segmentation(object):
# @ClassCallRunTime
@ClassCallRunTime
def __call__(self, result):
if "seg_mask_url" in result.keys() and result['seg_mask_url'] != "":
seg_mask = oss_get_image(bucket=result['seg_mask_url'].split('/')[0], object_name=result['seg_mask_url'][result['seg_mask_url'].find('/') + 1:], data_type="cv2")
@@ -59,7 +60,6 @@ class Segmentation(object):
@staticmethod
def load_seg_result(image_id):
file_path = f"{SEG_CACHE_PATH}{image_id}.npy"
logger.info(f"load seg file name is :{SEG_CACHE_PATH}{image_id}.npy")
try:
seg_result = np.load(file_path)
return True, seg_result