ZhendongWang6 / DIRE

[ICCV 2023] Official implementation of the paper: "DIRE for Diffusion-Generated Image Detection"
254 stars 20 forks source link

Easy to Use Request #7

Open Konerusudhir opened 1 year ago

Konerusudhir commented 1 year ago

Currently, the setup is divided into 2 steps. Step 1: Copute_dire.sh to generate an DIRE image from Input image(Real or Fake) (Distributed computing on N GPUS) Step 2: demo.py to generate probability from DIRE image.

This setup makes it very hard to test and use the model.

I think if we can simplify it to one batched function call to execute both steps will make the model more usable to other researchers or end users.

Example: Create inference.py file which takes a directory as input and generates probabilities in a CSV file on a Single GPU or M2 Mac.

RichardSunnyMeng commented 1 year ago

Hi, have you already reproduced compute_dire.py on your dataset? I didn't see so significant reconstruction error...

Konerusudhir commented 1 year ago

Hi, have you already reproduced compute_dire.py on your dataset? I didn't see so significant reconstruction error...

I tested it only for 4 images so far. I am planning on testing it with CIFAKE dataset in the coming days. https://www.kaggle.com/datasets/birdy654/cifake-real-and-ai-generated-synthetic-images

shanface33 commented 10 months ago

Hi, thanks for your comments. May I inquire about the time taken to generate DIRE for each image?

Konerusudhir commented 10 months ago

It took 4.5 Seconds per image on T4 GPU. DIRE approach does not look practical for the production use case if it takes 4.5 seconds per image.

shanface33 commented 10 months ago

Thank you so much for your quick response! I really appreciate it!

happy-Moer commented 6 months ago

Have you ever encountered this problem: ModuleNotFoundError: No module named 'mpi4py' how can I slove this problem? thanks in advance

aditipanda commented 2 months ago

I used demo.py on raw (original, not DIRE-computed) fake and real images from my own dataset, and got strange results. The celebahq_sdv2 ckpt classifies everything as fake - even real images from FairFace dataset.

The lsun_adm and lsun_iddpm ckpts classify most real images as real, but also fake images as real. In fact, lsun_iddpm classifies all fake images as real images - 100%!

This compute_DIRE step seems compulsory to be done at our end to see the improvements with DIRE. But I shall follow what's suggested, and get back here.

aditipanda commented 2 months ago

I used demo.py on raw (original, not DIRE-computed) fake and real images from my own dataset, and got strange results. The celebahq_sdv2 ckpt classifies everything as fake - even real images from FairFace dataset.

The lsun_adm and lsun_iddpm ckpts classify most real images as real, but also fake images as real. In fact, lsun_iddpm classifies all fake images as real images - 100%!

This compute_DIRE step seems compulsory to be done at our end to see the improvements with DIRE. But I shall follow what's suggested, and get back here.

So I ran compute_dire for CelebAHQ images - both Recons and DIRE, and strangely enough, the celebahqsdv2 ckpt classifies all these real images as fake! lsun-adm, lsun_iddpm and lsun_stylegan correctly classify real images but not the other three ckpts. Very strange as the celebahq checkpoint is trained on celebahq real dataset I presume?

aditipanda commented 1 month ago

both R

I downloaded the celebAHQ dire images and ran test.py - got the same results as Table 3 of the paper.

But for computing dire for my own dataset, I am facing this problem #35 - someone pls help!

XCQ001204 commented 1 day ago

在 T4 GPU 上,每张图像需要 4.5 秒。如果每张图像需要 4.5 秒,则 DIRE 方法对于生产用例来说似乎不切实际。

May I ask if you are using distributed training or training on a single GPU?anks very much!