File size: 747 Bytes
981f4d3 a5c16e4 |
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 |
---
license: apache-2.0
base_model:
- facebook/dinov2-with-registers-small
---
### Example
```python
from transformers import AutoImageProcessor, Dinov2WithRegistersForImageClassification
import torch
import numpy as np
from PIL import Image
import os
import pandas as pd
image_processor = AutoImageProcessor.from_pretrained('WpythonW/dinoV2-deepfake-detector')
model = Dinov2WithRegistersForImageClassification.from_pretrained("WpythonW/dinoV2-deepfake-detector")
model.config.id2label = {0: "FAKE", 1: "REAL"}
model.config.label2id = {"FAKE": 0, "REAL": 1}
real = Image.open('real.jpg')
fake = Image.open('fake1.png')
inputs = image_processor([real, fake], return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
```
|