feat 代码整理

fix
This commit is contained in:
zhouchengrong
2024-09-26 14:15:35 +08:00
parent 396a62677c
commit 6a93f89f0d
8 changed files with 19 additions and 624 deletions

View File

@@ -5,7 +5,7 @@ import cv2
import numpy as np
from app.core.config import SEG_CACHE_PATH
from app.service.design.utils.design_ensemble import get_seg_result
from app.service.design_batch.utils.design_ensemble import get_seg_result
from app.service.utils.new_oss_client import oss_get_image
logger = logging.getLogger()
@@ -48,7 +48,7 @@ class Segmentation:
@staticmethod
def save_seg_result(seg_result, image_id):
file_path = f"{SEG_CACHE_PATH}{image_id}.npy"
file_path = f"seg_cache/{image_id}.npy"
try:
np.save(file_path, seg_result)
logger.info(f"保存成功 {os.path.abspath(file_path)}")
@@ -57,7 +57,7 @@ class Segmentation:
@staticmethod
def load_seg_result(image_id):
file_path = f"{SEG_CACHE_PATH}{image_id}.npy"
file_path = f"seg_cache/{image_id}.npy"
logger.info(f"load seg file name is :{SEG_CACHE_PATH}{image_id}.npy")
try:
seg_result = np.load(file_path)