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}")