| | --- |
| | 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 |
| | ``` |
| |
|