From 8148a585846d77bbae0f8fc385ecbbd89a3b4a36 Mon Sep 17 00:00:00 2001 From: weixin_46229132 Date: Fri, 30 May 2025 09:37:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datasets_pro_code/png_mask_trans.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasets_pro_code/png_mask_trans.py b/datasets_pro_code/png_mask_trans.py index 1cf3e80..ed3e734 100644 --- a/datasets_pro_code/png_mask_trans.py +++ b/datasets_pro_code/png_mask_trans.py @@ -16,7 +16,7 @@ for file in os.listdir(src_dir): mask = mask.copy() mask[mask == 15] = 255 - png_path = os.path.join(dst_dir, os.path.splitext(file)[0] + ".png") + png_path = os.path.join(dst_dir, os.path.splitext(file)[0].replace("mask", "img") + ".png") Image.fromarray(mask.astype(np.uint8)).save(png_path) print(f"已保存: {png_path}")