feat 代码整理
fix
This commit is contained in:
@@ -5,7 +5,7 @@ import cv2
|
||||
import numpy as np
|
||||
|
||||
from app.core.config import SEG_CACHE_PATH
|
||||
from app.service.design_batch.utils.design_ensemble import get_seg_result
|
||||
from app.service.design.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/{image_id}.npy"
|
||||
file_path = f"{SEG_CACHE_PATH}{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/{image_id}.npy"
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user