This commit is contained in:
weixin_46229132 2025-05-30 09:37:22 +08:00
parent 388f5ed277
commit 8148a58584

View File

@ -16,7 +16,7 @@ for file in os.listdir(src_dir):
mask = mask.copy() mask = mask.copy()
mask[mask == 15] = 255 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) Image.fromarray(mask.astype(np.uint8)).save(png_path)
print(f"已保存: {png_path}") print(f"已保存: {png_path}")