fix     seg cache debug
This commit is contained in:
zhouchengrong
2024-08-20 10:36:05 +08:00
parent 539398ea8e
commit 34fdc77cb3

View File

@@ -1,3 +1,4 @@
import logging
import os import os
import numpy as np import numpy as np
@@ -6,6 +7,8 @@ from app.core.config import SEG_CACHE_PATH
from ..builder import PIPELINES from ..builder import PIPELINES
from ...utils.design_ensemble import get_seg_result from ...utils.design_ensemble import get_seg_result
logger = logging.getLogger()
@PIPELINES.register_module() @PIPELINES.register_module()
class Segmentation(object): class Segmentation(object):
@@ -39,6 +42,7 @@ class Segmentation(object):
@staticmethod @staticmethod
def load_seg_result(image_id): def load_seg_result(image_id):
file_path = f"{SEG_CACHE_PATH}{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: try:
seg_result = np.load(file_path) seg_result = np.load(file_path)
return True, seg_result return True, seg_result