jonasricker / aeroblade

[CVPR2024] AEROBLADE: Training-Free Detection of Latent Diffusion Images Using Autoencoder Reconstruction Error
https://openaccess.thecvf.com/content/CVPR2024/html/Ricker_AEROBLADE_Training-Free_Detection_of_Latent_Diffusion_Images_Using_Autoencoder_Reconstruction_CVPR_2024_paper.html
39 stars 6 forks source link

quickstart error #6

Open lingHAYAO opened 4 months ago

lingHAYAO commented 4 months ago

I use run_aeroblade.py to test my own image but it doesn't work.

Directory 'aeroblade_output' exists, continue? (y/n) y
PROGRESS (compute_distances):   0%|                                                                                                                                                     | 0/3 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/home/chenzhehan/aeroblade/scripts/run_aeroblade.py", line 87, in <module>
    main(parse_args())
  File "/home/chenzhehan/aeroblade/scripts/run_aeroblade.py", line 15, in main
    distances = compute_distances(
  File "/home/chenzhehan/aeroblade/scripts/aeroblade/high_level_funcs.py", line 73, in compute_distances
    dist_dict, files = distance_from_config(
  File "/home/chenzhehan/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/chenzhehan/aeroblade/scripts/aeroblade/distances.py", line 35, in compute
    raise ValueError("ds_a and ds_b should contain matching files.")
ValueError: ds_a and ds_b should contain matching files.
PROGRESS (compute_distances):   0%|                                                                                                                                                     | 0/3 [00:00<?, ?it/s]
jonasricker commented 4 months ago

This is probably an issue with caching. Try deleting the output directory and the .cache directory.

ayushgoyal9715 commented 2 weeks ago

Even after deleting the output directory and .cache it's still showing the same error image

jonasricker commented 2 weeks ago

Could you debug with a breakpoint at the following line and print files_a and files_b?

ayushgoyal9715 commented 2 weeks ago

image Because of the format, it will only work on png images

jonasricker commented 1 week ago

You are right, the function only works for PNGs. I just pushed a fix that should make it work for all file types. Please make sure that you don't have different images with similar names (like image.png and image.jpeg), since this will cause issues with the computation of the reconstructions.

Does this fix your error?