img server
This commit is contained in:
@@ -267,8 +267,7 @@ def main_dev(opt):
|
||||
|
||||
# 检查输出目录是否存在
|
||||
os.makedirs(opt.outdir, exist_ok=True)
|
||||
# 绝对路径
|
||||
outpath = os.path.join(opt.outdir)
|
||||
outpath = opt.outdir
|
||||
|
||||
# 创建水印编码器
|
||||
wm = "SDV2"
|
||||
@@ -329,6 +328,7 @@ def main_dev(opt):
|
||||
for x_sample in x_samples:
|
||||
print("Sample count:", sample_count)
|
||||
imge_path = os.path.join(sample_path, f"{base_count:05}.png")
|
||||
imge_path = os.path.abspath(imge_path) # 转换为绝对路径
|
||||
x_sample = 255. * rearrange(x_sample.cpu().numpy(), 'c h w -> h w c')
|
||||
img = Image.fromarray(x_sample.astype(np.uint8))
|
||||
img = put_watermark(img, wm_encoder)
|
||||
|
Reference in New Issue
Block a user