python -m venv clipguard_env
source clipguard_env/bin/activate
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
对于 CPU:
pip install torch torchvision
pip install -r requirements.txt
python CLIPGuard.py --input SCAM_Image_path --output ./goodclip_out --sam_ckpt sam_vit_h.pth path --clip_model ViT-B-16 --clip_pretrained openai --grid 8x8
--perturb mask
python CLIPGuard.py --input image.jpg --output results/ --classes "church,tench,garbage truck" --templates "a photo of a {}"
CLIPGuard/
│
├── CLIPGuard.py
├── requirements.txt
├── README.md
└── examples/
参见 requirements.txt。
主要依赖项:
可选: