在这里插入图片描述

1. 环境配置

demo脚本中用到了cv2库,安装命令:

pip install opencv-python==4.5.5.64

pytoch安装命令:

# CUDA 12.1
conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=12.1 -c pytorch -c nvidia

虚拟环境依赖:

pytho==3.9
torch==2.1.0
numpy==1.23.5 
opencv-python==4.5.5.64 
transformers==4.33.2
diffusers==0.21.2
huggingface-hub==0.17.2
safetensors==0.3.3

2. 运行结果

运行命令:

python demo.py --image_path ./asserts/1.png --private_key "Eiffel tower" --public_key "a tree" --save_path ./output --num_steps 50

在这里插入图片描述

在这里插入图片描述

运行结果默认会保存到output文件夹下:

(a) ground truth      (b) hide      (c) reverse

网上找了别的图片进行测试:

(a) ground truth      (b) hide      (c) reverse
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐