YuxinWenRick / tree-ring-watermark

MIT License
250 stars 32 forks source link

run_tree_ring_watermark_imagenet_fid.py not available #26

Closed unforgettablexD closed 7 months ago

unforgettablexD commented 7 months ago

Hey, I was trying to recreate the table one in your research paper: https://arxiv.org/pdf/2310.01867.pdf I noticed that you have said to run : python run_tree_ring_watermark_imagenet_fid.py --run_name imgnet_fid_run --gt_data imagenet --model_id 256x256_diffusion --w_radius 10 --w_channel 2 --w_pattern ring --start 0 --end 10000 --with_tracking --reference_model dummy

in: https://github.com/YuxinWenRick/tree-ring-watermark/blob/main/scripts/tree_ring_imagenet.sh

but run_tree_ring_watermark_imagenet_fid.py file is not available.

Thank you,

YuxinWenRick commented 7 months ago

Hi, sorry about it. I forgot to add this. I just updated the code, and you should be able to run it with python run_tree_ring_watermark_imagenet_fid.py --run_name imgnet_fid_run --gt_data imagenet --model_id 256x256_diffusion --w_radius 10 --w_channel 2 --w_pattern ring --start 0 --end 10000 --with_tracking

Meanwhile, like the coco experiment. You may want to save the ground-truth imagenet images under: fid_outputs/{args.gt_data}/ground_truth

unforgettablexD commented 7 months ago

Hey, thanks for the update also where can i download the ground-truth imagenet images from ?

YuxinWenRick commented 7 months ago

Hi, you may use this script:

import os
from datasets import load_dataset

dataset = load_dataset("imagenet-1k", split="train", streaming=True)
dataset_iterator = iter(dataset)

output_dir = "fid_outputs/imagenet/ground_truth"
os.makedirs(output_dir, exist_ok=True)

num_images = 5000

for i in range(num_images):
    curr_image = next(dataset_iterator)["image"]
    curr_image.save(f"{output_dir}/{i}.jpeg")
YuxinWenRick commented 7 months ago

Hi @unforgettablexD I will close this issue for now. Please feel free to reopen it if you have further questions.