File size: 822 Bytes
776deff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# De-Fake

It is the code for the paper: DE-FAKE: Detection and Attribution of Fake Images Generated by Text-to-Image Generation Models.

### Environment

You first need to build the environment by:
```
conda env create -f environment.yaml
conda activate defake
```

### Infer

For the usage, You can download our model on 

https://drive.google.com/file/d/1qI7x5iodaCFq0S61LKw4wWjql7cYou_4/view?usp=sharing

and

https://drive.google.com/file/d/1SuenxJP10VwArC6zW0SHMUGObMRqQhBD/view?usp=sharing

for the encoder and classifier.

Then test on 

```
python test.py --image_path XXX
```


### Train

If you want to train the detector yourself, please enter the correct file path in train.py.

Then 

```
python train.py
```

### License

DeFake is licensed under the term of thr MIT license. See LICENSE for more details.