feat 代码整理
fix
This commit is contained in:
@@ -53,9 +53,9 @@ class Segmentation(object):
|
||||
file_path = f"{SEG_CACHE_PATH}{image_id}.npy"
|
||||
try:
|
||||
np.save(file_path, seg_result)
|
||||
print("保存成功", os.path.abspath(file_path))
|
||||
logger.info("保存成功", os.path.abspath(file_path))
|
||||
except Exception as e:
|
||||
print(f"保存失败: {e}")
|
||||
logger.error(f"保存失败: {e}")
|
||||
|
||||
@staticmethod
|
||||
def load_seg_result(image_id):
|
||||
@@ -64,8 +64,8 @@ class Segmentation(object):
|
||||
seg_result = np.load(file_path)
|
||||
return True, seg_result
|
||||
except FileNotFoundError:
|
||||
print("文件不存在")
|
||||
logger.warning("文件不存在")
|
||||
return False, None
|
||||
except Exception as e:
|
||||
print(f"加载失败: {e}")
|
||||
logger.error(f"加载失败: {e}")
|
||||
return False, None
|
||||
|
||||
Reference in New Issue
Block a user